#undef TRACE_SYSTEM1#define TRACE_SYSTEM irq23#if !defined(_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ)4#define _TRACE_IRQ_H56#include <linux/tracepoint.h>78struct irqaction;9struct softirq_action;1011#define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq }12#define show_softirq_name(val) \13__print_symbolic(val, \14softirq_name(HI), \15softirq_name(TIMER), \16softirq_name(NET_TX), \17softirq_name(NET_RX), \18softirq_name(BLOCK), \19softirq_name(BLOCK_IOPOLL), \20softirq_name(TASKLET), \21softirq_name(SCHED), \22softirq_name(HRTIMER), \23softirq_name(RCU))2425/**26* irq_handler_entry - called immediately before the irq action handler27* @irq: irq number28* @action: pointer to struct irqaction29*30* The struct irqaction pointed to by @action contains various31* information about the handler, including the device name,32* @action->name, and the device id, @action->dev_id. When used in33* conjunction with the irq_handler_exit tracepoint, we can figure34* out irq handler latencies.35*/36TRACE_EVENT(irq_handler_entry,3738TP_PROTO(int irq, struct irqaction *action),3940TP_ARGS(irq, action),4142TP_STRUCT__entry(43__field( int, irq )44__string( name, action->name )45),4647TP_fast_assign(48__entry->irq = irq;49__assign_str(name, action->name);50),5152TP_printk("irq=%d name=%s", __entry->irq, __get_str(name))53);5455/**56* irq_handler_exit - called immediately after the irq action handler returns57* @irq: irq number58* @action: pointer to struct irqaction59* @ret: return value60*61* If the @ret value is set to IRQ_HANDLED, then we know that the corresponding62* @action->handler scuccessully handled this irq. Otherwise, the irq might be63* a shared irq line, or the irq was not handled successfully. Can be used in64* conjunction with the irq_handler_entry to understand irq handler latencies.65*/66TRACE_EVENT(irq_handler_exit,6768TP_PROTO(int irq, struct irqaction *action, int ret),6970TP_ARGS(irq, action, ret),7172TP_STRUCT__entry(73__field( int, irq )74__field( int, ret )75),7677TP_fast_assign(78__entry->irq = irq;79__entry->ret = ret;80),8182TP_printk("irq=%d ret=%s",83__entry->irq, __entry->ret ? "handled" : "unhandled")84);8586DECLARE_EVENT_CLASS(softirq,8788TP_PROTO(unsigned int vec_nr),8990TP_ARGS(vec_nr),9192TP_STRUCT__entry(93__field( unsigned int, vec )94),9596TP_fast_assign(97__entry->vec = vec_nr;98),99100TP_printk("vec=%u [action=%s]", __entry->vec,101show_softirq_name(__entry->vec))102);103104/**105* softirq_entry - called immediately before the softirq handler106* @vec_nr: softirq vector number107*108* When used in combination with the softirq_exit tracepoint109* we can determine the softirq handler runtine.110*/111DEFINE_EVENT(softirq, softirq_entry,112113TP_PROTO(unsigned int vec_nr),114115TP_ARGS(vec_nr)116);117118/**119* softirq_exit - called immediately after the softirq handler returns120* @vec_nr: softirq vector number121*122* When used in combination with the softirq_entry tracepoint123* we can determine the softirq handler runtine.124*/125DEFINE_EVENT(softirq, softirq_exit,126127TP_PROTO(unsigned int vec_nr),128129TP_ARGS(vec_nr)130);131132/**133* softirq_raise - called immediately when a softirq is raised134* @vec_nr: softirq vector number135*136* When used in combination with the softirq_entry tracepoint137* we can determine the softirq raise to run latency.138*/139DEFINE_EVENT(softirq, softirq_raise,140141TP_PROTO(unsigned int vec_nr),142143TP_ARGS(vec_nr)144);145146#endif /* _TRACE_IRQ_H */147148/* This part must be outside protection */149#include <trace/define_trace.h>150151152