aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace/events/workqueue.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/trace/events/workqueue.h')
-rw-r--r--include/trace/events/workqueue.h86
1 files changed, 28 insertions, 58 deletions
diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h
index d6c974474e70..49682d7e9d60 100644
--- a/include/trace/events/workqueue.h
+++ b/include/trace/events/workqueue.h
@@ -4,89 +4,59 @@
4#if !defined(_TRACE_WORKQUEUE_H) || defined(TRACE_HEADER_MULTI_READ) 4#if !defined(_TRACE_WORKQUEUE_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_WORKQUEUE_H 5#define _TRACE_WORKQUEUE_H
6 6
7#include <linux/workqueue.h>
8#include <linux/sched.h>
9#include <linux/tracepoint.h> 7#include <linux/tracepoint.h>
8#include <linux/workqueue.h>
10 9
11DECLARE_EVENT_CLASS(workqueue, 10/**
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,
12 17
13 TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), 18 TP_PROTO(struct work_struct *work),
14 19
15 TP_ARGS(wq_thread, work), 20 TP_ARGS(work),
16 21
17 TP_STRUCT__entry( 22 TP_STRUCT__entry(
18 __array(char, thread_comm, TASK_COMM_LEN) 23 __field( void *, work )
19 __field(pid_t, thread_pid) 24 __field( void *, function)
20 __field(work_func_t, func)
21 ), 25 ),
22 26
23 TP_fast_assign( 27 TP_fast_assign(
24 memcpy(__entry->thread_comm, wq_thread->comm, TASK_COMM_LEN); 28 __entry->work = work;
25 __entry->thread_pid = wq_thread->pid; 29 __entry->function = work->func;
26 __entry->func = work->func;
27 ), 30 ),
28 31
29 TP_printk("thread=%s:%d func=%pf", __entry->thread_comm, 32 TP_printk("work struct %p: function %pf", __entry->work, __entry->function)
30 __entry->thread_pid, __entry->func)
31);
32
33DEFINE_EVENT(workqueue, workqueue_insertion,
34
35 TP_PROTO(struct task_struct *wq_thread, struct work_struct *work),
36
37 TP_ARGS(wq_thread, work)
38);
39
40DEFINE_EVENT(workqueue, workqueue_execution,
41
42 TP_PROTO(struct task_struct *wq_thread, struct work_struct *work),
43
44 TP_ARGS(wq_thread, work)
45); 33);
46 34
47/* Trace the creation of one workqueue thread on a cpu */ 35/**
48TRACE_EVENT(workqueue_creation, 36 * workqueue_execute_end - called immediately before the workqueue callback
37 * @work: pointer to struct work_struct
38 *
39 * Allows to track workqueue execution.
40 */
41TRACE_EVENT(workqueue_execute_end,
49 42
50 TP_PROTO(struct task_struct *wq_thread, int cpu), 43 TP_PROTO(struct work_struct *work),
51 44
52 TP_ARGS(wq_thread, cpu), 45 TP_ARGS(work),
53 46
54 TP_STRUCT__entry( 47 TP_STRUCT__entry(
55 __array(char, thread_comm, TASK_COMM_LEN) 48 __field( void *, work )
56 __field(pid_t, thread_pid)
57 __field(int, cpu)
58 ), 49 ),
59 50
60 TP_fast_assign( 51 TP_fast_assign(
61 memcpy(__entry->thread_comm, wq_thread->comm, TASK_COMM_LEN); 52 __entry->work = work;
62 __entry->thread_pid = wq_thread->pid;
63 __entry->cpu = cpu;
64 ), 53 ),
65 54
66 TP_printk("thread=%s:%d cpu=%d", __entry->thread_comm, 55 TP_printk("work struct %p", __entry->work)
67 __entry->thread_pid, __entry->cpu)
68); 56);
69 57
70TRACE_EVENT(workqueue_destruction,
71
72 TP_PROTO(struct task_struct *wq_thread),
73
74 TP_ARGS(wq_thread),
75
76 TP_STRUCT__entry(
77 __array(char, thread_comm, TASK_COMM_LEN)
78 __field(pid_t, thread_pid)
79 ),
80
81 TP_fast_assign(
82 memcpy(__entry->thread_comm, wq_thread->comm, TASK_COMM_LEN);
83 __entry->thread_pid = wq_thread->pid;
84 ),
85
86 TP_printk("thread=%s:%d", __entry->thread_comm, __entry->thread_pid)
87);
88 58
89#endif /* _TRACE_WORKQUEUE_H */ 59#endif /* _TRACE_WORKQUEUE_H */
90 60
91/* This part must be outside protection */ 61/* This part must be outside protection */
92#include <trace/define_trace.h> 62#include <trace/define_trace.h>