Commit | Line | Data |
---|---|---|
61baff6e MJ |
1 | // SPDX-FileCopyrightText: 2012 Paul Woegerer <paul_woegerer@mentor.com> |
2 | // | |
3 | // SPDX-License-Identifier: GPL-2.0-only | |
7c68b363 | 4 | |
b283666f PW |
5 | #undef TRACE_SYSTEM |
6 | #define TRACE_SYSTEM lock | |
7 | ||
3bc29f0a MD |
8 | #if !defined(LTTNG_TRACE_LOCK_H) || defined(TRACE_HEADER_MULTI_READ) |
9 | #define LTTNG_TRACE_LOCK_H | |
b283666f PW |
10 | |
11 | #include <linux/lockdep.h> | |
3b4aafcb | 12 | #include <lttng/tracepoint-event.h> |
b283666f PW |
13 | |
14 | #ifdef CONFIG_LOCKDEP | |
15 | ||
3bc29f0a | 16 | LTTNG_TRACEPOINT_EVENT(lock_acquire, |
b283666f PW |
17 | |
18 | TP_PROTO(struct lockdep_map *lock, unsigned int subclass, | |
19 | int trylock, int read, int check, | |
20 | struct lockdep_map *next_lock, unsigned long ip), | |
21 | ||
22 | TP_ARGS(lock, subclass, trylock, read, check, next_lock, ip), | |
23 | ||
f127e61e MD |
24 | TP_FIELDS( |
25 | ctf_integer(unsigned int, flags, (trylock ? 1 : 0) | (read ? 2 : 0)) | |
26 | ctf_string(name, lock->name) | |
fa91fcac | 27 | ctf_integer_hex(void *, lockdep_addr, lock) |
f127e61e | 28 | ) |
b283666f PW |
29 | ) |
30 | ||
3bc29f0a | 31 | LTTNG_TRACEPOINT_EVENT_CLASS(lock, |
b283666f PW |
32 | |
33 | TP_PROTO(struct lockdep_map *lock, unsigned long ip), | |
34 | ||
35 | TP_ARGS(lock, ip), | |
36 | ||
f127e61e MD |
37 | TP_FIELDS( |
38 | ctf_string(name, lock->name) | |
fa91fcac | 39 | ctf_integer_hex(void *, lockdep_addr, lock) |
f127e61e | 40 | ) |
b283666f PW |
41 | ) |
42 | ||
3bc29f0a | 43 | LTTNG_TRACEPOINT_EVENT_INSTANCE(lock, lock_release, |
b283666f PW |
44 | |
45 | TP_PROTO(struct lockdep_map *lock, unsigned long ip), | |
46 | ||
47 | TP_ARGS(lock, ip) | |
48 | ) | |
49 | ||
50 | #ifdef CONFIG_LOCK_STAT | |
51 | ||
3bc29f0a | 52 | LTTNG_TRACEPOINT_EVENT_INSTANCE(lock, lock_contended, |
b283666f PW |
53 | |
54 | TP_PROTO(struct lockdep_map *lock, unsigned long ip), | |
55 | ||
56 | TP_ARGS(lock, ip) | |
57 | ) | |
58 | ||
3bc29f0a | 59 | LTTNG_TRACEPOINT_EVENT_INSTANCE(lock, lock_acquired, |
b283666f PW |
60 | |
61 | TP_PROTO(struct lockdep_map *lock, unsigned long ip), | |
62 | ||
63 | TP_ARGS(lock, ip) | |
64 | ) | |
65 | ||
82ccabf3 | 66 | #endif /* CONFIG_LOCK_STAT */ |
7c68b363 | 67 | |
82ccabf3 | 68 | #endif /* CONFIG_LOCKDEP */ |
b283666f | 69 | |
3bc29f0a | 70 | #endif /* LTTNG_TRACE_LOCK_H */ |
b283666f PW |
71 | |
72 | /* This part must be outside protection */ | |
3b4aafcb | 73 | #include <lttng/define_trace.h> |