diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2013-05-20 14:45:26 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-07 12:49:12 -0700 |
commit | fd768f9e1102dddd46bc403537aaf75eb232e5f2 (patch) | |
tree | 13432a6695bc14501e2bdd9b058154eb225434c5 /tools | |
parent | 4f649eab234d51f8e46cc8d9567f356bc5d7a906 (diff) |
perf: net_dropmonitor: Fix symbol-relative addresses
commit 5a1e99dd2028e00998d42029be86835d8ef4a46e upstream.
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.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/perf/scripts/python/net_dropmonitor.py | 6 |
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 adbfbf03057..4c116056091 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(): |