]>
Commit | Line | Data |
---|---|---|
d0b6e04a | 1 | #undef TRACE_SYSTEM |
67178767 | 2 | #define TRACE_SYSTEM lock |
d0b6e04a | 3 | |
67178767 FW |
4 | #if !defined(_TRACE_LOCK_H) || defined(TRACE_HEADER_MULTI_READ) |
5 | #define _TRACE_LOCK_H | |
efed792d PZ |
6 | |
7 | #include <linux/lockdep.h> | |
8 | #include <linux/tracepoint.h> | |
9 | ||
ea20d929 SR |
10 | #ifdef CONFIG_LOCKDEP |
11 | ||
39517091 SR |
12 | TRACE_EVENT(lock_acquire, |
13 | ||
ea20d929 SR |
14 | TP_PROTO(struct lockdep_map *lock, unsigned int subclass, |
15 | int trylock, int read, int check, | |
16 | struct lockdep_map *next_lock, unsigned long ip), | |
39517091 | 17 | |
ea20d929 | 18 | TP_ARGS(lock, subclass, trylock, read, check, next_lock, ip), |
ea20d929 | 19 | |
39517091 SR |
20 | TP_STRUCT__entry( |
21 | __field(unsigned int, flags) | |
22 | __string(name, lock->name) | |
c965be10 | 23 | __field(void *, lockdep_addr) |
39517091 SR |
24 | ), |
25 | ||
26 | TP_fast_assign( | |
27 | __entry->flags = (trylock ? 1 : 0) | (read ? 2 : 0); | |
28 | __assign_str(name, lock->name); | |
c965be10 | 29 | __entry->lockdep_addr = lock; |
39517091 SR |
30 | ), |
31 | ||
c965be10 HM |
32 | TP_printk("%p %s%s%s", __entry->lockdep_addr, |
33 | (__entry->flags & 1) ? "try " : "", | |
39517091 SR |
34 | (__entry->flags & 2) ? "read " : "", |
35 | __get_str(name)) | |
36 | ); | |
37 | ||
2c193c73 | 38 | DECLARE_EVENT_CLASS(lock, |
39517091 | 39 | |
93135439 | 40 | TP_PROTO(struct lockdep_map *lock, unsigned long ip), |
39517091 | 41 | |
93135439 | 42 | TP_ARGS(lock, ip), |
39517091 SR |
43 | |
44 | TP_STRUCT__entry( | |
2c193c73 FW |
45 | __string( name, lock->name ) |
46 | __field( void *, lockdep_addr ) | |
39517091 SR |
47 | ), |
48 | ||
49 | TP_fast_assign( | |
50 | __assign_str(name, lock->name); | |
c965be10 | 51 | __entry->lockdep_addr = lock; |
39517091 SR |
52 | ), |
53 | ||
2c193c73 | 54 | TP_printk("%p %s", __entry->lockdep_addr, __get_str(name)) |
39517091 | 55 | ); |
ea20d929 | 56 | |
2c193c73 | 57 | DEFINE_EVENT(lock, lock_release, |
39517091 | 58 | |
ea20d929 | 59 | TP_PROTO(struct lockdep_map *lock, unsigned long ip), |
39517091 | 60 | |
2c193c73 FW |
61 | TP_ARGS(lock, ip) |
62 | ); | |
39517091 | 63 | |
2c193c73 | 64 | #ifdef CONFIG_LOCK_STAT |
39517091 | 65 | |
2c193c73 | 66 | DEFINE_EVENT(lock, lock_contended, |
ea20d929 | 67 | |
883a2a31 | 68 | TP_PROTO(struct lockdep_map *lock, unsigned long ip), |
ea20d929 | 69 | |
2c193c73 FW |
70 | TP_ARGS(lock, ip) |
71 | ); | |
ea20d929 | 72 | |
2c193c73 | 73 | DEFINE_EVENT(lock, lock_acquired, |
c965be10 | 74 | |
2c193c73 FW |
75 | TP_PROTO(struct lockdep_map *lock, unsigned long ip), |
76 | ||
77 | TP_ARGS(lock, ip) | |
ea20d929 | 78 | ); |
efed792d PZ |
79 | |
80 | #endif | |
ea20d929 SR |
81 | #endif |
82 | ||
67178767 | 83 | #endif /* _TRACE_LOCK_H */ |
a8d154b0 SR |
84 | |
85 | /* This part must be outside protection */ | |
86 | #include <trace/define_trace.h> |