Li Zefan | d0b6e04 | 2009-07-13 10:33:21 +0800 | [diff] [blame] | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM irq |
| 3 | |
Steven Rostedt | ea20d92 | 2009-04-10 08:54:16 -0400 | [diff] [blame] | 4 | #if !defined(_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ) |
Jason Baron | af39241 | 2009-02-26 10:11:05 -0500 | [diff] [blame] | 5 | #define _TRACE_IRQ_H |
| 6 | |
Jason Baron | af39241 | 2009-02-26 10:11:05 -0500 | [diff] [blame] | 7 | #include <linux/tracepoint.h> |
Lai Jiangshan | 2bf2160 | 2010-08-23 18:42:48 +0900 | [diff] [blame] | 8 | |
| 9 | struct irqaction; |
| 10 | struct softirq_action; |
Jason Baron | af39241 | 2009-02-26 10:11:05 -0500 | [diff] [blame] | 11 | |
Steven Rostedt | 1d080d6 | 2009-06-01 12:20:40 -0400 | [diff] [blame] | 12 | #define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq } |
Li Zefan | 5dd4de5 | 2009-09-17 17:38:32 +0800 | [diff] [blame] | 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), \ |
Paul E. McKenney | a26ac24 | 2011-01-12 14:10:23 -0800 | [diff] [blame] | 23 | softirq_name(HRTIMER)) |
Steven Rostedt | c2adae0 | 2009-05-20 19:56:19 -0400 | [diff] [blame] | 24 | |
Jason Baron | 9ee1983 | 2009-04-30 13:29:47 -0400 | [diff] [blame] | 25 | /** |
| 26 | * irq_handler_entry - called immediately before the irq action handler |
| 27 | * @irq: irq number |
| 28 | * @action: pointer to struct irqaction |
| 29 | * |
| 30 | * The struct irqaction pointed to by @action contains various |
| 31 | * information about the handler, including the device name, |
| 32 | * @action->name, and the device id, @action->dev_id. When used in |
| 33 | * conjunction with the irq_handler_exit tracepoint, we can figure |
| 34 | * out irq handler latencies. |
Steven Rostedt | ea20d92 | 2009-04-10 08:54:16 -0400 | [diff] [blame] | 35 | */ |
Steven Rostedt | 160031b | 2009-04-24 11:26:55 -0400 | [diff] [blame] | 36 | TRACE_EVENT(irq_handler_entry, |
| 37 | |
Steven Rostedt | ea20d92 | 2009-04-10 08:54:16 -0400 | [diff] [blame] | 38 | TP_PROTO(int irq, struct irqaction *action), |
Steven Rostedt | 160031b | 2009-04-24 11:26:55 -0400 | [diff] [blame] | 39 | |
Steven Rostedt | ea20d92 | 2009-04-10 08:54:16 -0400 | [diff] [blame] | 40 | TP_ARGS(irq, action), |
Steven Rostedt | 160031b | 2009-04-24 11:26:55 -0400 | [diff] [blame] | 41 | |
| 42 | TP_STRUCT__entry( |
| 43 | __field( int, irq ) |
| 44 | __string( name, action->name ) |
| 45 | ), |
| 46 | |
| 47 | TP_fast_assign( |
| 48 | __entry->irq = irq; |
| 49 | __assign_str(name, action->name); |
| 50 | ), |
| 51 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 52 | TP_printk("irq=%d name=%s", __entry->irq, __get_str(name)) |
Steven Rostedt | 160031b | 2009-04-24 11:26:55 -0400 | [diff] [blame] | 53 | ); |
Steven Rostedt | ea20d92 | 2009-04-10 08:54:16 -0400 | [diff] [blame] | 54 | |
Jason Baron | 9ee1983 | 2009-04-30 13:29:47 -0400 | [diff] [blame] | 55 | /** |
| 56 | * irq_handler_exit - called immediately after the irq action handler returns |
| 57 | * @irq: irq number |
| 58 | * @action: pointer to struct irqaction |
| 59 | * @ret: return value |
| 60 | * |
| 61 | * If the @ret value is set to IRQ_HANDLED, then we know that the corresponding |
| 62 | * @action->handler scuccessully handled this irq. Otherwise, the irq might be |
| 63 | * a shared irq line, or the irq was not handled successfully. Can be used in |
| 64 | * conjunction with the irq_handler_entry to understand irq handler latencies. |
Steven Rostedt | ea20d92 | 2009-04-10 08:54:16 -0400 | [diff] [blame] | 65 | */ |
| 66 | TRACE_EVENT(irq_handler_exit, |
| 67 | |
| 68 | TP_PROTO(int irq, struct irqaction *action, int ret), |
| 69 | |
| 70 | TP_ARGS(irq, action, ret), |
| 71 | |
| 72 | TP_STRUCT__entry( |
| 73 | __field( int, irq ) |
| 74 | __field( int, ret ) |
| 75 | ), |
| 76 | |
| 77 | TP_fast_assign( |
| 78 | __entry->irq = irq; |
| 79 | __entry->ret = ret; |
| 80 | ), |
| 81 | |
Ingo Molnar | 434a83c | 2009-10-15 11:50:39 +0200 | [diff] [blame] | 82 | TP_printk("irq=%d ret=%s", |
Steven Rostedt | ea20d92 | 2009-04-10 08:54:16 -0400 | [diff] [blame] | 83 | __entry->irq, __entry->ret ? "handled" : "unhandled") |
| 84 | ); |
| 85 | |
Li Zefan | c467307 | 2009-11-26 15:04:31 +0800 | [diff] [blame] | 86 | DECLARE_EVENT_CLASS(softirq, |
Steven Rostedt | ea20d92 | 2009-04-10 08:54:16 -0400 | [diff] [blame] | 87 | |
Thomas Gleixner | f4bc6bb | 2010-10-19 15:00:13 +0200 | [diff] [blame] | 88 | TP_PROTO(unsigned int vec_nr), |
Steven Rostedt | 160031b | 2009-04-24 11:26:55 -0400 | [diff] [blame] | 89 | |
Thomas Gleixner | f4bc6bb | 2010-10-19 15:00:13 +0200 | [diff] [blame] | 90 | TP_ARGS(vec_nr), |
Steven Rostedt | 160031b | 2009-04-24 11:26:55 -0400 | [diff] [blame] | 91 | |
| 92 | TP_STRUCT__entry( |
Thomas Gleixner | f4bc6bb | 2010-10-19 15:00:13 +0200 | [diff] [blame] | 93 | __field( unsigned int, vec ) |
Steven Rostedt | 160031b | 2009-04-24 11:26:55 -0400 | [diff] [blame] | 94 | ), |
| 95 | |
| 96 | TP_fast_assign( |
Thomas Gleixner | f4bc6bb | 2010-10-19 15:00:13 +0200 | [diff] [blame] | 97 | __entry->vec = vec_nr; |
Steven Rostedt | 160031b | 2009-04-24 11:26:55 -0400 | [diff] [blame] | 98 | ), |
| 99 | |
Thomas Gleixner | f4bc6bb | 2010-10-19 15:00:13 +0200 | [diff] [blame] | 100 | TP_printk("vec=%u [action=%s]", __entry->vec, |
Steven Rostedt | c2adae0 | 2009-05-20 19:56:19 -0400 | [diff] [blame] | 101 | show_softirq_name(__entry->vec)) |
Steven Rostedt | 160031b | 2009-04-24 11:26:55 -0400 | [diff] [blame] | 102 | ); |
| 103 | |
Jason Baron | 9ee1983 | 2009-04-30 13:29:47 -0400 | [diff] [blame] | 104 | /** |
Li Zefan | c467307 | 2009-11-26 15:04:31 +0800 | [diff] [blame] | 105 | * softirq_entry - called immediately before the softirq handler |
Thomas Gleixner | f4bc6bb | 2010-10-19 15:00:13 +0200 | [diff] [blame] | 106 | * @vec_nr: softirq vector number |
Li Zefan | c467307 | 2009-11-26 15:04:31 +0800 | [diff] [blame] | 107 | * |
Thomas Gleixner | f4bc6bb | 2010-10-19 15:00:13 +0200 | [diff] [blame] | 108 | * When used in combination with the softirq_exit tracepoint |
| 109 | * we can determine the softirq handler runtine. |
Li Zefan | c467307 | 2009-11-26 15:04:31 +0800 | [diff] [blame] | 110 | */ |
| 111 | DEFINE_EVENT(softirq, softirq_entry, |
| 112 | |
Thomas Gleixner | f4bc6bb | 2010-10-19 15:00:13 +0200 | [diff] [blame] | 113 | TP_PROTO(unsigned int vec_nr), |
Li Zefan | c467307 | 2009-11-26 15:04:31 +0800 | [diff] [blame] | 114 | |
Thomas Gleixner | f4bc6bb | 2010-10-19 15:00:13 +0200 | [diff] [blame] | 115 | TP_ARGS(vec_nr) |
Li Zefan | c467307 | 2009-11-26 15:04:31 +0800 | [diff] [blame] | 116 | ); |
| 117 | |
| 118 | /** |
Jason Baron | 9ee1983 | 2009-04-30 13:29:47 -0400 | [diff] [blame] | 119 | * softirq_exit - called immediately after the softirq handler returns |
Thomas Gleixner | f4bc6bb | 2010-10-19 15:00:13 +0200 | [diff] [blame] | 120 | * @vec_nr: softirq vector number |
Jason Baron | 9ee1983 | 2009-04-30 13:29:47 -0400 | [diff] [blame] | 121 | * |
Thomas Gleixner | f4bc6bb | 2010-10-19 15:00:13 +0200 | [diff] [blame] | 122 | * When used in combination with the softirq_entry tracepoint |
| 123 | * we can determine the softirq handler runtine. |
Jason Baron | 9ee1983 | 2009-04-30 13:29:47 -0400 | [diff] [blame] | 124 | */ |
Li Zefan | c467307 | 2009-11-26 15:04:31 +0800 | [diff] [blame] | 125 | DEFINE_EVENT(softirq, softirq_exit, |
Steven Rostedt | 160031b | 2009-04-24 11:26:55 -0400 | [diff] [blame] | 126 | |
Thomas Gleixner | f4bc6bb | 2010-10-19 15:00:13 +0200 | [diff] [blame] | 127 | TP_PROTO(unsigned int vec_nr), |
Steven Rostedt | 160031b | 2009-04-24 11:26:55 -0400 | [diff] [blame] | 128 | |
Thomas Gleixner | f4bc6bb | 2010-10-19 15:00:13 +0200 | [diff] [blame] | 129 | TP_ARGS(vec_nr) |
Steven Rostedt | 160031b | 2009-04-24 11:26:55 -0400 | [diff] [blame] | 130 | ); |
Jason Baron | af39241 | 2009-02-26 10:11:05 -0500 | [diff] [blame] | 131 | |
Lai Jiangshan | 2bf2160 | 2010-08-23 18:42:48 +0900 | [diff] [blame] | 132 | /** |
| 133 | * softirq_raise - called immediately when a softirq is raised |
Thomas Gleixner | f4bc6bb | 2010-10-19 15:00:13 +0200 | [diff] [blame] | 134 | * @vec_nr: softirq vector number |
Lai Jiangshan | 2bf2160 | 2010-08-23 18:42:48 +0900 | [diff] [blame] | 135 | * |
Thomas Gleixner | f4bc6bb | 2010-10-19 15:00:13 +0200 | [diff] [blame] | 136 | * When used in combination with the softirq_entry tracepoint |
| 137 | * we can determine the softirq raise to run latency. |
Lai Jiangshan | 2bf2160 | 2010-08-23 18:42:48 +0900 | [diff] [blame] | 138 | */ |
| 139 | DEFINE_EVENT(softirq, softirq_raise, |
| 140 | |
Thomas Gleixner | f4bc6bb | 2010-10-19 15:00:13 +0200 | [diff] [blame] | 141 | TP_PROTO(unsigned int vec_nr), |
Lai Jiangshan | 2bf2160 | 2010-08-23 18:42:48 +0900 | [diff] [blame] | 142 | |
Thomas Gleixner | f4bc6bb | 2010-10-19 15:00:13 +0200 | [diff] [blame] | 143 | TP_ARGS(vec_nr) |
Lai Jiangshan | 2bf2160 | 2010-08-23 18:42:48 +0900 | [diff] [blame] | 144 | ); |
| 145 | |
Steven Rostedt | a8d154b | 2009-04-10 09:36:00 -0400 | [diff] [blame] | 146 | #endif /* _TRACE_IRQ_H */ |
| 147 | |
| 148 | /* This part must be outside protection */ |
| 149 | #include <trace/define_trace.h> |