aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2013-05-20 10:45:26 -0400
committerDavid S. Miller <davem@davemloft.net>2013-05-22 18:10:10 -0400
commit5a1e99dd2028e00998d42029be86835d8ef4a46e (patch)
tree8903e01fb89c6372af37ab4595d35b16b3e02848 /tools/perf/scripts
parent140c3c6a2bcd2c31e2f7f5a8d59689724776c8e5 (diff)
perf: net_dropmonitor: Fix symbol-relative addresses
The comparison between traced and symbol addresses is backwards: if the traced address doesn't exactly match a symbol (which we don't expect it to), we'll show the next symbol and the offset to it, whereas we should show the previous symbol and the offset from it. Cc: stable@vger.kernel.org Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/perf/scripts')
-rwxr-xr-xtools/perf/scripts/python/net_dropmonitor.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/scripts/python/net_dropmonitor.py b/tools/perf/scripts/python/net_dropmonitor.py
index adbfbf030576..4c1160560917 100755
--- a/tools/perf/scripts/python/net_dropmonitor.py
+++ b/tools/perf/scripts/python/net_dropmonitor.py
@@ -40,9 +40,9 @@ def get_kallsyms_table():
40 40
41def get_sym(sloc): 41def get_sym(sloc):
42 loc = int(sloc) 42 loc = int(sloc)
43 for i in kallsyms: 43 for i in kallsyms[::-1]:
44 if (i['loc'] >= loc): 44 if loc >= i['loc']:
45 return (i['name'], i['loc']-loc) 45 return (i['name'], loc - i['loc'])
46 return (None, 0) 46 return (None, 0)
47 47
48def print_drop_table(): 48def print_drop_table():