Commit edee44be authored by Ravi Bangoria's avatar Ravi Bangoria Committed by Arnaldo Carvalho de Melo

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: default avatarAnton Blanchard <>
Link: default avatarRavi Bangoria <>
Cc: Alexander Shishkin <>
Cc: Benjamin Herrenschmidt <>
Cc: Chris Riyder <>
Cc: Masami Hiramatsu <>
Cc: Michael Ellerman <>
Cc: Nicholas Piggin <>
Cc: Paul Mackerras <>
Cc: Peter Zijlstra <>
Cc: # v4.9+
Link: default avatarArnaldo Carvalho de Melo <>
parent 9de3ffa1
......@@ -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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment