2 #define TRACE_SYSTEM workqueue
4 #if !defined(_TRACE_WORKQUEUE_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_WORKQUEUE_H
7 #include <linux/workqueue.h>
8 #include <linux/sched.h>
9 #include <linux/tracepoint.h>
11 DECLARE_EVENT_CLASS(workqueue
,
13 TP_PROTO(struct task_struct
*wq_thread
, struct work_struct
*work
),
15 TP_ARGS(wq_thread
, work
),
18 __array(char, thread_comm
, TASK_COMM_LEN
)
19 __field(pid_t
, thread_pid
)
20 __field(work_func_t
, func
)
24 memcpy(__entry
->thread_comm
, wq_thread
->comm
, TASK_COMM_LEN
);
25 __entry
->thread_pid
= wq_thread
->pid
;
26 __entry
->func
= work
->func
;
29 TP_printk("thread=%s:%d func=%pf", __entry
->thread_comm
,
30 __entry
->thread_pid
, __entry
->func
)
33 DEFINE_EVENT(workqueue
, workqueue_insertion
,
35 TP_PROTO(struct task_struct
*wq_thread
, struct work_struct
*work
),
37 TP_ARGS(wq_thread
, work
)
40 DEFINE_EVENT(workqueue
, workqueue_execution
,
42 TP_PROTO(struct task_struct
*wq_thread
, struct work_struct
*work
),
44 TP_ARGS(wq_thread
, work
)
47 /* Trace the creation of one workqueue thread on a cpu */
48 TRACE_EVENT(workqueue_creation
,
50 TP_PROTO(struct task_struct
*wq_thread
, int cpu
),
52 TP_ARGS(wq_thread
, cpu
),
55 __array(char, thread_comm
, TASK_COMM_LEN
)
56 __field(pid_t
, thread_pid
)
61 memcpy(__entry
->thread_comm
, wq_thread
->comm
, TASK_COMM_LEN
);
62 __entry
->thread_pid
= wq_thread
->pid
;
66 TP_printk("thread=%s:%d cpu=%d", __entry
->thread_comm
,
67 __entry
->thread_pid
, __entry
->cpu
)
70 TRACE_EVENT(workqueue_destruction
,
72 TP_PROTO(struct task_struct
*wq_thread
),
77 __array(char, thread_comm
, TASK_COMM_LEN
)
78 __field(pid_t
, thread_pid
)
82 memcpy(__entry
->thread_comm
, wq_thread
->comm
, TASK_COMM_LEN
);
83 __entry
->thread_pid
= wq_thread
->pid
;
86 TP_printk("thread=%s:%d", __entry
->thread_comm
, __entry
->thread_pid
)
89 #endif /* _TRACE_WORKQUEUE_H */
91 /* This part must be outside protection */
92 #include <trace/define_trace.h>