History

perf script: Add new parameter in kfree_skb tracepoint to the python scripts using it

Include reason parameter that was added in commit c504e5c2f9648a1e ("net: skb: introduce kfree_skb_reason()")

Sriram Yagnaraman committed 3 years ago

Commit 69b0e111 parent 0e20f432 files · +5 −5Browse files

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

Unified · Split

2 files
  1. tools/perf/scripts/python/net_dropmonitor.py +2 −2
  2. tools/perf/scripts/python/netdev-times.py +3 −3
tools/perf/scripts/python/net_dropmonitor.py+2−2
@@ -68,9 +68,9 @@ def trace_end(): · 67 unmodified lines
68 get_kallsyms_table()68 get_kallsyms_table()
69 print_drop_table()69 print_drop_table()
70 70
71# called from perf, when it finds a correspoinding event71# called from perf, when it finds a corresponding event
72def skb__kfree_skb(name, context, cpu, sec, nsec, pid, comm, callchain,72def skb__kfree_skb(name, context, cpu, sec, nsec, pid, comm, callchain,
73 skbaddr, location, protocol):73 skbaddr, location, protocol, reason):
74 slocation = str(location)74 slocation = str(location)
75 try:75 try:
76 drop_log[slocation] = drop_log[slocation] + 176 drop_log[slocation] = drop_log[slocation] + 1
tools/perf/scripts/python/netdev-times.py+3−3
@@ -288,9 +288,9 @@ def net__net_dev_xmit(name, context, cpu, sec, nsec, pid, comm, callchain, · 287 unmodified lines
288 all_event_list.append(event_info)288 all_event_list.append(event_info)
289 289
290def skb__kfree_skb(name, context, cpu, sec, nsec, pid, comm, callchain,290def skb__kfree_skb(name, context, cpu, sec, nsec, pid, comm, callchain,
291 skbaddr, protocol, location):291 skbaddr, location, protocol, reason):
292 event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm,292 event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm,
293 skbaddr, protocol, location)293 skbaddr, location, protocol, reason)
294 all_event_list.append(event_info)294 all_event_list.append(event_info)
295 295
296def skb__consume_skb(name, context, cpu, sec, nsec, pid, comm, callchain, skbaddr):296def skb__consume_skb(name, context, cpu, sec, nsec, pid, comm, callchain, skbaddr):
@@ -430,7 +430,7 @@ def handle_net_dev_xmit(event_info): · 133 unmodified lines
430 430
431def handle_kfree_skb(event_info):431def handle_kfree_skb(event_info):
432 (name, context, cpu, time, pid, comm,432 (name, context, cpu, time, pid, comm,
433 skbaddr, protocol, location) = event_info433 skbaddr, location, protocol, reason) = event_info
434 for i in range(len(tx_queue_list)):434 for i in range(len(tx_queue_list)):
435 skb = tx_queue_list[i]435 skb = tx_queue_list[i]
436 if skb['skbaddr'] == skbaddr:436 if skb['skbaddr'] == skbaddr:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t