projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5c35d69
)
perf annotate: Check if offset is less than symbol size
author
Arnaldo Carvalho de Melo
<
[email protected]
>
Wed, 9 Feb 2011 15:56:28 +0000
(13:56 -0200)
committer
Arnaldo Carvalho de Melo
<
[email protected]
>
Wed, 16 Feb 2011 16:47:55 +0000
(14:47 -0200)
Just like done on symbol__inc_addr_samples to catch misparsed offsets
from objdump.
Cc: Frederic Weisbecker <
[email protected]
>
Cc: Ingo Molnar <
[email protected]
>
Cc: Mike Galbraith <
[email protected]
>
Cc: Paul Mackerras <
[email protected]
>
Cc: Peter Zijlstra <
[email protected]
>
Cc: Stephane Eranian <
[email protected]
>
Cc: Tom Zanussi <
[email protected]
>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <
[email protected]
>
tools/perf/util/annotate.c
patch
|
blob
|
history
diff --git
a/tools/perf/util/annotate.c
b/tools/perf/util/annotate.c
index 02976b895f27bcfcbc7cea2862f6c865a59cdbdd..70ec422ddb649f6a763adf3e975e115a8f6c58c3 100644
(file)
--- a/
tools/perf/util/annotate.c
+++ b/
tools/perf/util/annotate.c
@@
-541,11
+541,12
@@
void symbol__annotate_decay_histogram(struct symbol *sym, int evidx)
struct annotation *notes = symbol__annotation(sym);
struct sym_hist *h = annotation__histogram(notes, evidx);
struct objdump_line *pos;
+ int len = sym->end - sym->start;
h->sum = 0;
list_for_each_entry(pos, ¬es->src->source, node) {
- if (pos->offset != -1) {
+ if (pos->offset != -1
&& pos->offset < len
) {
h->addr[pos->offset] = h->addr[pos->offset] * 7 / 8;
h->sum += h->addr[pos->offset];
}