Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182462
b: refs/heads/master
c: 5f48536
h: refs/heads/master
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Feb 7, 2010
1 parent c67bb87 commit 8f9c322
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 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: ee11b90b12eb1ec25e1044bac861e90bfd19ec9e
refs/heads/master: 5f485364365f00853e5249cb3ae31f876936b552
15 changes: 8 additions & 7 deletions trunk/tools/perf/builtin-top.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,9 @@ static void parse_source(struct sym_entry *syme)
len = sym->end - sym->start;

sprintf(command,
"objdump --start-address=0x%016Lx "
"--stop-address=0x%016Lx -dS %s",
map__rip_2objdump(map, sym->start),
map__rip_2objdump(map, sym->end), path);
"objdump --start-address=%#0*Lx --stop-address=%#0*Lx -dS %s",
BITS_PER_LONG / 4, map__rip_2objdump(map, sym->start),
BITS_PER_LONG / 4, map__rip_2objdump(map, sym->end), path);

file = popen(command, "r");
if (!file)
Expand Down Expand Up @@ -292,13 +291,15 @@ static void lookup_sym_source(struct sym_entry *syme)
{
struct symbol *symbol = sym_entry__symbol(syme);
struct source_line *line;
char pattern[PATH_MAX];
const size_t pattern_len = BITS_PER_LONG / 4 + 2;
char pattern[pattern_len + 1];

sprintf(pattern, "<%s>:", symbol->name);
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 (strstr(line->line, pattern)) {
if (memcmp(line->line, pattern, pattern_len) == 0) {
syme->src->source = line;
break;
}
Expand Down

0 comments on commit 8f9c322

Please sign in to comment.