xref: /openbmc/linux/include/trace/events/napi.h (revision a36954f5)
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM napi
3 
4 #if !defined(_TRACE_NAPI_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_NAPI_H_
6 
7 #include <linux/netdevice.h>
8 #include <linux/tracepoint.h>
9 #include <linux/ftrace.h>
10 
11 #define NO_DEV "(no_device)"
12 
13 TRACE_EVENT(napi_poll,
14 
15 	TP_PROTO(struct napi_struct *napi, int work, int budget),
16 
17 	TP_ARGS(napi, work, budget),
18 
19 	TP_STRUCT__entry(
20 		__field(	struct napi_struct *,	napi)
21 		__string(	dev_name, napi->dev ? napi->dev->name : NO_DEV)
22 		__field(	int,			work)
23 		__field(	int,			budget)
24 	),
25 
26 	TP_fast_assign(
27 		__entry->napi = napi;
28 		__assign_str(dev_name, napi->dev ? napi->dev->name : NO_DEV);
29 		__entry->work = work;
30 		__entry->budget = budget;
31 	),
32 
33 	TP_printk("napi poll on napi struct %p for device %s work %d budget %d",
34 		  __entry->napi, __get_str(dev_name),
35 		  __entry->work, __entry->budget)
36 );
37 
38 #undef NO_DEV
39 
40 #endif /* _TRACE_NAPI_H_ */
41 
42 /* This part must be outside protection */
43 #include <trace/define_trace.h>
44