aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/symbol.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r--tools/perf/util/symbol.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 00014e32c288..651dbfe7f4f3 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -207,7 +207,7 @@ struct dso *dso__new(const char *name)
207 dso__set_short_name(self, self->name); 207 dso__set_short_name(self, self->name);
208 for (i = 0; i < MAP__NR_TYPES; ++i) 208 for (i = 0; i < MAP__NR_TYPES; ++i)
209 self->symbols[i] = self->symbol_names[i] = RB_ROOT; 209 self->symbols[i] = self->symbol_names[i] = RB_ROOT;
210 self->origin = DSO__ORIG_NOT_FOUND; 210 self->symtab_type = SYMTAB__NOT_FOUND;
211 self->loaded = 0; 211 self->loaded = 0;
212 self->sorted_by_name = 0; 212 self->sorted_by_name = 0;
213 self->has_build_id = 0; 213 self->has_build_id = 0;
@@ -680,9 +680,9 @@ int dso__load_kallsyms(struct dso *self, const char *filename,
680 return -1; 680 return -1;
681 681
682 if (self->kernel == DSO_TYPE_GUEST_KERNEL) 682 if (self->kernel == DSO_TYPE_GUEST_KERNEL)
683 self->origin = DSO__ORIG_GUEST_KERNEL; 683 self->symtab_type = SYMTAB__GUEST_KALLSYMS;
684 else 684 else
685 self->origin = DSO__ORIG_KERNEL; 685 self->symtab_type = SYMTAB__KALLSYMS;
686 686
687 return dso__split_kallsyms(self, map, filter); 687 return dso__split_kallsyms(self, map, filter);
688} 688}
@@ -1204,7 +1204,7 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name,
1204 } 1204 }
1205 curr_map->map_ip = identity__map_ip; 1205 curr_map->map_ip = identity__map_ip;
1206 curr_map->unmap_ip = identity__map_ip; 1206 curr_map->unmap_ip = identity__map_ip;
1207 curr_dso->origin = self->origin; 1207 curr_dso->symtab_type = self->symtab_type;
1208 map_groups__insert(kmap->kmaps, curr_map); 1208 map_groups__insert(kmap->kmaps, curr_map);
1209 dsos__add(&self->node, curr_dso); 1209 dsos__add(&self->node, curr_dso);
1210 dso__set_loaded(curr_dso, map->type); 1210 dso__set_loaded(curr_dso, map->type);
@@ -1430,21 +1430,21 @@ out:
1430char dso__symtab_origin(const struct dso *self) 1430char dso__symtab_origin(const struct dso *self)
1431{ 1431{
1432 static const char origin[] = { 1432 static const char origin[] = {
1433 [DSO__ORIG_KERNEL] = 'k', 1433 [SYMTAB__KALLSYMS] = 'k',
1434 [DSO__ORIG_JAVA_JIT] = 'j', 1434 [SYMTAB__JAVA_JIT] = 'j',
1435 [DSO__ORIG_BUILD_ID_CACHE] = 'B', 1435 [SYMTAB__BUILD_ID_CACHE] = 'B',
1436 [DSO__ORIG_FEDORA] = 'f', 1436 [SYMTAB__FEDORA_DEBUGINFO] = 'f',
1437 [DSO__ORIG_UBUNTU] = 'u', 1437 [SYMTAB__UBUNTU_DEBUGINFO] = 'u',
1438 [DSO__ORIG_BUILDID] = 'b', 1438 [SYMTAB__BUILDID_DEBUGINFO] = 'b',
1439 [DSO__ORIG_DSO] = 'd', 1439 [SYMTAB__SYSTEM_PATH_DSO] = 'd',
1440 [DSO__ORIG_KMODULE] = 'K', 1440 [SYMTAB__SYSTEM_PATH_KMODULE] = 'K',
1441 [DSO__ORIG_GUEST_KERNEL] = 'g', 1441 [SYMTAB__GUEST_KALLSYMS] = 'g',
1442 [DSO__ORIG_GUEST_KMODULE] = 'G', 1442 [SYMTAB__GUEST_KMODULE] = 'G',
1443 }; 1443 };
1444 1444
1445 if (self == NULL || self->origin == DSO__ORIG_NOT_FOUND) 1445 if (self == NULL || self->symtab_type == SYMTAB__NOT_FOUND)
1446 return '!'; 1446 return '!';
1447 return origin[self->origin]; 1447 return origin[self->symtab_type];
1448} 1448}
1449 1449
1450int dso__load(struct dso *self, struct map *map, symbol_filter_t filter) 1450int dso__load(struct dso *self, struct map *map, symbol_filter_t filter)
@@ -1477,8 +1477,8 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter)
1477 1477
1478 if (strncmp(self->name, "/tmp/perf-", 10) == 0) { 1478 if (strncmp(self->name, "/tmp/perf-", 10) == 0) {
1479 ret = dso__load_perf_map(self, map, filter); 1479 ret = dso__load_perf_map(self, map, filter);
1480 self->origin = ret > 0 ? DSO__ORIG_JAVA_JIT : 1480 self->symtab_type = ret > 0 ? SYMTAB__JAVA_JIT :
1481 DSO__ORIG_NOT_FOUND; 1481 SYMTAB__NOT_FOUND;
1482 return ret; 1482 return ret;
1483 } 1483 }
1484 1484
@@ -1486,26 +1486,26 @@ 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->origin = DSO__ORIG_BUILD_ID_CACHE, want_symtab = 1; 1489 for (self->symtab_type = SYMTAB__BUILD_ID_CACHE, want_symtab = 1;
1490 self->origin != DSO__ORIG_NOT_FOUND; 1490 self->symtab_type != SYMTAB__NOT_FOUND;
1491 self->origin++) { 1491 self->symtab_type++) {
1492 switch (self->origin) { 1492 switch (self->symtab_type) {
1493 case DSO__ORIG_BUILD_ID_CACHE: 1493 case SYMTAB__BUILD_ID_CACHE:
1494 /* skip the locally configured cache if a symfs is given */ 1494 /* skip the locally configured cache if a symfs is given */
1495 if (symbol_conf.symfs[0] || 1495 if (symbol_conf.symfs[0] ||
1496 (dso__build_id_filename(self, name, size) == NULL)) { 1496 (dso__build_id_filename(self, name, size) == NULL)) {
1497 continue; 1497 continue;
1498 } 1498 }
1499 break; 1499 break;
1500 case DSO__ORIG_FEDORA: 1500 case SYMTAB__FEDORA_DEBUGINFO:
1501 snprintf(name, size, "%s/usr/lib/debug%s.debug", 1501 snprintf(name, size, "%s/usr/lib/debug%s.debug",
1502 symbol_conf.symfs, self->long_name); 1502 symbol_conf.symfs, self->long_name);
1503 break; 1503 break;
1504 case DSO__ORIG_UBUNTU: 1504 case SYMTAB__UBUNTU_DEBUGINFO:
1505 snprintf(name, size, "%s/usr/lib/debug%s", 1505 snprintf(name, size, "%s/usr/lib/debug%s",
1506 symbol_conf.symfs, self->long_name); 1506 symbol_conf.symfs, self->long_name);
1507 break; 1507 break;
1508 case DSO__ORIG_BUILDID: { 1508 case SYMTAB__BUILDID_DEBUGINFO: {
1509 char build_id_hex[BUILD_ID_SIZE * 2 + 1]; 1509 char build_id_hex[BUILD_ID_SIZE * 2 + 1];
1510 1510
1511 if (!self->has_build_id) 1511 if (!self->has_build_id)
@@ -1519,11 +1519,11 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter)
1519 symbol_conf.symfs, build_id_hex, build_id_hex + 2); 1519 symbol_conf.symfs, build_id_hex, build_id_hex + 2);
1520 } 1520 }
1521 break; 1521 break;
1522 case DSO__ORIG_DSO: 1522 case SYMTAB__SYSTEM_PATH_DSO:
1523 snprintf(name, size, "%s%s", 1523 snprintf(name, size, "%s%s",
1524 symbol_conf.symfs, self->long_name); 1524 symbol_conf.symfs, self->long_name);
1525 break; 1525 break;
1526 case DSO__ORIG_GUEST_KMODULE: 1526 case SYMTAB__GUEST_KMODULE:
1527 if (map->groups && machine) 1527 if (map->groups && machine)
1528 root_dir = machine->root_dir; 1528 root_dir = machine->root_dir;
1529 else 1529 else
@@ -1532,7 +1532,7 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter)
1532 root_dir, self->long_name); 1532 root_dir, self->long_name);
1533 break; 1533 break;
1534 1534
1535 case DSO__ORIG_KMODULE: 1535 case SYMTAB__SYSTEM_PATH_KMODULE:
1536 snprintf(name, size, "%s%s", symbol_conf.symfs, 1536 snprintf(name, size, "%s%s", symbol_conf.symfs,
1537 self->long_name); 1537 self->long_name);
1538 break; 1538 break;
@@ -1544,7 +1544,7 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter)
1544 */ 1544 */
1545 if (want_symtab) { 1545 if (want_symtab) {
1546 want_symtab = 0; 1546 want_symtab = 0;
1547 self->origin = DSO__ORIG_BUILD_ID_CACHE; 1547 self->symtab_type = SYMTAB__BUILD_ID_CACHE;
1548 } else 1548 } else
1549 continue; 1549 continue;
1550 } 1550 }
@@ -1757,9 +1757,9 @@ struct map *machine__new_module(struct machine *self, u64 start,
1757 return NULL; 1757 return NULL;
1758 1758
1759 if (machine__is_host(self)) 1759 if (machine__is_host(self))
1760 dso->origin = DSO__ORIG_KMODULE; 1760 dso->symtab_type = SYMTAB__SYSTEM_PATH_KMODULE;
1761 else 1761 else
1762 dso->origin = DSO__ORIG_GUEST_KMODULE; 1762 dso->symtab_type = SYMTAB__GUEST_KMODULE;
1763 map_groups__insert(&self->kmaps, map); 1763 map_groups__insert(&self->kmaps, map);
1764 return map; 1764 return map;
1765} 1765}