2 #define TRACE_SYSTEM lockdep
4 #if !defined(_TRACE_LOCKDEP_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_LOCKDEP_H
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
)
26 __entry
->flags
= (trylock
? 1 : 0) | (read
? 2 : 0);
27 __assign_str(name
, lock
->name
);
30 TP_printk("%s%s%s", (__entry
->flags
& 1) ? "try " : "",
31 (__entry
->flags
& 2) ? "read " : "",
35 TRACE_EVENT(lock_release
,
37 TP_PROTO(struct lockdep_map
*lock
, int nested
, unsigned long ip
),
39 TP_ARGS(lock
, nested
, ip
),
42 __string(name
, lock
->name
)
46 __assign_str(name
, lock
->name
);
49 TP_printk("%s", __get_str(name
))
52 #ifdef CONFIG_LOCK_STAT
54 TRACE_EVENT(lock_contended
,
56 TP_PROTO(struct lockdep_map
*lock
, unsigned long ip
),
61 __string(name
, lock
->name
)
65 __assign_str(name
, lock
->name
);
68 TP_printk("%s", __get_str(name
))
71 TRACE_EVENT(lock_acquired
,
72 TP_PROTO(struct lockdep_map
*lock
, unsigned long ip
, s64 waittime
),
74 TP_ARGS(lock
, ip
, waittime
),
77 __string(name
, lock
->name
)
78 __field(unsigned long, wait_usec
)
79 __field(unsigned long, wait_nsec_rem
)
82 __assign_str(name
, lock
->name
);
83 __entry
->wait_nsec_rem
= do_div(waittime
, NSEC_PER_USEC
);
84 __entry
->wait_usec
= (unsigned long) waittime
;
86 TP_printk("%s (%lu.%03lu us)", __get_str(name
), __entry
->wait_usec
,
87 __entry
->wait_nsec_rem
)
93 #endif /* _TRACE_LOCKDEP_H */
95 /* This part must be outside protection */
96 #include <trace/define_trace.h>