aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-10-05 04:41:14 -0400
committerTejun Heo <tj@kernel.org>2010-10-05 04:41:14 -0400
commit97bd234701b2b39a0e749c1fe0e44f1d14c94292 (patch)
treefffbd48576c507f8a2e186ad0ebbf777aadf8bf0 /include
parent09383498c5d35262e643bfdbae84826177a3c624 (diff)
workqueue: prepare for more tracepoints
Define workqueue_work event class and use it for workqueue_execute_end trace point. Also, move trace/events/workqueue.h include downwards such that all struct definitions are visible to it. This is to prepare for more tracepoints and doesn't cause any functional change. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/trace/events/workqueue.h32
1 files changed, 19 insertions, 13 deletions
diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h
index 49682d7e9d60..ec9d7244eb9f 100644
--- a/include/trace/events/workqueue.h
+++ b/include/trace/events/workqueue.h
@@ -7,13 +7,7 @@
7#include <linux/tracepoint.h> 7#include <linux/tracepoint.h>
8#include <linux/workqueue.h> 8#include <linux/workqueue.h>
9 9
10/** 10DECLARE_EVENT_CLASS(workqueue_work,
11 * workqueue_execute_start - called immediately before the workqueue callback
12 * @work: pointer to struct work_struct
13 *
14 * Allows to track workqueue execution.
15 */
16TRACE_EVENT(workqueue_execute_start,
17 11
18 TP_PROTO(struct work_struct *work), 12 TP_PROTO(struct work_struct *work),
19 13
@@ -21,24 +15,22 @@ TRACE_EVENT(workqueue_execute_start,
21 15
22 TP_STRUCT__entry( 16 TP_STRUCT__entry(
23 __field( void *, work ) 17 __field( void *, work )
24 __field( void *, function)
25 ), 18 ),
26 19
27 TP_fast_assign( 20 TP_fast_assign(
28 __entry->work = work; 21 __entry->work = work;
29 __entry->function = work->func;
30 ), 22 ),
31 23
32 TP_printk("work struct %p: function %pf", __entry->work, __entry->function) 24 TP_printk("work struct %p", __entry->work)
33); 25);
34 26
35/** 27/**
36 * workqueue_execute_end - called immediately before the workqueue callback 28 * workqueue_execute_start - called immediately before the workqueue callback
37 * @work: pointer to struct work_struct 29 * @work: pointer to struct work_struct
38 * 30 *
39 * Allows to track workqueue execution. 31 * Allows to track workqueue execution.
40 */ 32 */
41TRACE_EVENT(workqueue_execute_end, 33TRACE_EVENT(workqueue_execute_start,
42 34
43 TP_PROTO(struct work_struct *work), 35 TP_PROTO(struct work_struct *work),
44 36
@@ -46,15 +38,29 @@ TRACE_EVENT(workqueue_execute_end,
46 38
47 TP_STRUCT__entry( 39 TP_STRUCT__entry(
48 __field( void *, work ) 40 __field( void *, work )
41 __field( void *, function)
49 ), 42 ),
50 43
51 TP_fast_assign( 44 TP_fast_assign(
52 __entry->work = work; 45 __entry->work = work;
46 __entry->function = work->func;
53 ), 47 ),
54 48
55 TP_printk("work struct %p", __entry->work) 49 TP_printk("work struct %p: function %pf", __entry->work, __entry->function)
56); 50);
57 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 */
58DEFINE_EVENT(workqueue_work, workqueue_execute_end,
59
60 TP_PROTO(struct work_struct *work),
61
62 TP_ARGS(work)
63);
58 64
59#endif /* _TRACE_WORKQUEUE_H */ 65#endif /* _TRACE_WORKQUEUE_H */
60 66