Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1527310

[PATCH] perf TUI: Don't throw error for zero length symbols

From Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject [PATCH] perf TUI: Don't throw error for zero length symbols
Date 2016-11-22 09:50 +0100
Message-ID <sGeW5-4Pc-13@gated-at.bofh.it> (permalink)
References <sFQh4-5YA-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


perf report (with TUI) exits with error when it finds a sample of zero
length symbol(i.e. addr == sym->start == sym->end). Actually these are
valid samples. Don't exit TUI and show report with such symbols.

Link: https://lkml.org/lkml/2016/10/8/189

Reported-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
---
 tools/perf/util/annotate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index aeb5a44..430d039 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -593,7 +593,8 @@ static int __symbol__inc_addr_samples(struct symbol *sym, struct map *map,
 
 	pr_debug3("%s: addr=%#" PRIx64 "\n", __func__, map->unmap_ip(map, addr));
 
-	if (addr < sym->start || addr >= sym->end) {
+	if ((addr < sym->start || addr >= sym->end) &&
+	    (addr != sym->end || sym->start != sym->end)) {
 		pr_debug("%s(%d): ERANGE! sym->name=%s, start=%#" PRIx64 ", addr=%#" PRIx64 ", end=%#" PRIx64 "\n",
 		       __func__, __LINE__, sym->name, sym->start, addr, sym->end);
 		return -ERANGE;
-- 
1.8.3.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: perf TUI fails with "failed to process type: 64" Anton Blanchard <anton@samba.org> - 2016-11-21 07:30 +0100
  [PATCH] perf TUI: Don't throw error for zero length symbols Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-11-22 09:50 +0100
    Re: [PATCH] perf TUI: Don't throw error for zero length symbols Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-11-22 09:50 +0100
      Re: [PATCH] perf TUI: Don't throw error for zero length symbols Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-11-22 10:00 +0100

csiph-web