2 #define TRACE_SYSTEM workqueue
4 #if !defined(LTTNG_TRACE_WORKQUEUE_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define LTTNG_TRACE_WORKQUEUE_H
7 #include "../../../probes/lttng-tracepoint-event.h"
8 #include <linux/workqueue.h>
9 #include <linux/version.h>
11 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
13 #ifndef _TRACE_WORKQUEUE_DEF_
14 #define _TRACE_WORKQUEUE_DEF_
21 LTTNG_TRACEPOINT_EVENT_CLASS(workqueue_work
,
23 TP_PROTO(struct work_struct
*work
),
28 __field( void *, work
)
35 TP_printk("work struct %p", __entry
->work
)
38 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
40 * workqueue_queue_work - called when a work gets queued
41 * @req_cpu: the requested cpu
42 * @cwq: pointer to struct cpu_workqueue_struct
43 * @work: pointer to struct work_struct
45 * This event occurs when a work is queued immediately or once a
46 * delayed work is actually queued on a workqueue (ie: once the delay
49 LTTNG_TRACEPOINT_EVENT(workqueue_queue_work
,
51 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
52 TP_PROTO(unsigned int req_cpu
, struct pool_workqueue
*pwq
,
53 struct work_struct
*work
),
55 TP_ARGS(req_cpu
, pwq
, work
),
57 TP_PROTO(unsigned int req_cpu
, struct cpu_workqueue_struct
*cwq
,
58 struct work_struct
*work
),
60 TP_ARGS(req_cpu
, cwq
, work
),
64 __field( void *, work
)
65 __field( void *, function
)
66 __field( unsigned int, req_cpu
)
71 tp_assign(function
, work
->func
)
72 tp_assign(req_cpu
, req_cpu
)
75 TP_printk("work struct=%p function=%pf req_cpu=%u",
76 __entry
->work
, __entry
->function
,
81 * workqueue_activate_work - called when a work gets activated
82 * @work: pointer to struct work_struct
84 * This event occurs when a queued work is put on the active queue,
85 * which happens immediately after queueing unless @max_active limit
88 LTTNG_TRACEPOINT_EVENT_INSTANCE(workqueue_work
, workqueue_activate_work
,
90 TP_PROTO(struct work_struct
*work
),
97 * workqueue_execute_start - called immediately before the workqueue callback
98 * @work: pointer to struct work_struct
100 * Allows to track workqueue execution.
102 LTTNG_TRACEPOINT_EVENT(workqueue_execute_start
,
104 TP_PROTO(struct work_struct
*work
),
109 __field( void *, work
)
110 __field( void *, function
)
114 tp_assign(work
, work
)
115 tp_assign(function
, work
->func
)
118 TP_printk("work struct %p: function %pf", __entry
->work
, __entry
->function
)
122 * workqueue_execute_end - called immediately after the workqueue callback
123 * @work: pointer to struct work_struct
125 * Allows to track workqueue execution.
127 LTTNG_TRACEPOINT_EVENT_INSTANCE(workqueue_work
, workqueue_execute_end
,
129 TP_PROTO(struct work_struct
*work
),
136 LTTNG_TRACEPOINT_EVENT_CLASS(workqueue
,
138 TP_PROTO(struct task_struct
*wq_thread
, struct work_struct
*work
),
140 TP_ARGS(wq_thread
, work
),
143 __array(char, thread_comm
, TASK_COMM_LEN
)
144 __field(pid_t
, thread_pid
)
145 __field(work_func_t
, func
)
149 tp_memcpy(thread_comm
, wq_thread
->comm
, TASK_COMM_LEN
)
150 tp_assign(thread_pid
, wq_thread
->pid
)
151 tp_assign(func
, work
->func
)
154 TP_printk("thread=%s:%d func=%pf", __entry
->thread_comm
,
155 __entry
->thread_pid
, __entry
->func
)
158 LTTNG_TRACEPOINT_EVENT_INSTANCE(workqueue
, workqueue_insertion
,
160 TP_PROTO(struct task_struct
*wq_thread
, struct work_struct
*work
),
162 TP_ARGS(wq_thread
, work
)
165 LTTNG_TRACEPOINT_EVENT_INSTANCE(workqueue
, workqueue_execution
,
167 TP_PROTO(struct task_struct
*wq_thread
, struct work_struct
*work
),
169 TP_ARGS(wq_thread
, work
)
172 /* Trace the creation of one workqueue thread on a cpu */
173 LTTNG_TRACEPOINT_EVENT(workqueue_creation
,
175 TP_PROTO(struct task_struct
*wq_thread
, int cpu
),
177 TP_ARGS(wq_thread
, cpu
),
180 __array(char, thread_comm
, TASK_COMM_LEN
)
181 __field(pid_t
, thread_pid
)
186 tp_memcpy(thread_comm
, wq_thread
->comm
, TASK_COMM_LEN
)
187 tp_assign(thread_pid
, wq_thread
->pid
)
191 TP_printk("thread=%s:%d cpu=%d", __entry
->thread_comm
,
192 __entry
->thread_pid
, __entry
->cpu
)
195 LTTNG_TRACEPOINT_EVENT(workqueue_destruction
,
197 TP_PROTO(struct task_struct
*wq_thread
),
202 __array(char, thread_comm
, TASK_COMM_LEN
)
203 __field(pid_t
, thread_pid
)
207 tp_memcpy(thread_comm
, wq_thread
->comm
, TASK_COMM_LEN
)
208 tp_assign(thread_pid
, wq_thread
->pid
)
211 TP_printk("thread=%s:%d", __entry
->thread_comm
, __entry
->thread_pid
)
216 #endif /* LTTNG_TRACE_WORKQUEUE_H */
218 /* This part must be outside protection */
219 #include "../../../probes/define_trace.h"
This page took 0.032841 seconds and 4 git commands to generate.