net: tracepoint napi:napi_poll add work and budget
Subsystems (3)
PATCH 1/1 net: tracepoint napi:napi_poll add work and budget
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.
---
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(-)
include/trace/events/napi.h +9 -4
@@ -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
net/core/dev.c +2 -2
@@ -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);
net/core/netpoll.c +1 -1
@@ -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); }
From: Jesper Dangaard Brouer <[email protected]>
Date: Tue, 05 Jul 2016 19:35:27 +0200
Quoted 1 line
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' failedscripts/Makefile.build:440: recipe for target 'drivers/net/ethernet/cisco' failed
make[4]: *** [drivers/net/ethernet/cavium/liquidio] Interruptscripts/Makefile.build:440: recipe for target 'drivers/net/fddi' failed
make[2]: *** [drivers/net/fddi] Interrupt
make[3]: *** [drivers/net/ethernet/cisco] Interruptscripts/Makefile.build:440: recipe for target 'drivers/net/ethernet/chelsio' failed
make[3]: *** [drivers/net/ethernet/chelsio] Interruptscripts/Makefile.build:440: recipe for target 'drivers/net/ethernet/cavium' failed
make[3]: *** [drivers/net/ethernet/cavium] Interruptscripts/Makefile.build:440: recipe for target 'net/wimax' failed
make[1]: *** [net/wimax] Interruptscripts/Makefile.build:440: recipe for target 'drivers/pci' failed
make[1]: *** [drivers/pci] Interruptscripts/Makefile.build:440: recipe for target 'drivers/net/ethernet' failed
make[2]: *** [drivers/net/ethernet] Interruptscripts/Makefile.build:440: recipe for target 'drivers/media/usb/tm6000' failed
make[3]: *** [drivers/media/usb/tm6000] Interruptscripts/Makefile.build:295: recipe for target 'net/netfilter/xt_dscp.o' failed
make[2]: *** [net/netfilter/xt_dscp.o] Interruptscripts/Makefile.build:440: recipe for target 'drivers/net' failed
make[1]: *** [drivers/net] Interruptscripts/Makefile.build:440: recipe for target 'drivers/media/usb' failed
make[2]: *** [drivers/media/usb] Interruptscripts/Makefile.build:440: recipe for target 'drivers/media' failed
make[1]: *** [drivers/media] Interrupt
Makefile:987: recipe for target 'drivers' failed
make: *** [drivers] Interruptscripts/Makefile.build:440: recipe for target 'net/netfilter' failed
make[1]: *** [net/netfilter] Interrupt
Makefile:987: recipe for target 'net' failed
make: *** [net] Interrupt
Quoted 9 lines · On Tue, 05 Jul 2016 11:55:44 -0700 (PDT) David Miller <[email protected]> wrote:
From: Jesper Dangaard Brouer <[email protected]>
Date: Tue, 05 Jul 2016 19:35:27 +0200Quoted 1 line
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.
Signature · 5 lines
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