From f208cca0480faba8eb97e0b534e8829053314307 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Mon, 22 Feb 2010 16:14:22 -0300 Subject: [PATCH] --- yaml --- r: 182478 b: refs/heads/master c: c7ad21af2c8b7accb893a576b100296c61c5d610 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/tools/perf/builtin-top.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 5f622b272624..fcd6948dc75b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 37fe5fcb7a5b5235c8b71bf5469ce4c7246e3fab +refs/heads/master: c7ad21af2c8b7accb893a576b100296c61c5d610 diff --git a/trunk/tools/perf/builtin-top.c b/trunk/tools/perf/builtin-top.c index c72ab50d65ca..c6706984b7b3 100644 --- a/trunk/tools/perf/builtin-top.c +++ b/trunk/tools/perf/builtin-top.c @@ -287,19 +287,20 @@ static void record_precise_ip(struct sym_entry *syme, int counter, u64 ip) pthread_mutex_unlock(&syme->src->lock); } +#define PATTERN_LEN (BITS_PER_LONG / 4 + 2) + static void lookup_sym_source(struct sym_entry *syme) { struct symbol *symbol = sym_entry__symbol(syme); struct source_line *line; - const size_t pattern_len = BITS_PER_LONG / 4 + 2; - char pattern[pattern_len + 1]; + char pattern[PATTERN_LEN + 1]; sprintf(pattern, "%0*Lx <", BITS_PER_LONG / 4, map__rip_2objdump(syme->map, symbol->start)); pthread_mutex_lock(&syme->src->lock); for (line = syme->src->lines; line; line = line->next) { - if (memcmp(line->line, pattern, pattern_len) == 0) { + if (memcmp(line->line, pattern, PATTERN_LEN) == 0) { syme->src->source = line; break; }