Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux...
[deliverable/linux.git] / include / trace / events / irq.h
CommitLineData
d0b6e04a
LZ
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM irq
3
ea20d929 4#if !defined(_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ)
af39241b
JB
5#define _TRACE_IRQ_H
6
af39241b 7#include <linux/tracepoint.h>
ea20d929
SR
8#include <linux/interrupt.h>
9
1d080d6c 10#define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq }
5dd4de58
LZ
11#define show_softirq_name(val) \
12 __print_symbolic(val, \
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(BLOCK_IOPOLL), \
19 softirq_name(TASKLET), \
20 softirq_name(SCHED), \
21 softirq_name(HRTIMER), \
1d080d6c 22 softirq_name(RCU))
c2adae09 23
9ee1983c
JB
24/**
25 * irq_handler_entry - called immediately before the irq action handler
26 * @irq: irq number
27 * @action: pointer to struct irqaction
28 *
29 * The struct irqaction pointed to by @action contains various
30 * information about the handler, including the device name,
31 * @action->name, and the device id, @action->dev_id. When used in
32 * conjunction with the irq_handler_exit tracepoint, we can figure
33 * out irq handler latencies.
ea20d929 34 */
160031b5
SR
35TRACE_EVENT(irq_handler_entry,
36
ea20d929 37 TP_PROTO(int irq, struct irqaction *action),
160031b5 38
ea20d929 39 TP_ARGS(irq, action),
160031b5
SR
40
41 TP_STRUCT__entry(
42 __field( int, irq )
43 __string( name, action->name )
44 ),
45
46 TP_fast_assign(
47 __entry->irq = irq;
48 __assign_str(name, action->name);
49 ),
50
51 TP_printk("irq=%d handler=%s", __entry->irq, __get_str(name))
52);
ea20d929 53
9ee1983c
JB
54/**
55 * irq_handler_exit - called immediately after the irq action handler returns
56 * @irq: irq number
57 * @action: pointer to struct irqaction
58 * @ret: return value
59 *
60 * If the @ret value is set to IRQ_HANDLED, then we know that the corresponding
61 * @action->handler scuccessully handled this irq. Otherwise, the irq might be
62 * a shared irq line, or the irq was not handled successfully. Can be used in
63 * conjunction with the irq_handler_entry to understand irq handler latencies.
ea20d929
SR
64 */
65TRACE_EVENT(irq_handler_exit,
66
67 TP_PROTO(int irq, struct irqaction *action, int ret),
68
69 TP_ARGS(irq, action, ret),
70
71 TP_STRUCT__entry(
72 __field( int, irq )
73 __field( int, ret )
74 ),
75
76 TP_fast_assign(
77 __entry->irq = irq;
78 __entry->ret = ret;
79 ),
80
81 TP_printk("irq=%d return=%s",
82 __entry->irq, __entry->ret ? "handled" : "unhandled")
83);
84
9ee1983c
JB
85/**
86 * softirq_entry - called immediately before the softirq handler
87 * @h: pointer to struct softirq_action
88 * @vec: pointer to first struct softirq_action in softirq_vec array
89 *
90 * The @h parameter, contains a pointer to the struct softirq_action
91 * which has a pointer to the action handler that is called. By subtracting
92 * the @vec pointer from the @h pointer, we can determine the softirq
93 * number. Also, when used in combination with the softirq_exit tracepoint
94 * we can determine the softirq latency.
95 */
160031b5
SR
96TRACE_EVENT(softirq_entry,
97
ea20d929 98 TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
160031b5 99
ea20d929 100 TP_ARGS(h, vec),
af39241b 101
160031b5
SR
102 TP_STRUCT__entry(
103 __field( int, vec )
160031b5
SR
104 ),
105
106 TP_fast_assign(
107 __entry->vec = (int)(h - vec);
160031b5
SR
108 ),
109
c2adae09
SR
110 TP_printk("softirq=%d action=%s", __entry->vec,
111 show_softirq_name(__entry->vec))
160031b5
SR
112);
113
9ee1983c
JB
114/**
115 * softirq_exit - called immediately after the softirq handler returns
116 * @h: pointer to struct softirq_action
117 * @vec: pointer to first struct softirq_action in softirq_vec array
118 *
119 * The @h parameter contains a pointer to the struct softirq_action
120 * that has handled the softirq. By subtracting the @vec pointer from
121 * the @h pointer, we can determine the softirq number. Also, when used in
122 * combination with the softirq_entry tracepoint we can determine the softirq
123 * latency.
124 */
160031b5
SR
125TRACE_EVENT(softirq_exit,
126
ea20d929 127 TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
160031b5 128
ea20d929 129 TP_ARGS(h, vec),
160031b5
SR
130
131 TP_STRUCT__entry(
132 __field( int, vec )
160031b5
SR
133 ),
134
135 TP_fast_assign(
136 __entry->vec = (int)(h - vec);
160031b5
SR
137 ),
138
c2adae09
SR
139 TP_printk("softirq=%d action=%s", __entry->vec,
140 show_softirq_name(__entry->vec))
160031b5 141);
af39241b 142
a8d154b0
SR
143#endif /* _TRACE_IRQ_H */
144
145/* This part must be outside protection */
146#include <trace/define_trace.h>
This page took 0.054297 seconds and 5 git commands to generate.