2010-06-25 00:58:15

by Sanagi, Koki

[permalink] [raw]
Subject: [RFC PATCH v2 2/5] napi: convert trace_napi_poll to TRACE_EVENT

This patch converts trace_napi_poll from DECLARE_EVENT to TRACE_EVENT.
This lets you know how long napi_poll takes.

<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
<idle>-0 [000] 241302.852389: napi_poll: napi poll on napi struct f5d0d20c for device eth1

This is a same patch Neil Horman submitted.
http://marc.info/?l=linux-kernel&m=125978157926853&w=2

Signed-off-by: Koki Sanagi <[email protected]>
---
include/trace/events/napi.h | 23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/include/trace/events/napi.h b/include/trace/events/napi.h
index 188deca..512a057 100644
--- a/include/trace/events/napi.h
+++ b/include/trace/events/napi.h
@@ -6,10 +6,29 @@

#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))
+);

#endif /* _TRACE_NAPI_H_ */


2010-06-25 01:11:22

by KOSAKI Motohiro

[permalink] [raw]
Subject: Re: [RFC PATCH v2 2/5] napi: convert trace_napi_poll to TRACE_EVENT

> This patch converts trace_napi_poll from DECLARE_EVENT to TRACE_EVENT.
> This lets you know how long napi_poll takes.
>
> <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
> <idle>-0 [000] 241302.852389: napi_poll: napi poll on napi struct f5d0d20c for device eth1
>
> This is a same patch Neil Horman submitted.
> http://marc.info/?l=linux-kernel&m=125978157926853&w=2

Ditto.
Please don't remove Neil's S-O-B.


2010-06-25 08:26:18

by Frederic Weisbecker

[permalink] [raw]
Subject: Re: [RFC PATCH v2 2/5] napi: convert trace_napi_poll to TRACE_EVENT

2010/6/25 Koki Sanagi <[email protected]>:
> This patch converts trace_napi_poll from DECLARE_EVENT to TRACE_EVENT.


>From DECLARE_TRACE to TRACE_EVENT.

Or more generally: this expands the napi polling tracepoint to a trace
event, to improve the
napi polling tracepoint usability.


> This lets you know how long napi_poll takes.
>
> ? ? ? ? ?<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
> ? ? ? ? ?<idle>-0 ? ? [000] 241302.852389: napi_poll: napi poll on napi struct f5d0d20c for device eth1
>
> This is a same patch Neil Horman submitted.
> http://marc.info/?l=linux-kernel&m=125978157926853&w=2

Hmm, nope, doesn't seem to be the same patch.