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 ctf_integer_hex(void *, work
, work
)
32 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
34 * workqueue_queue_work - called when a work gets queued
35 * @req_cpu: the requested cpu
36 * @cwq: pointer to struct cpu_workqueue_struct
37 * @work: pointer to struct work_struct
39 * This event occurs when a work is queued immediately or once a
40 * delayed work is actually queued on a workqueue (ie: once the delay
43 LTTNG_TRACEPOINT_EVENT(workqueue_queue_work
,
45 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
46 TP_PROTO(unsigned int req_cpu
, struct pool_workqueue
*pwq
,
47 struct work_struct
*work
),
49 TP_ARGS(req_cpu
, pwq
, work
),
51 TP_PROTO(unsigned int req_cpu
, struct cpu_workqueue_struct
*cwq
,
52 struct work_struct
*work
),
54 TP_ARGS(req_cpu
, cwq
, work
),
58 ctf_integer_hex(void *, work
, work
)
59 ctf_integer_hex(void *, function
, work
->func
)
60 ctf_integer(unsigned int, req_cpu
, req_cpu
)
65 * workqueue_activate_work - called when a work gets activated
66 * @work: pointer to struct work_struct
68 * This event occurs when a queued work is put on the active queue,
69 * which happens immediately after queueing unless @max_active limit
72 LTTNG_TRACEPOINT_EVENT_INSTANCE(workqueue_work
, workqueue_activate_work
,
74 TP_PROTO(struct work_struct
*work
),
81 * workqueue_execute_start - called immediately before the workqueue callback
82 * @work: pointer to struct work_struct
84 * Allows to track workqueue execution.
86 LTTNG_TRACEPOINT_EVENT(workqueue_execute_start
,
88 TP_PROTO(struct work_struct
*work
),
93 ctf_integer_hex(void *, work
, work
)
94 ctf_integer_hex(void *, function
, work
->func
)
99 * workqueue_execute_end - called immediately after the workqueue callback
100 * @work: pointer to struct work_struct
102 * Allows to track workqueue execution.
104 LTTNG_TRACEPOINT_EVENT_INSTANCE(workqueue_work
, workqueue_execute_end
,
106 TP_PROTO(struct work_struct
*work
),
113 LTTNG_TRACEPOINT_EVENT_CLASS(workqueue
,
115 TP_PROTO(struct task_struct
*wq_thread
, struct work_struct
*work
),
117 TP_ARGS(wq_thread
, work
),
120 ctf_array(char, thread_comm
, wq_thread
->comm
, TASK_COMM_LEN
)
121 ctf_integer(pid_t
, thread_pid
, wq_thread
->pid
)
122 ctf_integer_hex(work_func_t
, func
, work
->func
)
126 LTTNG_TRACEPOINT_EVENT_INSTANCE(workqueue
, workqueue_insertion
,
128 TP_PROTO(struct task_struct
*wq_thread
, struct work_struct
*work
),
130 TP_ARGS(wq_thread
, work
)
133 LTTNG_TRACEPOINT_EVENT_INSTANCE(workqueue
, workqueue_execution
,
135 TP_PROTO(struct task_struct
*wq_thread
, struct work_struct
*work
),
137 TP_ARGS(wq_thread
, work
)
140 /* Trace the creation of one workqueue thread on a cpu */
141 LTTNG_TRACEPOINT_EVENT(workqueue_creation
,
143 TP_PROTO(struct task_struct
*wq_thread
, int cpu
),
145 TP_ARGS(wq_thread
, cpu
),
148 ctf_array(char, thread_comm
, wq_thread
->comm
, TASK_COMM_LEN
)
149 ctf_integer(pid_t
, thread_pid
, wq_thread
->pid
)
150 ctf_integer(int, cpu
, cpu
)
154 LTTNG_TRACEPOINT_EVENT(workqueue_destruction
,
156 TP_PROTO(struct task_struct
*wq_thread
),
161 ctf_array(char, thread_comm
, wq_thread
->comm
, TASK_COMM_LEN
)
162 ctf_integer(pid_t
, thread_pid
, wq_thread
->pid
)
168 #endif /* LTTNG_TRACE_WORKQUEUE_H */
170 /* This part must be outside protection */
171 #include <probes/define_trace.h>
This page took 0.033951 seconds and 4 git commands to generate.