diff options
author | Neil Horman <[email protected]> | 2010-08-23 18:43:51 +0900 |
---|---|---|
committer | Frederic Weisbecker <[email protected]> | 2010-09-07 17:51:01 +0200 |
commit | 3e4b10d7a4d2a78af64f8096dc7cdb3bebd65adb (patch) | |
tree | c2976770262d832d2855d63cd7df05b31705e40c | |
parent | 2bf2160d8805de64308e2e7c3cd97813cb58ed2f (diff) |
napi: Convert trace_napi_poll to TRACE_EVENT
This patch converts trace_napi_poll from DECLARE_EVENT to TRACE_EVENT
to improve the usability of napi_poll tracepoint.
<idle>-0 [001] 241302.750777: napi_poll: napi poll on napi struct f6acc480 for device eth3
<idle>-0 [000] 241302.852389: napi_poll: napi poll on napi struct f5d0d70c for device eth1
The original patch is below:
http://marc.info/?l=linux-kernel&m=126021713809450&w=2
[ [email protected]: And add a fix by Steven Rostedt:
http://marc.info/?l=linux-kernel&m=126150506519173&w=2 ]
Signed-off-by: Neil Horman <[email protected]>
Acked-by: David S. Miller <[email protected]>
Acked-by: Neil Horman <[email protected]>
Cc: Mathieu Desnoyers <[email protected]>
Cc: Kaneshige Kenji <[email protected]>
Cc: Izumo Taku <[email protected]>
Cc: Kosaki Motohiro <[email protected]>
Cc: Lai Jiangshan <[email protected]>
Cc: Scott Mcmillan <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Eric Dumazet <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Koki Sanagi <[email protected]>
Signed-off-by: Frederic Weisbecker <[email protected]>
-rw-r--r-- | include/trace/events/napi.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/include/trace/events/napi.h b/include/trace/events/napi.h index 188deca2f3c7..8fe1e93f531d 100644 --- a/include/trace/events/napi.h +++ b/include/trace/events/napi.h @@ -6,10 +6,31 @@ #include <linux/netdevice.h> #include <linux/tracepoint.h> +#include <linux/ftrace.h> + +#define NO_DEV "(no_device)" + +TRACE_EVENT(napi_poll, -DECLARE_TRACE(napi_poll, TP_PROTO(struct napi_struct *napi), - TP_ARGS(napi)); + + TP_ARGS(napi), + + TP_STRUCT__entry( + __field( struct napi_struct *, napi) + __string( dev_name, napi->dev ? napi->dev->name : NO_DEV) + ), + + TP_fast_assign( + __entry->napi = napi; + __assign_str(dev_name, napi->dev ? napi->dev->name : NO_DEV); + ), + + TP_printk("napi poll on napi struct %p for device %s", + __entry->napi, __get_str(dev_name)) +); + +#undef NO_DEV #endif /* _TRACE_NAPI_H_ */ |