diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-03-27 12:55:57 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-04-05 19:51:14 -0300 |
commit | 31d68e7b66f168e623902e194af1e52b8cf75d71 (patch) | |
tree | 2a9f2925549d1995ebb316a52c82a53ac640556e /tools/perf/util/map.h | |
parent | 8493fe1daf15324eb13a4cc2f94e258716daa568 (diff) |
perf annotate: Validate addr in symbol__inc_addr_samples
This routine was checking only if the provided address was after
sym->end, not if it was before sym->start.
Fix that by checking for both and return in both cases -ERANGE, so that
tools can communicate this to the user properly, or if they chose so, to
abort.
This problem was reported previously but the fixes involved either doing
what was being done for the > end case, i.e. silently drop the sample,
returning 0, or aborting at this function, which is in a lib (or better,
is slated to be at some point) and shouldn't abort.
The 'report' tool already checks this value and uses pr_debug to warn
the user.
This patch makes the 'top' tool check it too and warn once per map where
such range problem takes place.
Reported-by: David Miller <davem@davemloft.net>
Reported-by: Sorin Dumitru <dumitru.sorin87@gmail.com>
Reported-by: Stephane Eranian <eranian@google.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/n/tip-lw8gs7p9i9nhldilo82tzpne@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/map.h')
-rw-r--r-- | tools/perf/util/map.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h index b100c20b7f9..81371bad4ef 100644 --- a/tools/perf/util/map.h +++ b/tools/perf/util/map.h @@ -33,6 +33,7 @@ struct map { u64 end; u8 /* enum map_type */ type; bool referenced; + bool erange_warned; u32 priv; u64 pgoff; |