Skip to contentSkip to conversation

perf annotate: Add debug message for out of bounds sample

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Oct 22, 2015 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  e3d006ce8180a0c025ce66bdc89bbc125f85be57
Gitweb:     http://git.kernel.org/tip/e3d006ce8180a0c025ce66bdc89bbc125f85be57
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Wed, 21 Oct 2015 15:45:13 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 21 Oct 2015 18:12:37 -0300

perf annotate: Add debug message for out of bounds sample

Cc Adrian Hunter <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Stephane Eranian <[email protected]>
Cc Wang Nan <[email protected]>
---
 tools/perf/util/annotate.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tools/perf/util/annotate.c +4 -1
index d1eece7..0fc8d7a 100644
@@ -548,8 +548,11 @@ 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) {
+		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;
+	}
 
 	offset = addr - sym->start;
 	h = annotation__histogram(notes, evidx);