| 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM irq |
| 3 | |
| 4 | #if !defined(LTTNG_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ) |
| 5 | #define LTTNG_TRACE_IRQ_H |
| 6 | |
| 7 | #include "../../../probes/lttng-tracepoint-event.h" |
| 8 | |
| 9 | #ifndef _TRACE_IRQ_DEF_ |
| 10 | #define _TRACE_IRQ_DEF_ |
| 11 | |
| 12 | struct irqaction; |
| 13 | struct softirq_action; |
| 14 | |
| 15 | #endif /* _TRACE_IRQ_DEF_ */ |
| 16 | |
| 17 | /** |
| 18 | * irq_handler_entry - called immediately before the irq action handler |
| 19 | * @irq: irq number |
| 20 | * @action: pointer to struct irqaction |
| 21 | * |
| 22 | * The struct irqaction pointed to by @action contains various |
| 23 | * information about the handler, including the device name, |
| 24 | * @action->name, and the device id, @action->dev_id. When used in |
| 25 | * conjunction with the irq_handler_exit tracepoint, we can figure |
| 26 | * out irq handler latencies. |
| 27 | */ |
| 28 | LTTNG_TRACEPOINT_EVENT(irq_handler_entry, |
| 29 | |
| 30 | TP_PROTO(int irq, struct irqaction *action), |
| 31 | |
| 32 | TP_ARGS(irq, action), |
| 33 | |
| 34 | TP_STRUCT__entry( |
| 35 | __field( int, irq ) |
| 36 | __string( name, action->name ) |
| 37 | ), |
| 38 | |
| 39 | TP_fast_assign( |
| 40 | tp_assign(irq, irq) |
| 41 | tp_strcpy(name, action->name) |
| 42 | ), |
| 43 | |
| 44 | TP_printk("irq=%d name=%s", __entry->irq, __get_str(name)) |
| 45 | ) |
| 46 | |
| 47 | /** |
| 48 | * irq_handler_exit - called immediately after the irq action handler returns |
| 49 | * @irq: irq number |
| 50 | * @action: pointer to struct irqaction |
| 51 | * @ret: return value |
| 52 | * |
| 53 | * If the @ret value is set to IRQ_HANDLED, then we know that the corresponding |
| 54 | * @action->handler scuccessully handled this irq. Otherwise, the irq might be |
| 55 | * a shared irq line, or the irq was not handled successfully. Can be used in |
| 56 | * conjunction with the irq_handler_entry to understand irq handler latencies. |
| 57 | */ |
| 58 | LTTNG_TRACEPOINT_EVENT(irq_handler_exit, |
| 59 | |
| 60 | TP_PROTO(int irq, struct irqaction *action, int ret), |
| 61 | |
| 62 | TP_ARGS(irq, action, ret), |
| 63 | |
| 64 | TP_STRUCT__entry( |
| 65 | __field( int, irq ) |
| 66 | __field( int, ret ) |
| 67 | ), |
| 68 | |
| 69 | TP_fast_assign( |
| 70 | tp_assign(irq, irq) |
| 71 | tp_assign(ret, ret) |
| 72 | ), |
| 73 | |
| 74 | TP_printk("irq=%d ret=%s", |
| 75 | __entry->irq, __entry->ret ? "handled" : "unhandled") |
| 76 | ) |
| 77 | |
| 78 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) |
| 79 | LTTNG_TRACEPOINT_EVENT_CLASS(softirq, |
| 80 | |
| 81 | TP_PROTO(unsigned int vec_nr), |
| 82 | |
| 83 | TP_ARGS(vec_nr), |
| 84 | |
| 85 | TP_STRUCT__entry( |
| 86 | __field( unsigned int, vec ) |
| 87 | ), |
| 88 | |
| 89 | TP_fast_assign( |
| 90 | tp_assign(vec, vec_nr) |
| 91 | ), |
| 92 | |
| 93 | TP_printk() |
| 94 | ) |
| 95 | |
| 96 | /** |
| 97 | * softirq_entry - called immediately before the softirq handler |
| 98 | * @vec_nr: softirq vector number |
| 99 | * |
| 100 | * When used in combination with the softirq_exit tracepoint |
| 101 | * we can determine the softirq handler runtine. |
| 102 | */ |
| 103 | LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_entry, |
| 104 | |
| 105 | TP_PROTO(unsigned int vec_nr), |
| 106 | |
| 107 | TP_ARGS(vec_nr) |
| 108 | ) |
| 109 | |
| 110 | /** |
| 111 | * softirq_exit - called immediately after the softirq handler returns |
| 112 | * @vec_nr: softirq vector number |
| 113 | * |
| 114 | * When used in combination with the softirq_entry tracepoint |
| 115 | * we can determine the softirq handler runtine. |
| 116 | */ |
| 117 | LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_exit, |
| 118 | |
| 119 | TP_PROTO(unsigned int vec_nr), |
| 120 | |
| 121 | TP_ARGS(vec_nr) |
| 122 | ) |
| 123 | |
| 124 | /** |
| 125 | * softirq_raise - called immediately when a softirq is raised |
| 126 | * @vec_nr: softirq vector number |
| 127 | * |
| 128 | * When used in combination with the softirq_entry tracepoint |
| 129 | * we can determine the softirq raise to run latency. |
| 130 | */ |
| 131 | LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_raise, |
| 132 | |
| 133 | TP_PROTO(unsigned int vec_nr), |
| 134 | |
| 135 | TP_ARGS(vec_nr) |
| 136 | ) |
| 137 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) */ |
| 138 | LTTNG_TRACEPOINT_EVENT_CLASS(softirq, |
| 139 | |
| 140 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), |
| 141 | |
| 142 | TP_ARGS(h, vec), |
| 143 | |
| 144 | TP_STRUCT__entry( |
| 145 | __field( unsigned int, vec ) |
| 146 | ), |
| 147 | |
| 148 | TP_fast_assign( |
| 149 | tp_assign(vec, (int)(h - vec)) |
| 150 | ), |
| 151 | |
| 152 | TP_printk() |
| 153 | ) |
| 154 | |
| 155 | /** |
| 156 | * softirq_entry - called immediately before the softirq handler |
| 157 | * @h: pointer to struct softirq_action |
| 158 | * @vec: pointer to first struct softirq_action in softirq_vec array |
| 159 | * |
| 160 | * When used in combination with the softirq_exit tracepoint |
| 161 | * we can determine the softirq handler runtine. |
| 162 | */ |
| 163 | LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_entry, |
| 164 | |
| 165 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), |
| 166 | |
| 167 | TP_ARGS(h, vec) |
| 168 | ) |
| 169 | |
| 170 | /** |
| 171 | * softirq_exit - called immediately after the softirq handler returns |
| 172 | * @h: pointer to struct softirq_action |
| 173 | * @vec: pointer to first struct softirq_action in softirq_vec array |
| 174 | * |
| 175 | * When used in combination with the softirq_entry tracepoint |
| 176 | * we can determine the softirq handler runtine. |
| 177 | */ |
| 178 | LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_exit, |
| 179 | |
| 180 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), |
| 181 | |
| 182 | TP_ARGS(h, vec) |
| 183 | ) |
| 184 | |
| 185 | /** |
| 186 | * softirq_raise - called immediately when a softirq is raised |
| 187 | * @h: pointer to struct softirq_action |
| 188 | * @vec: pointer to first struct softirq_action in softirq_vec array |
| 189 | * |
| 190 | * When used in combination with the softirq_entry tracepoint |
| 191 | * we can determine the softirq raise to run latency. |
| 192 | */ |
| 193 | LTTNG_TRACEPOINT_EVENT_INSTANCE(softirq, softirq_raise, |
| 194 | |
| 195 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), |
| 196 | |
| 197 | TP_ARGS(h, vec) |
| 198 | ) |
| 199 | #endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) */ |
| 200 | |
| 201 | #endif /* LTTNG_TRACE_IRQ_H */ |
| 202 | |
| 203 | /* This part must be outside protection */ |
| 204 | #include "../../../probes/define_trace.h" |