diff options
| author | David S. Miller <davem@davemloft.net> | 2012-04-10 14:30:45 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2012-04-10 14:30:45 -0400 |
| commit | 06eb4eafbdc0796d741d139a44f1253278da8611 (patch) | |
| tree | fbdb44317130c371928154c9e6903e699fe2b995 /tools/perf/util/annotate.c | |
| parent | 32ed53b83ea5ec26a4dba90e18f5e0ff6c71eb48 (diff) | |
| parent | f68e556e23d1a4176b563bcb25d8baf2c5313f91 (diff) | |
| download | olio-linux-3.10-06eb4eafbdc0796d741d139a44f1253278da8611.tar.xz olio-linux-3.10-06eb4eafbdc0796d741d139a44f1253278da8611.zip | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'tools/perf/util/annotate.c')
| -rw-r--r-- | tools/perf/util/annotate.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index e5a462f1d07..199f69ec656 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -28,8 +28,8 @@ int symbol__annotate_init(struct map *map __used, struct symbol *sym) int symbol__alloc_hist(struct symbol *sym) { struct annotation *notes = symbol__annotation(sym); - size_t sizeof_sym_hist = (sizeof(struct sym_hist) + - (sym->end - sym->start) * sizeof(u64)); + const size_t size = sym->end - sym->start + 1; + size_t sizeof_sym_hist = (sizeof(struct sym_hist) + size * sizeof(u64)); notes->src = zalloc(sizeof(*notes->src) + symbol_conf.nr_events * sizeof_sym_hist); if (notes->src == NULL) @@ -64,7 +64,7 @@ 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->end) + if (addr > sym->end) return 0; offset = addr - sym->start; @@ -408,7 +408,7 @@ static int symbol__get_source_line(struct symbol *sym, struct map *map, if (!notes->src->lines) return -1; - start = map->unmap_ip(map, sym->start); + start = map__rip_2objdump(map, sym->start); for (i = 0; i < len; i++) { char *path = NULL; |