1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #define TRACE_SYSTEM workqueue
5 #if !defined(LTTNG_TRACE_WORKQUEUE_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_WORKQUEUE_H
8 #include <lttng/tracepoint-event.h>
9 #include <linux/workqueue.h>
10 #include <lttng/kernel-version.h>
12 #ifndef _TRACE_WORKQUEUE_DEF_
13 #define _TRACE_WORKQUEUE_DEF_
20 LTTNG_TRACEPOINT_EVENT_CLASS(workqueue_work
,
22 TP_PROTO(struct work_struct
*work
),
27 ctf_integer_hex(void *, work
, work
)
32 * workqueue_queue_work - called when a work gets queued
33 * @req_cpu: the requested cpu
34 * @cwq: pointer to struct cpu_workqueue_struct
35 * @work: pointer to struct work_struct
37 * This event occurs when a work is queued immediately or once a
38 * delayed work is actually queued on a workqueue (ie: once the delay
41 LTTNG_TRACEPOINT_EVENT(workqueue_queue_work
,
43 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0))
44 TP_PROTO(unsigned int req_cpu
, struct pool_workqueue
*pwq
,
45 struct work_struct
*work
),
47 TP_ARGS(req_cpu
, pwq
, work
),
49 TP_PROTO(unsigned int req_cpu
, struct cpu_workqueue_struct
*cwq
,
50 struct work_struct
*work
),
52 TP_ARGS(req_cpu
, cwq
, work
),
56 ctf_integer_hex(void *, work
, work
)
57 ctf_integer_hex(void *, function
, work
->func
)
58 ctf_integer(unsigned int, req_cpu
, req_cpu
)
63 * workqueue_activate_work - called when a work gets activated
64 * @work: pointer to struct work_struct
66 * This event occurs when a queued work is put on the active queue,
67 * which happens immediately after queueing unless @max_active limit
70 LTTNG_TRACEPOINT_EVENT_INSTANCE(workqueue_work
, workqueue_activate_work
,
72 TP_PROTO(struct work_struct
*work
),
78 * workqueue_execute_start - called immediately before the workqueue callback
79 * @work: pointer to struct work_struct
81 * Allows to track workqueue execution.
83 LTTNG_TRACEPOINT_EVENT(workqueue_execute_start
,
85 TP_PROTO(struct work_struct
*work
),
90 ctf_integer_hex(void *, work
, work
)
91 ctf_integer_hex(void *, function
, work
->func
)
95 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0))
97 * workqueue_execute_end - called immediately after the workqueue callback
98 * @work: pointer to struct work_struct
99 * @function: pointer to worker function
101 * Allows to track workqueue execution.
103 LTTNG_TRACEPOINT_EVENT(workqueue_execute_end
,
105 TP_PROTO(struct work_struct
*work
, work_func_t function
),
107 TP_ARGS(work
, function
),
110 ctf_integer_hex(void *, work
, work
)
111 ctf_integer_hex(void *, function
, function
)
116 * workqueue_execute_end - called immediately after the workqueue callback
117 * @work: pointer to struct work_struct
119 * Allows to track workqueue execution.
121 LTTNG_TRACEPOINT_EVENT_INSTANCE(workqueue_work
, workqueue_execute_end
,
123 TP_PROTO(struct work_struct
*work
),
129 #endif /* LTTNG_TRACE_WORKQUEUE_H */
131 /* This part must be outside protection */
132 #include <lttng/define_trace.h>
This page took 0.039968 seconds and 4 git commands to generate.