Linux Audio

Check our new training course

Loading...
v3.1
  1#undef TRACE_SYSTEM
  2#define TRACE_SYSTEM irq
  3
  4#if !defined(_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ)
  5#define _TRACE_IRQ_H
  6
  7#include <linux/tracepoint.h>
  8
  9struct irqaction;
 10struct softirq_action;
 11
 12#define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 13#define show_softirq_name(val)				\
 14	__print_symbolic(val,				\
 15			 softirq_name(HI),		\
 16			 softirq_name(TIMER),		\
 17			 softirq_name(NET_TX),		\
 18			 softirq_name(NET_RX),		\
 19			 softirq_name(BLOCK),		\
 20			 softirq_name(BLOCK_IOPOLL),	\
 21			 softirq_name(TASKLET),		\
 22			 softirq_name(SCHED),		\
 23			 softirq_name(HRTIMER),		\
 24			 softirq_name(RCU))
 25
 26/**
 27 * irq_handler_entry - called immediately before the irq action handler
 28 * @irq: irq number
 29 * @action: pointer to struct irqaction
 30 *
 31 * The struct irqaction pointed to by @action contains various
 32 * information about the handler, including the device name,
 33 * @action->name, and the device id, @action->dev_id. When used in
 34 * conjunction with the irq_handler_exit tracepoint, we can figure
 35 * out irq handler latencies.
 36 */
 37TRACE_EVENT(irq_handler_entry,
 38
 39	TP_PROTO(int irq, struct irqaction *action),
 40
 41	TP_ARGS(irq, action),
 42
 43	TP_STRUCT__entry(
 44		__field(	int,	irq		)
 45		__string(	name,	action->name	)
 46	),
 47
 48	TP_fast_assign(
 49		__entry->irq = irq;
 50		__assign_str(name, action->name);
 51	),
 52
 53	TP_printk("irq=%d name=%s", __entry->irq, __get_str(name))
 54);
 55
 56/**
 57 * irq_handler_exit - called immediately after the irq action handler returns
 58 * @irq: irq number
 59 * @action: pointer to struct irqaction
 60 * @ret: return value
 61 *
 62 * If the @ret value is set to IRQ_HANDLED, then we know that the corresponding
 63 * @action->handler scuccessully handled this irq. Otherwise, the irq might be
 64 * a shared irq line, or the irq was not handled successfully. Can be used in
 65 * conjunction with the irq_handler_entry to understand irq handler latencies.
 66 */
 67TRACE_EVENT(irq_handler_exit,
 68
 69	TP_PROTO(int irq, struct irqaction *action, int ret),
 70
 71	TP_ARGS(irq, action, ret),
 72
 73	TP_STRUCT__entry(
 74		__field(	int,	irq	)
 75		__field(	int,	ret	)
 76	),
 77
 78	TP_fast_assign(
 79		__entry->irq	= irq;
 80		__entry->ret	= ret;
 81	),
 82
 83	TP_printk("irq=%d ret=%s",
 84		  __entry->irq, __entry->ret ? "handled" : "unhandled")
 85);
 86
 87DECLARE_EVENT_CLASS(softirq,
 88
 89	TP_PROTO(unsigned int vec_nr),
 90
 91	TP_ARGS(vec_nr),
 92
 93	TP_STRUCT__entry(
 94		__field(	unsigned int,	vec	)
 95	),
 96
 97	TP_fast_assign(
 98		__entry->vec = vec_nr;
 99	),
100
101	TP_printk("vec=%u [action=%s]", __entry->vec,
102		  show_softirq_name(__entry->vec))
103);
104
105/**
106 * softirq_entry - called immediately before the softirq handler
107 * @vec_nr:  softirq vector number
108 *
109 * When used in combination with the softirq_exit tracepoint
110 * we can determine the softirq handler runtine.
111 */
112DEFINE_EVENT(softirq, softirq_entry,
113
114	TP_PROTO(unsigned int vec_nr),
115
116	TP_ARGS(vec_nr)
117);
118
119/**
120 * softirq_exit - called immediately after the softirq handler returns
121 * @vec_nr:  softirq vector number
122 *
123 * When used in combination with the softirq_entry tracepoint
124 * we can determine the softirq handler runtine.
125 */
126DEFINE_EVENT(softirq, softirq_exit,
127
128	TP_PROTO(unsigned int vec_nr),
129
130	TP_ARGS(vec_nr)
131);
132
133/**
134 * softirq_raise - called immediately when a softirq is raised
135 * @vec_nr:  softirq vector number
136 *
137 * When used in combination with the softirq_entry tracepoint
138 * we can determine the softirq raise to run latency.
139 */
140DEFINE_EVENT(softirq, softirq_raise,
141
142	TP_PROTO(unsigned int vec_nr),
143
144	TP_ARGS(vec_nr)
145);
146
147#endif /*  _TRACE_IRQ_H */
148
149/* This part must be outside protection */
150#include <trace/define_trace.h>
v4.6
  1#undef TRACE_SYSTEM
  2#define TRACE_SYSTEM irq
  3
  4#if !defined(_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ)
  5#define _TRACE_IRQ_H
  6
  7#include <linux/tracepoint.h>
  8
  9struct irqaction;
 10struct softirq_action;
 11
 12#define SOFTIRQ_NAME_LIST				\
 13			 softirq_name(HI)		\
 14			 softirq_name(TIMER)		\
 15			 softirq_name(NET_TX)		\
 16			 softirq_name(NET_RX)		\
 17			 softirq_name(BLOCK)		\
 18			 softirq_name(IRQ_POLL)		\
 19			 softirq_name(TASKLET)		\
 20			 softirq_name(SCHED)		\
 21			 softirq_name(HRTIMER)		\
 22			 softirq_name_end(RCU)
 23
 24#undef softirq_name
 25#undef softirq_name_end
 26
 27#define softirq_name(sirq) TRACE_DEFINE_ENUM(sirq##_SOFTIRQ);
 28#define softirq_name_end(sirq)  TRACE_DEFINE_ENUM(sirq##_SOFTIRQ);
 29
 30SOFTIRQ_NAME_LIST
 31
 32#undef softirq_name
 33#undef softirq_name_end
 34
 35#define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq },
 36#define softirq_name_end(sirq) { sirq##_SOFTIRQ, #sirq }
 37
 38#define show_softirq_name(val)				\
 39	__print_symbolic(val, SOFTIRQ_NAME_LIST)
 
 
 
 
 
 
 
 
 
 
 40
 41/**
 42 * irq_handler_entry - called immediately before the irq action handler
 43 * @irq: irq number
 44 * @action: pointer to struct irqaction
 45 *
 46 * The struct irqaction pointed to by @action contains various
 47 * information about the handler, including the device name,
 48 * @action->name, and the device id, @action->dev_id. When used in
 49 * conjunction with the irq_handler_exit tracepoint, we can figure
 50 * out irq handler latencies.
 51 */
 52TRACE_EVENT(irq_handler_entry,
 53
 54	TP_PROTO(int irq, struct irqaction *action),
 55
 56	TP_ARGS(irq, action),
 57
 58	TP_STRUCT__entry(
 59		__field(	int,	irq		)
 60		__string(	name,	action->name	)
 61	),
 62
 63	TP_fast_assign(
 64		__entry->irq = irq;
 65		__assign_str(name, action->name);
 66	),
 67
 68	TP_printk("irq=%d name=%s", __entry->irq, __get_str(name))
 69);
 70
 71/**
 72 * irq_handler_exit - called immediately after the irq action handler returns
 73 * @irq: irq number
 74 * @action: pointer to struct irqaction
 75 * @ret: return value
 76 *
 77 * If the @ret value is set to IRQ_HANDLED, then we know that the corresponding
 78 * @action->handler scuccessully handled this irq. Otherwise, the irq might be
 79 * a shared irq line, or the irq was not handled successfully. Can be used in
 80 * conjunction with the irq_handler_entry to understand irq handler latencies.
 81 */
 82TRACE_EVENT(irq_handler_exit,
 83
 84	TP_PROTO(int irq, struct irqaction *action, int ret),
 85
 86	TP_ARGS(irq, action, ret),
 87
 88	TP_STRUCT__entry(
 89		__field(	int,	irq	)
 90		__field(	int,	ret	)
 91	),
 92
 93	TP_fast_assign(
 94		__entry->irq	= irq;
 95		__entry->ret	= ret;
 96	),
 97
 98	TP_printk("irq=%d ret=%s",
 99		  __entry->irq, __entry->ret ? "handled" : "unhandled")
100);
101
102DECLARE_EVENT_CLASS(softirq,
103
104	TP_PROTO(unsigned int vec_nr),
105
106	TP_ARGS(vec_nr),
107
108	TP_STRUCT__entry(
109		__field(	unsigned int,	vec	)
110	),
111
112	TP_fast_assign(
113		__entry->vec = vec_nr;
114	),
115
116	TP_printk("vec=%u [action=%s]", __entry->vec,
117		  show_softirq_name(__entry->vec))
118);
119
120/**
121 * softirq_entry - called immediately before the softirq handler
122 * @vec_nr:  softirq vector number
123 *
124 * When used in combination with the softirq_exit tracepoint
125 * we can determine the softirq handler routine.
126 */
127DEFINE_EVENT(softirq, softirq_entry,
128
129	TP_PROTO(unsigned int vec_nr),
130
131	TP_ARGS(vec_nr)
132);
133
134/**
135 * softirq_exit - called immediately after the softirq handler returns
136 * @vec_nr:  softirq vector number
137 *
138 * When used in combination with the softirq_entry tracepoint
139 * we can determine the softirq handler routine.
140 */
141DEFINE_EVENT(softirq, softirq_exit,
142
143	TP_PROTO(unsigned int vec_nr),
144
145	TP_ARGS(vec_nr)
146);
147
148/**
149 * softirq_raise - called immediately when a softirq is raised
150 * @vec_nr:  softirq vector number
151 *
152 * When used in combination with the softirq_entry tracepoint
153 * we can determine the softirq raise to run latency.
154 */
155DEFINE_EVENT(softirq, softirq_raise,
156
157	TP_PROTO(unsigned int vec_nr),
158
159	TP_ARGS(vec_nr)
160);
161
162#endif /*  _TRACE_IRQ_H */
163
164/* This part must be outside protection */
165#include <trace/define_trace.h>