diff options
| author | Ravi Bangoria <[email protected]> | 2016-11-22 08:40:50 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2016-12-20 15:00:32 +0000 |
| commit | edee44be59190bf22d5c6e521f3852b7ff16862f (patch) | |
| tree | cf37aca9209c355c9d7cbd21d964fb67d358a42c /tools/perf/util/annotate.c | |
| parent | perf bench futex: Fix lock-pi help string (diff) | |
| download | kernel-edee44be59190bf22d5c6e521f3852b7ff16862f.tar.gz kernel-edee44be59190bf22d5c6e521f3852b7ff16862f.zip | |
perf annotate: Don't throw error for zero length symbols
'perf report --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.
Reported-and-Tested-by: Anton Blanchard <[email protected]>
Link: https://lkml.org/lkml/2016/10/8/189
Signed-off-by: Ravi Bangoria <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Chris Riyder <[email protected]>
Cc: [email protected]
Cc: Masami Hiramatsu <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Nicholas Piggin <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: [email protected] # v4.9+
Link: http://lkml.kernel.org/r/1479804050-5028-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/util/annotate.c')
| -rw-r--r-- | tools/perf/util/annotate.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index c81a3950a7fe..06cc04e5806a 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -647,7 +647,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; |
