Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182478
b: refs/heads/master
c: c7ad21a
h: refs/heads/master
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Feb 25, 2010
1 parent 5a4e13d commit f208cca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 37fe5fcb7a5b5235c8b71bf5469ce4c7246e3fab
refs/heads/master: c7ad21af2c8b7accb893a576b100296c61c5d610
7 changes: 4 additions & 3 deletions trunk/tools/perf/builtin-top.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f208cca

Please sign in to comment.