]> git.proxmox.com Git - mirror_ubuntu-kernels.git/blob - include/trace/events/lockdep.h
45e326b5c7f3e69b81e1453782090e3b7c903433
[mirror_ubuntu-kernels.git] / include / trace / events / lockdep.h
1 #if !defined(_TRACE_LOCKDEP_H) || defined(TRACE_HEADER_MULTI_READ)
2 #define _TRACE_LOCKDEP_H
3
4 #include <linux/lockdep.h>
5 #include <linux/tracepoint.h>
6
7 #undef TRACE_SYSTEM
8 #define TRACE_SYSTEM lockdep
9
10 #ifdef CONFIG_LOCKDEP
11
12 TRACE_FORMAT(lock_acquire,
13 TP_PROTO(struct lockdep_map *lock, unsigned int subclass,
14 int trylock, int read, int check,
15 struct lockdep_map *next_lock, unsigned long ip),
16 TP_ARGS(lock, subclass, trylock, read, check, next_lock, ip),
17 TP_FMT("%s%s%s", trylock ? "try " : "",
18 read ? "read " : "", lock->name)
19 );
20
21 TRACE_FORMAT(lock_release,
22 TP_PROTO(struct lockdep_map *lock, int nested, unsigned long ip),
23 TP_ARGS(lock, nested, ip),
24 TP_FMT("%s", lock->name)
25 );
26
27 #ifdef CONFIG_LOCK_STAT
28
29 TRACE_FORMAT(lock_contended,
30 TP_PROTO(struct lockdep_map *lock, unsigned long ip),
31 TP_ARGS(lock, ip),
32 TP_FMT("%s", lock->name)
33 );
34
35 TRACE_EVENT(lock_acquired,
36 TP_PROTO(struct lockdep_map *lock, unsigned long ip, s64 waittime),
37
38 TP_ARGS(lock, ip, waittime),
39
40 TP_STRUCT__entry(
41 __field(const char *, name)
42 __field(unsigned long, wait_usec)
43 __field(unsigned long, wait_nsec_rem)
44 ),
45 TP_fast_assign(
46 __entry->name = lock->name;
47 __entry->wait_nsec_rem = do_div(waittime, NSEC_PER_USEC);
48 __entry->wait_usec = (unsigned long) waittime;
49 ),
50 TP_printk("%s (%lu.%03lu us)", __entry->name, __entry->wait_usec,
51 __entry->wait_nsec_rem)
52 );
53
54 #endif
55 #endif
56
57 #endif /* _TRACE_LOCKDEP_H */
58
59 /* This part must be outside protection */
60 #include <trace/define_trace.h>