Return-Path: Message-Id: <20130703184048.091137547@goodmis.org> Date: Wed, 03 Jul 2013 14:39:18 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ben Hutchings , "David S. Miller" Subject: [021/141] perf: net_dropmonitor: Fix symbol-relative addresses References: <20130703183857.307196999@goodmis.org> Content-Disposition: inline; filename=0021-perf-net_dropmonitor-Fix-symbol-relative-addresses.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: 3.6.11.6 stable review patch. If anyone has any objections, please let me know. ------------------ From: Ben Hutchings [ 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 Signed-off-by: David S. Miller Signed-off-by: Steven Rostedt --- 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(): -- 1.7.10.4