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>
This commit is contained in:
Ben Hutchings 2013-05-20 14:45:26 +00:00 committed by David S. Miller
parent 140c3c6a2b
commit 5a1e99dd20

View file

@ -40,9 +40,9 @@ def get_kallsyms_table():
def get_sym(sloc): def get_sym(sloc):
loc = int(sloc) loc = int(sloc)
for i in kallsyms: for i in kallsyms[::-1]:
if (i['loc'] >= loc): if loc >= i['loc']:
return (i['name'], i['loc']-loc) return (i['name'], loc - i['loc'])
return (None, 0) return (None, 0)
def print_drop_table(): def print_drop_table():