blob: ec9d7244eb9f5ea493e4e492dd33e8278b1090fe [file] [log] [blame]
Arjan van de Vene36c8862010-08-21 13:07:26 -07001#undef TRACE_SYSTEM
2#define TRACE_SYSTEM workqueue
3
4#if !defined(_TRACE_WORKQUEUE_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_WORKQUEUE_H
6
7#include <linux/tracepoint.h>
8#include <linux/workqueue.h>
9
Tejun Heo97bd2342010-10-05 10:41:14 +020010DECLARE_EVENT_CLASS(workqueue_work,
11
12 TP_PROTO(struct work_struct *work),
13
14 TP_ARGS(work),
15
16 TP_STRUCT__entry(
17 __field( void *, work )
18 ),
19
20 TP_fast_assign(
21 __entry->work = work;
22 ),
23
24 TP_printk("work struct %p", __entry->work)
25);
26
Arjan van de Vene36c8862010-08-21 13:07:26 -070027/**
28 * workqueue_execute_start - called immediately before the workqueue callback
29 * @work: pointer to struct work_struct
30 *
31 * Allows to track workqueue execution.
32 */
33TRACE_EVENT(workqueue_execute_start,
34
35 TP_PROTO(struct work_struct *work),
36
37 TP_ARGS(work),
38
39 TP_STRUCT__entry(
40 __field( void *, work )
41 __field( void *, function)
42 ),
43
44 TP_fast_assign(
45 __entry->work = work;
46 __entry->function = work->func;
47 ),
48
49 TP_printk("work struct %p: function %pf", __entry->work, __entry->function)
50);
51
52/**
53 * workqueue_execute_end - called immediately before the workqueue callback
54 * @work: pointer to struct work_struct
55 *
56 * Allows to track workqueue execution.
57 */
Tejun Heo97bd2342010-10-05 10:41:14 +020058DEFINE_EVENT(workqueue_work, workqueue_execute_end,
Arjan van de Vene36c8862010-08-21 13:07:26 -070059
60 TP_PROTO(struct work_struct *work),
61
Tejun Heo97bd2342010-10-05 10:41:14 +020062 TP_ARGS(work)
Arjan van de Vene36c8862010-08-21 13:07:26 -070063);
64
Arjan van de Vene36c8862010-08-21 13:07:26 -070065#endif /* _TRACE_WORKQUEUE_H */
66
67/* This part must be outside protection */
68#include <trace/define_trace.h>