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