Full support for Ginger Console
[linux-ginger.git] / include / trace / events / lockdep.h
blobbcf1d209a00dabf7838aae49c2e5edcc5fc6dde8
1 #undef TRACE_SYSTEM
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>
10 #ifdef CONFIG_LOCKDEP
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),
20 TP_STRUCT__entry(
21 __field(unsigned int, flags)
22 __string(name, lock->name)
25 TP_fast_assign(
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 " : "",
32 __get_str(name))
35 TRACE_EVENT(lock_release,
37 TP_PROTO(struct lockdep_map *lock, int nested, unsigned long ip),
39 TP_ARGS(lock, nested, ip),
41 TP_STRUCT__entry(
42 __string(name, lock->name)
45 TP_fast_assign(
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),
58 TP_ARGS(lock, ip),
60 TP_STRUCT__entry(
61 __string(name, lock->name)
64 TP_fast_assign(
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),
76 TP_STRUCT__entry(
77 __string(name, lock->name)
78 __field(unsigned long, wait_usec)
79 __field(unsigned long, wait_nsec_rem)
81 TP_fast_assign(
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)
90 #endif
91 #endif
93 #endif /* _TRACE_LOCKDEP_H */
95 /* This part must be outside protection */
96 #include <trace/define_trace.h>