1 /* SPDX-License-Identifier: GPL-2.0 */
2 #include <linux/version.h>
5 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
6 #define TRACE_SYSTEM lock
8 #define TRACE_SYSTEM lockdep
9 #define TRACE_INCLUDE_FILE lock
10 #if defined(_TRACE_LOCKDEP_H)
11 #define LTTNG_TRACE_LOCK_H
15 #if !defined(LTTNG_TRACE_LOCK_H) || defined(TRACE_HEADER_MULTI_READ)
16 #define LTTNG_TRACE_LOCK_H
18 #include <linux/lockdep.h>
19 #include <probes/lttng-tracepoint-event.h>
23 LTTNG_TRACEPOINT_EVENT(lock_acquire
,
25 TP_PROTO(struct lockdep_map
*lock
, unsigned int subclass
,
26 int trylock
, int read
, int check
,
27 struct lockdep_map
*next_lock
, unsigned long ip
),
29 TP_ARGS(lock
, subclass
, trylock
, read
, check
, next_lock
, ip
),
32 ctf_integer(unsigned int, flags
, (trylock
? 1 : 0) | (read
? 2 : 0))
33 ctf_string(name
, lock
->name
)
34 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
35 ctf_integer_hex(void *, lockdep_addr
, lock
)
40 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
42 LTTNG_TRACEPOINT_EVENT_CLASS(lock
,
44 TP_PROTO(struct lockdep_map
*lock
, unsigned long ip
),
49 ctf_string(name
, lock
->name
)
50 ctf_integer_hex(void *, lockdep_addr
, lock
)
54 LTTNG_TRACEPOINT_EVENT_INSTANCE(lock
, lock_release
,
56 TP_PROTO(struct lockdep_map
*lock
, unsigned long ip
),
61 #ifdef CONFIG_LOCK_STAT
63 LTTNG_TRACEPOINT_EVENT_INSTANCE(lock
, lock_contended
,
65 TP_PROTO(struct lockdep_map
*lock
, unsigned long ip
),
70 LTTNG_TRACEPOINT_EVENT_INSTANCE(lock
, lock_acquired
,
72 TP_PROTO(struct lockdep_map
*lock
, unsigned long ip
),
79 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) */
81 LTTNG_TRACEPOINT_EVENT(lock_release
,
83 TP_PROTO(struct lockdep_map
*lock
, int nested
, unsigned long ip
),
85 TP_ARGS(lock
, nested
, ip
),
88 ctf_string(name
, lock
->name
)
89 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
90 ctf_integer_hex(void *, lockdep_addr
, lock
)
95 #ifdef CONFIG_LOCK_STAT
97 LTTNG_TRACEPOINT_EVENT(lock_contended
,
99 TP_PROTO(struct lockdep_map
*lock
, unsigned long ip
),
104 ctf_string(name
, lock
->name
)
105 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
106 ctf_integer_hex(void *, lockdep_addr
, lock
)
111 LTTNG_TRACEPOINT_EVENT(lock_acquired
,
113 TP_PROTO(struct lockdep_map
*lock
, unsigned long ip
, s64 waittime
),
115 TP_ARGS(lock
, ip
, waittime
),
118 ctf_string(name
, lock
->name
)
119 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
120 ctf_integer(s64
, wait_nsec
, wait_nsec
)
121 ctf_integer_hex(void *, lockdep_addr
, lock
)
123 ctf_integer(unsigned long, wait_usec
, (unsigned long) waittime
)
124 ctf_integer(unsigned long, wait_nsec_rem
, do_div(waittime
, NSEC_PER_USEC
))
131 #endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) */
135 #endif /* LTTNG_TRACE_LOCK_H */
137 /* This part must be outside protection */
138 #include <probes/define_trace.h>
This page took 0.031355 seconds and 4 git commands to generate.