From: Ben Hutchings <ben@decadent.org.uk>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>,
Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@redhat.com>
Cc: Neil Horman <nhorman@tuxdriver.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, 708994@bugs.debian.org
Subject: [PATCH 2/5] perf: net_dropmonitor: Fix symbol-relative addresses
Date: Tue, 21 May 2013 01:45:26 +0100 [thread overview]
Message-ID: <1369097126.3469.133.camel@deadeye.wl.decadent.org.uk> (raw)
In-Reply-To: <1369096976.3469.131.camel@deadeye.wl.decadent.org.uk>
[-- Attachment #1: Type: text/plain, Size: 1029 bytes --]
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>
---
tools/perf/scripts/python/net_dropmonitor.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/perf/scripts/python/net_dropmonitor.py b/tools/perf/scripts/python/net_dropmonitor.py
index adbfbf0..4c11605 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():
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2013-05-21 0:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-21 0:42 [PATCH 0/5] perf: net_dropmonitor: Make it work and make it fast Ben Hutchings
2013-05-21 0:44 ` [PATCH 1/5] perf: net_dropmonitor: Fix trace parameter order Ben Hutchings
2013-05-21 0:45 ` Ben Hutchings [this message]
2013-05-21 0:45 ` [PATCH 3/5] perf: net_dropmonitor: Do not assume ordering of dictionaries Ben Hutchings
2013-05-21 0:45 ` [PATCH 4/5] perf: net_dropmonitor: Use bisection in symbol lookup Ben Hutchings
2013-05-21 0:45 ` [PATCH 5/5] perf: net_dropmonitor: Remove progress indicator Ben Hutchings
2013-05-21 13:33 ` [PATCH 0/5] perf: net_dropmonitor: Make it work and make it fast Neil Horman
2013-05-21 13:54 ` Ben Hutchings
2013-05-21 16:06 ` Neil Horman
2013-05-21 16:12 ` Neil Horman
2013-05-22 22:11 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1369097126.3469.133.camel@deadeye.wl.decadent.org.uk \
--to=ben@decadent.org.uk \
--cc=708994@bugs.debian.org \
--cc=a.p.zijlstra@chello.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=paulus@samba.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®