History

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. Handle trace_napi_poll() param change in dropwatch/drop_monitor and in python perf script netdev-times.py in backward compat way, as python fortunately supports optional parameter handling.

Jesper Dangaard Brouer committed 10 years ago

Commit 1db19db1 parent 89141e15 files · +21 −12Browse files

Showing the changes to tools/perf/scripts/python (1 of 5 files). Show all

Unified · Split

tools/perf/scripts/python/netdev-times.py+7−4
@@ -252,9 +252,10 @@ def irq__irq_handler_exit(name, context, cpu, sec, nsec, pid, comm, callchain, i · 251 unmodified lines
252 event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm, irq, ret)252 event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm, irq, ret)
253 all_event_list.append(event_info)253 all_event_list.append(event_info)
254 254
255def napi__napi_poll(name, context, cpu, sec, nsec, pid, comm, callchain, napi, dev_name):255def napi__napi_poll(name, context, cpu, sec, nsec, pid, comm, callchain, napi,
256 dev_name, work=None, budget=None):
256 event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm,257 event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm,
257 napi, dev_name)258 napi, dev_name, work, budget)
258 all_event_list.append(event_info)259 all_event_list.append(event_info)
259 260
260def net__netif_receive_skb(name, context, cpu, sec, nsec, pid, comm, callchain, skbaddr,261def net__netif_receive_skb(name, context, cpu, sec, nsec, pid, comm, callchain, skbaddr,
@@ -354,11 +355,13 @@ def handle_irq_softirq_exit(event_info): · 93 unmodified lines
354 receive_hunk_list.append(rec_data)355 receive_hunk_list.append(rec_data)
355 356
356def handle_napi_poll(event_info):357def handle_napi_poll(event_info):
357 (name, context, cpu, time, pid, comm, napi, dev_name) = event_info358 (name, context, cpu, time, pid, comm, napi, dev_name,
359 work, budget) = event_info
358 if cpu in net_rx_dic.keys():360 if cpu in net_rx_dic.keys():
359 event_list = net_rx_dic[cpu]['event_list']361 event_list = net_rx_dic[cpu]['event_list']
360 rec_data = {'event_name':'napi_poll',362 rec_data = {'event_name':'napi_poll',
361 'dev':dev_name, 'event_t':time}363 'dev':dev_name, 'event_t':time,
364 'work':work, 'budget':budget}
362 event_list.append(rec_data)365 event_list.append(rec_data)
363 366
364def handle_netif_rx(event_info):367def handle_netif_rx(event_info):