[PATCH 1/2] trace_events: fix napi's tracepoint

Subsystems: networking [general], the rest, tracing

STALE6192d

7 messages, 4 authors, 2009-08-26 · open the first message on its own page

[PATCH 1/2] trace_events: fix napi's tracepoint

From: Xiao Guangrong <hidden>
Date: 2009-08-25 06:49:35

Currently, the napi's tracepoint works will is depend on
"DECLARE_TRACE" definiens in include/trace/define_trace.h,
like below:

#include <trace/events/skb.h>    // include define_trace.h
#include <trace/events/napi.h>

there have error, if we remove "#include <trace/events/skb.h>"
or include napi.h in the front of include skb.h, It should
depend on the definiens in include/linux/tracepoint.h and we
can remove the "DECLARE_TRACE" definiens in
include/trace/define_trace.h, because "TRACE_EVENT" not use it

Signed-off-by: Xiao Guangrong <redacted>
---
 include/trace/define_trace.h |    4 ----
 net/core/net-traces.c        |    4 +++-
 2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h
index f7a7ae1..76e93bf 100644
--- a/include/trace/define_trace.h
+++ b/include/trace/define_trace.h
@@ -26,10 +26,6 @@
 #define TRACE_EVENT(name, proto, args, tstruct, assign, print)	\
 	DEFINE_TRACE(name)
 
-#undef DECLARE_TRACE
-#define DECLARE_TRACE(name, proto, args)	\
-	DEFINE_TRACE(name)
-
 #undef TRACE_INCLUDE
 #undef __TRACE_INCLUDE
 
diff --git a/net/core/net-traces.c b/net/core/net-traces.c
index f1e982c..42bda72 100644
--- a/net/core/net-traces.c
+++ b/net/core/net-traces.c
@@ -19,13 +19,15 @@
 #include <linux/workqueue.h>
 #include <linux/netlink.h>
 #include <linux/net_dropmon.h>
+#include <linux/tracepoint.h>
 
 #include <asm/unaligned.h>
 #include <asm/bitops.h>
 
 #define CREATE_TRACE_POINTS
 #include <trace/events/skb.h>
-#include <trace/events/napi.h>
+
+DEFINE_TRACE(napi_poll);
 
 EXPORT_TRACEPOINT_SYMBOL_GPL(kfree_skb);
 
-- 
1.6.1.2

Re: [PATCH 1/2] trace_events: fix napi's tracepoint

From: Ingo Molnar <hidden>
Date: 2009-08-25 07:58:27

* Xiao Guangrong [off-list ref] wrote:
Currently, the napi's tracepoint works will is depend on
"DECLARE_TRACE" definiens in include/trace/define_trace.h,
like below:

#include <trace/events/skb.h>    // include define_trace.h
#include <trace/events/napi.h>

there have error, if we remove "#include <trace/events/skb.h>"
or include napi.h in the front of include skb.h, It should
depend on the definiens in include/linux/tracepoint.h and we
can remove the "DECLARE_TRACE" definiens in
include/trace/define_trace.h, because "TRACE_EVENT" not use it

Signed-off-by: Xiao Guangrong <redacted>
---
 include/trace/define_trace.h |    4 ----
 net/core/net-traces.c        |    4 +++-
 2 files changed, 3 insertions(+), 5 deletions(-)
This will collide with tracing bits in the networking tree. The 
skb-tracing plugin there should be turned into proper TRACE_EVENT() 
tracepoints.

Neil was away for some time but i think soon we should see some 
movement here.

	Ingo

Re: [PATCH 1/2] trace_events: fix napi's tracepoint

From: Neil Horman <nhorman@tuxdriver.com>
Date: 2009-08-25 10:57:23

On Tue, Aug 25, 2009 at 09:58:16AM +0200, Ingo Molnar wrote:
* Xiao Guangrong [off-list ref] wrote:
quoted
Currently, the napi's tracepoint works will is depend on
"DECLARE_TRACE" definiens in include/trace/define_trace.h,
like below:

#include <trace/events/skb.h>    // include define_trace.h
#include <trace/events/napi.h>

there have error, if we remove "#include <trace/events/skb.h>"
or include napi.h in the front of include skb.h, It should
depend on the definiens in include/linux/tracepoint.h and we
can remove the "DECLARE_TRACE" definiens in
include/trace/define_trace.h, because "TRACE_EVENT" not use it

Signed-off-by: Xiao Guangrong <redacted>
---
 include/trace/define_trace.h |    4 ----
 net/core/net-traces.c        |    4 +++-
 2 files changed, 3 insertions(+), 5 deletions(-)
This will collide with tracing bits in the networking tree. The 
skb-tracing plugin there should be turned into proper TRACE_EVENT() 
tracepoints.

Neil was away for some time but i think soon we should see some 
movement here.

	Ingo
Thank you Ingo, yes, I'm back from the beach now and will look at this shortly.
I concur, we should just convert the napi_poll tracepoint to be defined via the
TRACE_EVENT macro, same as the kfree_skb tracepoint.  Xaio would you like to
take care of that, or shall I?

Best
Neil

Re: [PATCH 1/2] trace_events: fix napi's tracepoint

From: Xiao Guangrong <hidden>
Date: 2009-08-26 00:49:49


Neil Horman wrote:
On Tue, Aug 25, 2009 at 09:58:16AM +0200, Ingo Molnar wrote:
quoted
* Xiao Guangrong [off-list ref] wrote:

This will collide with tracing bits in the networking tree. The 
skb-tracing plugin there should be turned into proper TRACE_EVENT() 
tracepoints.

Neil was away for some time but i think soon we should see some 
movement here.

	Ingo
Thank you Ingo, yes, I'm back from the beach now and will look at this shortly.
I concur, we should just convert the napi_poll tracepoint to be defined via the
TRACE_EVENT macro, same as the kfree_skb tracepoint.  Xaio would you like to
take care of that, or shall I?
Hi Neil,

I'm glad to do it.

Actually, we should fix the include file dependencies first
(the second patch in this patchset), else we can't include two
TRACE_EVENT head files in net-traces.c

Steve will pull this patchset, so, I'll convert it after this
patchset merged.

Re: [PATCH 1/2] trace_events: fix napi's tracepoint

From: Xiao Guangrong <hidden>
Date: 2009-08-26 05:20:53


Xiao Guangrong wrote:
Currently, the napi's tracepoint works will is depend on
"DECLARE_TRACE" definiens in include/trace/define_trace.h,
like below:

#include <trace/events/skb.h>    // include define_trace.h
#include <trace/events/napi.h>

there have error, if we remove "#include <trace/events/skb.h>"
or include napi.h in the front of include skb.h, It should
depend on the definiens in include/linux/tracepoint.h and we
can remove the "DECLARE_TRACE" definiens in
include/trace/define_trace.h, because "TRACE_EVENT" not use it

Signed-off-by: Xiao Guangrong <redacted>
Hi Steven,

I'm sorry, please pull this patch too, because 
"[PATCH 7/8] tracing/events: fix the include file dependencies" 
is based on this patch, else will occur building error.

Thanks,
Xiao

Re: [PATCH 1/2] trace_events: fix napi's tracepoint

From: Xiao Guangrong <hidden>
Date: 2009-08-26 05:41:03


Xiao Guangrong wrote:
Xiao Guangrong wrote:
quoted
Currently, the napi's tracepoint works will is depend on
"DECLARE_TRACE" definiens in include/trace/define_trace.h,
like below:

#include <trace/events/skb.h>    // include define_trace.h
#include <trace/events/napi.h>

there have error, if we remove "#include <trace/events/skb.h>"
or include napi.h in the front of include skb.h, It should
depend on the definiens in include/linux/tracepoint.h and we
can remove the "DECLARE_TRACE" definiens in
include/trace/define_trace.h, because "TRACE_EVENT" not use it

Signed-off-by: Xiao Guangrong <redacted>
Hi Steven,

I'm sorry, please pull this patch too, because 
"[PATCH 7/8] tracing/events: fix the include file dependencies" 
is based on this patch, else will occur building error.
Sorry again, I say the wrong words, it not has building error, just
not complete fix the bug which I mention it in the changelog of
"[PATCH 7/8] tracing/events: fix the include file dependencies", that
is we can't include more TRACE_EVENT head file in .c file all the same,
like below:

Both define TRACE_EVENT in trace_a.h and trace_b.h, if we include
those in .c file, like this:

#define CREATE_TRACE_POINTS
include <trace/events/trace_a.h>  // re-define DECLARE_TRACE

include <trace/events/trace_b.h>  // use the DECLARE_TRACE definition
				  // that re-define by trace_a.h

Thanks,
Xiao

Re: [PATCH 1/2] trace_events: fix napi's tracepoint

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2009-08-26 14:01:25

On Wed, 26 Aug 2009, Xiao Guangrong wrote:

Xiao Guangrong wrote:
quoted
Xiao Guangrong wrote:
quoted
Currently, the napi's tracepoint works will is depend on
"DECLARE_TRACE" definiens in include/trace/define_trace.h,
like below:

#include <trace/events/skb.h>    // include define_trace.h
#include <trace/events/napi.h>

there have error, if we remove "#include <trace/events/skb.h>"
or include napi.h in the front of include skb.h, It should
depend on the definiens in include/linux/tracepoint.h and we
can remove the "DECLARE_TRACE" definiens in
include/trace/define_trace.h, because "TRACE_EVENT" not use it

Signed-off-by: Xiao Guangrong <redacted>
Hi Steven,

I'm sorry, please pull this patch too, because 
"[PATCH 7/8] tracing/events: fix the include file dependencies" 
is based on this patch, else will occur building error.
Sorry again, I say the wrong words, it not has building error, just
not complete fix the bug which I mention it in the changelog of
"[PATCH 7/8] tracing/events: fix the include file dependencies", that
is we can't include more TRACE_EVENT head file in .c file all the same,
like below:

Both define TRACE_EVENT in trace_a.h and trace_b.h, if we include
those in .c file, like this:

#define CREATE_TRACE_POINTS
include <trace/events/trace_a.h>  // re-define DECLARE_TRACE

include <trace/events/trace_b.h>  // use the DECLARE_TRACE definition
				  // that re-define by trace_a.h
Hi Xiao,

I pushed out the "fix the include file dependencies" patch since that was 
a bug fix in its own right. I held off the NAPI patch because it looked 
like it needed rework and only depended on the include dependencies fix. 

Could you update this code to do as Neil and Ingo has mentioned.

Thanks,

-- Steve
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help