Skip to content

Commit 000a4c4

Browse files
bwhacksgregkh
authored andcommitted
perf: net_dropmonitor: Fix symbol-relative addresses
commit 5a1e99d 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>
1 parent c86d7a5 commit 000a4c4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎tools/perf/scripts/python/net_dropmonitor.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ def get_kallsyms_table():
4040

4141
def get_sym(sloc):
4242
loc = int(sloc)
43-
for i in kallsyms:
44-
if (i['loc'] >= loc):
45-
return (i['name'], i['loc']-loc)
43+
for i in kallsyms[::-1]:
44+
if loc >= i['loc']:
45+
return (i['name'], loc - i['loc'])
4646
return (None, 0)
4747

4848
def print_drop_table():

0 commit comments

Comments
 (0)