aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace/lockdep.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/trace/lockdep.h')
-rw-r--r--include/trace/lockdep.h52
1 files changed, 50 insertions, 2 deletions
diff --git a/include/trace/lockdep.h b/include/trace/lockdep.h
index 5ca67df87f2a..8ee7900b38c4 100644
--- a/include/trace/lockdep.h
+++ b/include/trace/lockdep.h
@@ -1,9 +1,57 @@
1#ifndef _TRACE_LOCKDEP_H 1#if !defined(_TRACE_LOCKDEP_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_LOCKDEP_H 2#define _TRACE_LOCKDEP_H
3 3
4#include <linux/lockdep.h> 4#include <linux/lockdep.h>
5#include <linux/tracepoint.h> 5#include <linux/tracepoint.h>
6 6
7#include <trace/lockdep_event_types.h> 7#undef TRACE_SYSTEM
8#define TRACE_SYSTEM lock
9
10#ifdef CONFIG_LOCKDEP
11
12TRACE_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
21TRACE_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
29TRACE_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
35TRACE_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);
8 53
9#endif 54#endif
55#endif
56
57#endif /* _TRACE_LOCKDEP_H */