netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next PATCH] net: tracepoint napi:napi_poll add work and budget
@ 2016-07-05 17:35 Jesper Dangaard Brouer
  2016-07-05 18:55 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Jesper Dangaard Brouer @ 2016-07-05 17:35 UTC (permalink / raw)
  To: netdev, David S. Miller; +Cc: rostedt, Jesper Dangaard Brouer

An important information for the napi_poll tracepoint is knowing
the work done (packets processed) by the napi_poll() call. Add
both the work done and budget, as they are related.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
Can this patch go thought the net-next tree?

 include/trace/events/napi.h |   13 +++++++++----
 net/core/dev.c              |    4 ++--
 net/core/netpoll.c          |    2 +-
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/include/trace/events/napi.h b/include/trace/events/napi.h
index 8fe1e93f531d..118ed7767639 100644
--- a/include/trace/events/napi.h
+++ b/include/trace/events/napi.h
@@ -12,22 +12,27 @@
 
 TRACE_EVENT(napi_poll,
 
-	TP_PROTO(struct napi_struct *napi),
+	TP_PROTO(struct napi_struct *napi, int work, int budget),
 
-	TP_ARGS(napi),
+	TP_ARGS(napi, work, budget),
 
 	TP_STRUCT__entry(
 		__field(	struct napi_struct *,	napi)
+		__field(	int,			work)
+		__field(	int,			budget)
 		__string(	dev_name, napi->dev ? napi->dev->name : NO_DEV)
 	),
 
 	TP_fast_assign(
 		__entry->napi = napi;
+		__entry->work = work;
+		__entry->budget = budget;
 		__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))
+	TP_printk("napi poll on napi struct %p for device %s work %d budget %d",
+		  __entry->napi, __get_str(dev_name),
+		  __entry->work, __entry->budget)
 );
 
 #undef NO_DEV
diff --git a/net/core/dev.c b/net/core/dev.c
index b8cc5e979168..7a4e9a714fb3 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4973,7 +4973,7 @@ bool sk_busy_loop(struct sock *sk, int nonblock)
 
 			if (test_bit(NAPI_STATE_SCHED, &napi->state)) {
 				rc = napi->poll(napi, BUSY_POLL_BUDGET);
-				trace_napi_poll(napi);
+				trace_napi_poll(napi, rc, BUSY_POLL_BUDGET);
 				if (rc == BUSY_POLL_BUDGET) {
 					napi_complete_done(napi, rc);
 					napi_schedule(napi);
@@ -5129,7 +5129,7 @@ static int napi_poll(struct napi_struct *n, struct list_head *repoll)
 	work = 0;
 	if (test_bit(NAPI_STATE_SCHED, &n->state)) {
 		work = n->poll(n, weight);
-		trace_napi_poll(n);
+		trace_napi_poll(n, work, weight);
 	}
 
 	WARN_ON_ONCE(work > weight);
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 94acfc89ad97..53599bd0c82d 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -163,7 +163,7 @@ static void poll_one_napi(struct napi_struct *napi)
 	 */
 	work = napi->poll(napi, 0);
 	WARN_ONCE(work, "%pF exceeded budget in poll\n", napi->poll);
-	trace_napi_poll(napi);
+	trace_napi_poll(napi, work, 0);
 
 	clear_bit(NAPI_STATE_NPSVC, &napi->state);
 }

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [net-next PATCH] net: tracepoint napi:napi_poll add work and budget
  2016-07-05 17:35 [net-next PATCH] net: tracepoint napi:napi_poll add work and budget Jesper Dangaard Brouer
@ 2016-07-05 18:55 ` David Miller
  2016-07-06  7:19   ` Jesper Dangaard Brouer
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2016-07-05 18:55 UTC (permalink / raw)
  To: brouer; +Cc: netdev, rostedt

From: Jesper Dangaard Brouer <brouer@redhat.com>
Date: Tue, 05 Jul 2016 19:35:27 +0200

> Can this patch go thought the net-next tree?

Sure... when it actually compiles.

If you're changing a fundamental signature like this, it is in your
best interest to do an allmodconfig build... before I do.

net/core/drop_monitor.c: In function ‘set_all_monitor_traces’:
net/core/drop_monitor.c:241:34: warning: passing argument 1 of ‘register_trace_napi_poll’ from incompatible pointer type
   rc |= register_trace_napi_poll(trace_napi_poll_hit, NULL);
                                  ^
In file included from include/trace/events/skb.h:9:0,
                 from net/core/drop_monitor.c:31:
include/linux/tracepoint.h:199:2: note: expected ‘void (*)(void *, struct napi_struct *, int,  int)’ but argument is of type ‘void (*)(void *, struct napi_struct *)’
  register_trace_##name(void (*probe)(data_proto), void *data) \
  ^
include/linux/tracepoint.h:348:2: note: in expansion of macro ‘__DECLARE_TRACE’
  __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),  \
  ^
include/linux/tracepoint.h:484:2: note: in expansion of macro ‘DECLARE_TRACE’
  DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
  ^
include/trace/events/napi.h:13:1: note: in expansion of macro ‘TRACE_EVENT’
 TRACE_EVENT(napi_poll,
 ^
net/core/drop_monitor.c:246:36: warning: passing argument 1 of ‘unregister_trace_napi_poll’ from incompatible pointer type
   rc |= unregister_trace_napi_poll(trace_napi_poll_hit, NULL);
                                    ^
In file included from include/trace/events/skb.h:9:0,
                 from net/core/drop_monitor.c:31:
include/linux/tracepoint.h:212:2: note: expected ‘void (*)(void *, struct napi_struct *, int,  int)’ but argument is of type ‘void (*)(void *, struct napi_struct *)’
  unregister_trace_##name(void (*probe)(data_proto), void *data) \
  ^
include/linux/tracepoint.h:348:2: note: in expansion of macro ‘__DECLARE_TRACE’
  __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),  \
  ^
include/linux/tracepoint.h:484:2: note: in expansion of macro ‘DECLARE_TRACE’
  DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
  ^
include/trace/events/napi.h:13:1: note: in expansion of macro ‘TRACE_EVENT’
 TRACE_EVENT(napi_poll,
 ^
  C-c C-cscripts/Makefile.build:440: recipe for target 'drivers/net/ethernet/cavium/liquidio' failed
scripts/Makefile.build:440: recipe for target 'drivers/net/ethernet/cisco' failed
make[4]: *** [drivers/net/ethernet/cavium/liquidio] Interrupt
scripts/Makefile.build:440: recipe for target 'drivers/net/fddi' failed
make[2]: *** [drivers/net/fddi] Interrupt
make[3]: *** [drivers/net/ethernet/cisco] Interrupt
scripts/Makefile.build:440: recipe for target 'drivers/net/ethernet/chelsio' failed
make[3]: *** [drivers/net/ethernet/chelsio] Interrupt
scripts/Makefile.build:440: recipe for target 'drivers/net/ethernet/cavium' failed
make[3]: *** [drivers/net/ethernet/cavium] Interrupt
scripts/Makefile.build:440: recipe for target 'net/wimax' failed
make[1]: *** [net/wimax] Interrupt
scripts/Makefile.build:440: recipe for target 'drivers/pci' failed
make[1]: *** [drivers/pci] Interrupt
scripts/Makefile.build:440: recipe for target 'drivers/net/ethernet' failed
make[2]: *** [drivers/net/ethernet] Interrupt
scripts/Makefile.build:440: recipe for target 'drivers/media/usb/tm6000' failed
make[3]: *** [drivers/media/usb/tm6000] Interrupt
scripts/Makefile.build:295: recipe for target 'net/netfilter/xt_dscp.o' failed
make[2]: *** [net/netfilter/xt_dscp.o] Interrupt
scripts/Makefile.build:440: recipe for target 'drivers/net' failed
make[1]: *** [drivers/net] Interrupt
scripts/Makefile.build:440: recipe for target 'drivers/media/usb' failed
make[2]: *** [drivers/media/usb] Interrupt
scripts/Makefile.build:440: recipe for target 'drivers/media' failed
make[1]: *** [drivers/media] Interrupt
Makefile:987: recipe for target 'drivers' failed
make: *** [drivers] Interrupt
scripts/Makefile.build:440: recipe for target 'net/netfilter' failed
make[1]: *** [net/netfilter] Interrupt
Makefile:987: recipe for target 'net' failed
make: *** [net] Interrupt

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [net-next PATCH] net: tracepoint napi:napi_poll add work and budget
  2016-07-05 18:55 ` David Miller
@ 2016-07-06  7:19   ` Jesper Dangaard Brouer
  0 siblings, 0 replies; 3+ messages in thread
From: Jesper Dangaard Brouer @ 2016-07-06  7:19 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, rostedt, brouer

On Tue, 05 Jul 2016 11:55:44 -0700 (PDT)
David Miller <davem@redhat.com> wrote:

> From: Jesper Dangaard Brouer <brouer@redhat.com>
> Date: Tue, 05 Jul 2016 19:35:27 +0200
> 
> > Can this patch go thought the net-next tree?  
> 
> Sure... when it actually compiles.
>
> If you're changing a fundamental signature like this, it is in your
> best interest to do an allmodconfig build... before I do.

Ups! sorry about that! I'll fix it up and resubmit.

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  Author of http://www.iptv-analyzer.org
  LinkedIn: http://www.linkedin.com/in/brouer

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-06  7:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-05 17:35 [net-next PATCH] net: tracepoint napi:napi_poll add work and budget Jesper Dangaard Brouer
2016-07-05 18:55 ` David Miller
2016-07-06  7:19   ` Jesper Dangaard Brouer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).