2 #define TRACE_SYSTEM lock
4 #if !defined(_TRACE_LOCK_H) || defined(TRACE_HEADER_MULTI_READ)
7 #include <linux/lockdep.h>
8 #include <linux/tracepoint.h>
12 TRACE_EVENT(lock_acquire
,
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
),
18 TP_ARGS(lock
, subclass
, trylock
, read
, check
, next_lock
, ip
),
21 __field(unsigned int, flags
)
22 __string(name
, lock
->name
)
23 __field(void *, lockdep_addr
)
27 __entry
->flags
= (trylock
? 1 : 0) | (read
? 2 : 0);
28 __assign_str(name
, lock
->name
);
29 __entry
->lockdep_addr
= lock
;
32 TP_printk("%p %s%s%s", __entry
->lockdep_addr
,
33 (__entry
->flags
& 1) ? "try " : "",
34 (__entry
->flags
& 2) ? "read " : "",
38 DECLARE_EVENT_CLASS(lock
,
40 TP_PROTO(struct lockdep_map
*lock
, unsigned long ip
),
45 __string( name
, lock
->name
)
46 __field( void *, lockdep_addr
)
50 __assign_str(name
, lock
->name
);
51 __entry
->lockdep_addr
= lock
;
54 TP_printk("%p %s", __entry
->lockdep_addr
, __get_str(name
))
57 DEFINE_EVENT(lock
, lock_release
,
59 TP_PROTO(struct lockdep_map
*lock
, unsigned long ip
),
64 #ifdef CONFIG_LOCK_STAT
66 DEFINE_EVENT(lock
, lock_contended
,
68 TP_PROTO(struct lockdep_map
*lock
, unsigned long ip
),
73 DEFINE_EVENT(lock
, lock_acquired
,
75 TP_PROTO(struct lockdep_map
*lock
, unsigned long ip
),
83 #endif /* _TRACE_LOCK_H */
85 /* This part must be outside protection */
86 #include <trace/define_trace.h>