| 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #undef TRACE_SYSTEM |
| 3 | #define TRACE_SYSTEM napi |
| 4 | |
| 5 | #if !defined(LTTNG_TRACE_NAPI_H) || defined(TRACE_HEADER_MULTI_READ) |
| 6 | #define LTTNG_TRACE_NAPI_H |
| 7 | |
| 8 | #include <probes/lttng-tracepoint-event.h> |
| 9 | #include <linux/netdevice.h> |
| 10 | #include <linux/ftrace.h> |
| 11 | |
| 12 | #define NO_DEV "(no_device)" |
| 13 | |
| 14 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) |
| 15 | |
| 16 | LTTNG_TRACEPOINT_EVENT(napi_poll, |
| 17 | |
| 18 | TP_PROTO(struct napi_struct *napi, int work, int budget), |
| 19 | |
| 20 | TP_ARGS(napi, work, budget), |
| 21 | |
| 22 | TP_FIELDS( |
| 23 | ctf_integer_hex(struct napi_struct *, napi, napi) |
| 24 | ctf_string(dev_name, napi->dev ? napi->dev->name : NO_DEV) |
| 25 | ctf_integer(int, work, work) |
| 26 | ctf_integer(int, budget, budget) |
| 27 | ) |
| 28 | ) |
| 29 | |
| 30 | #else |
| 31 | |
| 32 | LTTNG_TRACEPOINT_EVENT(napi_poll, |
| 33 | |
| 34 | TP_PROTO(struct napi_struct *napi), |
| 35 | |
| 36 | TP_ARGS(napi), |
| 37 | |
| 38 | TP_FIELDS( |
| 39 | ctf_integer_hex(struct napi_struct *, napi, napi) |
| 40 | ctf_string(dev_name, napi->dev ? napi->dev->name : NO_DEV) |
| 41 | ) |
| 42 | ) |
| 43 | |
| 44 | #endif |
| 45 | |
| 46 | #undef NO_DEV |
| 47 | |
| 48 | #endif /* LTTNG_TRACE_NAPI_H */ |
| 49 | |
| 50 | /* This part must be outside protection */ |
| 51 | #include <probes/define_trace.h> |