blob: 0b9e5136a2a3a074dac3fa66bbc4ce4f07304eaf [file] [log] [blame]
Steven Rostedt2e26ca72010-05-05 10:52:31 -04001#undef TRACE_SYSTEM
2#define TRACE_SYSTEM napi
3
4#if !defined(_TRACE_NAPI_H) || defined(TRACE_HEADER_MULTI_READ)
Neil Horman4ea7e382009-05-21 07:36:08 +00005#define _TRACE_NAPI_H_
6
7#include <linux/netdevice.h>
8#include <linux/tracepoint.h>
Neil Horman3e4b10d2010-08-23 18:43:51 +09009#include <linux/ftrace.h>
Neil Horman4ea7e382009-05-21 07:36:08 +000010
Neil Horman3e4b10d2010-08-23 18:43:51 +090011#define NO_DEV "(no_device)"
12
13TRACE_EVENT(napi_poll,
14
Jesper Dangaard Brouer1db19db2016-07-07 18:01:32 +020015 TP_PROTO(struct napi_struct *napi, int work, int budget),
Neil Horman3e4b10d2010-08-23 18:43:51 +090016
Jesper Dangaard Brouer1db19db2016-07-07 18:01:32 +020017 TP_ARGS(napi, work, budget),
Neil Horman3e4b10d2010-08-23 18:43:51 +090018
19 TP_STRUCT__entry(
20 __field( struct napi_struct *, napi)
Jesper Dangaard Brouer02a19872016-07-15 23:55:20 +020021 __string( dev_name, napi->dev ? napi->dev->name : NO_DEV)
Jesper Dangaard Brouer1db19db2016-07-07 18:01:32 +020022 __field( int, work)
23 __field( int, budget)
Neil Horman3e4b10d2010-08-23 18:43:51 +090024 ),
25
26 TP_fast_assign(
27 __entry->napi = napi;
Jesper Dangaard Brouer02a19872016-07-15 23:55:20 +020028 __assign_str(dev_name, napi->dev ? napi->dev->name : NO_DEV);
Jesper Dangaard Brouer1db19db2016-07-07 18:01:32 +020029 __entry->work = work;
30 __entry->budget = budget;
Neil Horman3e4b10d2010-08-23 18:43:51 +090031 ),
32
Jesper Dangaard Brouer1db19db2016-07-07 18:01:32 +020033 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)
Neil Horman3e4b10d2010-08-23 18:43:51 +090036);
37
38#undef NO_DEV
Neil Horman4ea7e382009-05-21 07:36:08 +000039
Steven Rostedt2e26ca72010-05-05 10:52:31 -040040#endif /* _TRACE_NAPI_H_ */
41
42/* This part must be outside protection */
43#include <trace/define_trace.h>