summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2013-05-20 14:45:26 +0000
committerSteven Rostedt <rostedt@goodmis.org>2013-07-03 14:26:26 -0400
commit20cd9c6ec4fe20df54728496494af0baa79accf0 (patch)
treea9df0b87a1ea675f032df2f08dbd8587f35ccd3a /tools
parentdd773b3e6a09208e0dd53a07dc554ad9da0f5bd7 (diff)
downloadlinux-rt-20cd9c6ec4fe20df54728496494af0baa79accf0.tar.gz
perf: net_dropmonitor: Fix symbol-relative addresses
[ Upstream commit 5a1e99dd2028e00998d42029be86835d8ef4a46e ] 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> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools')
-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():
def get_sym(sloc):
loc = int(sloc)
- for i in kallsyms:
- if (i['loc'] >= loc):
- return (i['name'], i['loc']-loc)
+ for i in kallsyms[::-1]:
+ if loc >= i['loc']:
+ return (i['name'], loc - i['loc'])
return (None, 0)
def print_drop_table():