1 /* SPDX-License-Identifier: GPL-2.0 */
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 <probes/lttng-tracepoint-event.h>
9 #include <linux/workqueue.h>
10 #include <lttng-kernel-version.h>
12 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(2,6,36))
14 #ifndef _TRACE_WORKQUEUE_DEF_
15 #define _TRACE_WORKQUEUE_DEF_
22 LTTNG_TRACEPOINT_EVENT_CLASS(workqueue_work
,
24 TP_PROTO(struct work_struct
*work
),
29 ctf_integer_hex(void *, work
, work
)
33 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(2,6,37))
35 * workqueue_queue_work - called when a work gets queued
36 * @req_cpu: the requested cpu
37 * @cwq: pointer to struct cpu_workqueue_struct
38 * @work: pointer to struct work_struct
40 * This event occurs when a work is queued immediately or once a
41 * delayed work is actually queued on a workqueue (ie: once the delay
44 LTTNG_TRACEPOINT_EVENT(workqueue_queue_work
,
46 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0))
47 TP_PROTO(unsigned int req_cpu
, struct pool_workqueue
*pwq
,
48 struct work_struct
*work
),
50 TP_ARGS(req_cpu
, pwq
, work
),
52 TP_PROTO(unsigned int req_cpu
, struct cpu_workqueue_struct
*cwq
,
53 struct work_struct
*work
),
55 TP_ARGS(req_cpu
, cwq
, work
),
59 ctf_integer_hex(void *, work
, work
)
60 ctf_integer_hex(void *, function
, work
->func
)
61 ctf_integer(unsigned int, req_cpu
, req_cpu
)
66 * workqueue_activate_work - called when a work gets activated
67 * @work: pointer to struct work_struct
69 * This event occurs when a queued work is put on the active queue,
70 * which happens immediately after queueing unless @max_active limit
73 LTTNG_TRACEPOINT_EVENT_INSTANCE(workqueue_work
, workqueue_activate_work
,
75 TP_PROTO(struct work_struct
*work
),
82 * workqueue_execute_start - called immediately before the workqueue callback
83 * @work: pointer to struct work_struct
85 * Allows to track workqueue execution.
87 LTTNG_TRACEPOINT_EVENT(workqueue_execute_start
,
89 TP_PROTO(struct work_struct
*work
),
94 ctf_integer_hex(void *, work
, work
)
95 ctf_integer_hex(void *, function
, work
->func
)
99 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0))
101 * workqueue_execute_end - called immediately after the workqueue callback
102 * @work: pointer to struct work_struct
103 * @function: pointer to worker function
105 * Allows to track workqueue execution.
107 LTTNG_TRACEPOINT_EVENT(workqueue_execute_end
,
109 TP_PROTO(struct work_struct
*work
, work_func_t function
),
111 TP_ARGS(work
, function
),
114 ctf_integer_hex(void *, work
, work
)
115 ctf_integer_hex(void *, function
, function
)
120 * workqueue_execute_end - called immediately after the workqueue callback
121 * @work: pointer to struct work_struct
123 * Allows to track workqueue execution.
125 LTTNG_TRACEPOINT_EVENT_INSTANCE(workqueue_work
, workqueue_execute_end
,
127 TP_PROTO(struct work_struct
*work
),
135 LTTNG_TRACEPOINT_EVENT_CLASS(workqueue
,
137 TP_PROTO(struct task_struct
*wq_thread
, struct work_struct
*work
),
139 TP_ARGS(wq_thread
, work
),
142 ctf_array(char, thread_comm
, wq_thread
->comm
, TASK_COMM_LEN
)
143 ctf_integer(pid_t
, thread_pid
, wq_thread
->pid
)
144 ctf_integer_hex(work_func_t
, func
, work
->func
)
148 LTTNG_TRACEPOINT_EVENT_INSTANCE(workqueue
, workqueue_insertion
,
150 TP_PROTO(struct task_struct
*wq_thread
, struct work_struct
*work
),
152 TP_ARGS(wq_thread
, work
)
155 LTTNG_TRACEPOINT_EVENT_INSTANCE(workqueue
, workqueue_execution
,
157 TP_PROTO(struct task_struct
*wq_thread
, struct work_struct
*work
),
159 TP_ARGS(wq_thread
, work
)
162 /* Trace the creation of one workqueue thread on a cpu */
163 LTTNG_TRACEPOINT_EVENT(workqueue_creation
,
165 TP_PROTO(struct task_struct
*wq_thread
, int cpu
),
167 TP_ARGS(wq_thread
, cpu
),
170 ctf_array(char, thread_comm
, wq_thread
->comm
, TASK_COMM_LEN
)
171 ctf_integer(pid_t
, thread_pid
, wq_thread
->pid
)
172 ctf_integer(int, cpu
, cpu
)
176 LTTNG_TRACEPOINT_EVENT(workqueue_destruction
,
178 TP_PROTO(struct task_struct
*wq_thread
),
183 ctf_array(char, thread_comm
, wq_thread
->comm
, TASK_COMM_LEN
)
184 ctf_integer(pid_t
, thread_pid
, wq_thread
->pid
)
190 #endif /* LTTNG_TRACE_WORKQUEUE_H */
192 /* This part must be outside protection */
193 #include <probes/define_trace.h>
This page took 0.03423 seconds and 5 git commands to generate.