aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-03-22 14:42:14 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-03-23 18:29:46 -0400
commit60e4b10c5a27182bc8ce7435050a17cb61c94d00 (patch)
treecaf58784e25218e8e0340b9b22fe65bed08fa335
parentb25114817a73bbd2b84ce9dba02ee1ef8989a947 (diff)
perf symbols: Look at .dynsym again if .symtab not found
The original intent of the code was to repeat the search with want_symtab = 0. But as the code stands now, we never hit the "default" case of the switch statement. Which means we never repeat the search. Tested-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Reported-by: Arun Sharma <asharma@fb.com> Reported-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Dave Martin <dave.martin@linaro.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/symbol.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 651dbfe7f4f3..17df793c8924 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1486,7 +1486,9 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter)
1486 * On the first pass, only load images if they have a full symtab. 1486 * On the first pass, only load images if they have a full symtab.
1487 * Failing that, do a second pass where we accept .dynsym also 1487 * Failing that, do a second pass where we accept .dynsym also
1488 */ 1488 */
1489 for (self->symtab_type = SYMTAB__BUILD_ID_CACHE, want_symtab = 1; 1489 want_symtab = 1;
1490restart:
1491 for (self->symtab_type = SYMTAB__BUILD_ID_CACHE;
1490 self->symtab_type != SYMTAB__NOT_FOUND; 1492 self->symtab_type != SYMTAB__NOT_FOUND;
1491 self->symtab_type++) { 1493 self->symtab_type++) {
1492 switch (self->symtab_type) { 1494 switch (self->symtab_type) {
@@ -1536,17 +1538,7 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter)
1536 snprintf(name, size, "%s%s", symbol_conf.symfs, 1538 snprintf(name, size, "%s%s", symbol_conf.symfs,
1537 self->long_name); 1539 self->long_name);
1538 break; 1540 break;
1539 1541 default:;
1540 default:
1541 /*
1542 * If we wanted a full symtab but no image had one,
1543 * relax our requirements and repeat the search.
1544 */
1545 if (want_symtab) {
1546 want_symtab = 0;
1547 self->symtab_type = SYMTAB__BUILD_ID_CACHE;
1548 } else
1549 continue;
1550 } 1542 }
1551 1543
1552 /* Name is now the name of the next image to try */ 1544 /* Name is now the name of the next image to try */
@@ -1573,6 +1565,15 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter)
1573 } 1565 }
1574 } 1566 }
1575 1567
1568 /*
1569 * If we wanted a full symtab but no image had one,
1570 * relax our requirements and repeat the search.
1571 */
1572 if (ret <= 0 && want_symtab) {
1573 want_symtab = 0;
1574 goto restart;
1575 }
1576
1576 free(name); 1577 free(name);
1577 if (ret < 0 && strstr(self->name, " (deleted)") != NULL) 1578 if (ret < 0 && strstr(self->name, " (deleted)") != NULL)
1578 return 0; 1579 return 0;