Update README.md for supported kernel
[lttng-modules.git] / instrumentation / events / lttng-module / workqueue.h
CommitLineData
b7cdc182 1/* SPDX-License-Identifier: GPL-2.0-only */
b87700e3
AG
2#undef TRACE_SYSTEM
3#define TRACE_SYSTEM workqueue
4
3bc29f0a
MD
5#if !defined(LTTNG_TRACE_WORKQUEUE_H) || defined(TRACE_HEADER_MULTI_READ)
6#define LTTNG_TRACE_WORKQUEUE_H
b87700e3 7
6ec43db8 8#include <probes/lttng-tracepoint-event.h>
b87700e3 9#include <linux/workqueue.h>
b87700e3 10
b87700e3
AG
11#ifndef _TRACE_WORKQUEUE_DEF_
12#define _TRACE_WORKQUEUE_DEF_
13
14struct worker;
15struct global_cwq;
16
b87700e3
AG
17#endif
18
3bc29f0a 19LTTNG_TRACEPOINT_EVENT_CLASS(workqueue_work,
b87700e3
AG
20
21 TP_PROTO(struct work_struct *work),
22
23 TP_ARGS(work),
24
f127e61e 25 TP_FIELDS(
fa91fcac 26 ctf_integer_hex(void *, work, work)
f127e61e 27 )
b87700e3
AG
28)
29
b87700e3
AG
30/**
31 * workqueue_queue_work - called when a work gets queued
32 * @req_cpu: the requested cpu
33 * @cwq: pointer to struct cpu_workqueue_struct
34 * @work: pointer to struct work_struct
35 *
36 * This event occurs when a work is queued immediately or once a
37 * delayed work is actually queued on a workqueue (ie: once the delay
38 * has been reached).
39 */
3bc29f0a 40LTTNG_TRACEPOINT_EVENT(workqueue_queue_work,
b87700e3 41
20008d8c
MD
42 TP_PROTO(unsigned int req_cpu, struct pool_workqueue *pwq,
43 struct work_struct *work),
44
45 TP_ARGS(req_cpu, pwq, work),
b87700e3 46
f127e61e 47 TP_FIELDS(
fa91fcac
MD
48 ctf_integer_hex(void *, work, work)
49 ctf_integer_hex(void *, function, work->func)
f127e61e
MD
50 ctf_integer(unsigned int, req_cpu, req_cpu)
51 )
b87700e3
AG
52)
53
54/**
55 * workqueue_activate_work - called when a work gets activated
56 * @work: pointer to struct work_struct
57 *
58 * This event occurs when a queued work is put on the active queue,
59 * which happens immediately after queueing unless @max_active limit
60 * is reached.
61 */
3bc29f0a 62LTTNG_TRACEPOINT_EVENT_INSTANCE(workqueue_work, workqueue_activate_work,
b87700e3
AG
63
64 TP_PROTO(struct work_struct *work),
65
66 TP_ARGS(work)
67)
b87700e3
AG
68
69/**
70 * workqueue_execute_start - called immediately before the workqueue callback
71 * @work: pointer to struct work_struct
72 *
73 * Allows to track workqueue execution.
74 */
3bc29f0a 75LTTNG_TRACEPOINT_EVENT(workqueue_execute_start,
b87700e3
AG
76
77 TP_PROTO(struct work_struct *work),
78
79 TP_ARGS(work),
80
f127e61e 81 TP_FIELDS(
fa91fcac
MD
82 ctf_integer_hex(void *, work, work)
83 ctf_integer_hex(void *, function, work->func)
f127e61e 84 )
b87700e3
AG
85)
86
5322beb1
MJ
87/**
88 * workqueue_execute_end - called immediately after the workqueue callback
89 * @work: pointer to struct work_struct
90 * @function: pointer to worker function
91 *
92 * Allows to track workqueue execution.
93 */
94LTTNG_TRACEPOINT_EVENT(workqueue_execute_end,
95
96 TP_PROTO(struct work_struct *work, work_func_t function),
97
98 TP_ARGS(work, function),
99
100 TP_FIELDS(
101 ctf_integer_hex(void *, work, work)
102 ctf_integer_hex(void *, function, function)
103 )
104)
b87700e3 105
3bc29f0a 106#endif /* LTTNG_TRACE_WORKQUEUE_H */
b87700e3
AG
107
108/* This part must be outside protection */
6ec43db8 109#include <probes/define_trace.h>
This page took 0.039306 seconds and 4 git commands to generate.