Skip to contentSkip to conversation

perf symbols: Rename dso->origin to dso->symtab_type

tip:perf/urgent tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Mar 16, 2011 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  878b439dccd064d6908800fab0b47bd3c3a87ebb
Gitweb:     http://git.kernel.org/tip/878b439dccd064d6908800fab0b47bd3c3a87ebb
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Fri, 11 Mar 2011 13:13:36 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Fri, 11 Mar 2011 13:28:45 -0300

perf symbols: Rename dso->origin to dso->symtab_type

And the DSO__ORIG_ enum to SYMTAB__, to clarify that this is about from where the symtab was obtained.

Cc: Frederic Weisbecker <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Tom Zanussi <[email protected]>
LKML-Reference: <new-submission>

---
 tools/perf/builtin-top.c   |    4 +-
 tools/perf/util/annotate.c |    2 +-
 tools/perf/util/symbol.c   |   64 ++++++++++++++++++++++----------------------
 tools/perf/util/symbol.h   |   26 +++++++++---------
 4 files changed, 48 insertions(+), 48 deletions(-)
tools/perf/builtin-top.c +2 -2
index 4976400..31ea7a6 100644
@@ -152,7 +152,7 @@ static int parse_source(struct sym_entry *syme)
 	/*
 	 * We can't annotate with just /proc/kallsyms
 	 */
-	if (map->dso->origin == DSO__ORIG_KERNEL) {
+	if (map->dso->symtab_type == SYMTAB__KALLSYMS) {
 		pr_err("Can't annotate %s: No vmlinux file was found in the "
 		       "path\n", sym->name);
 		sleep(1);
@@ -769,7 +769,7 @@ static void perf_event__process_sample(const union perf_event *event,
 			struct symbol *sym = sym_entry__symbol(top.sym_filter_entry);
 
 			pr_err("Can't annotate %s", sym->name);
-			if (top.sym_filter_entry->map->dso->origin == DSO__ORIG_KERNEL) {
+			if (top.sym_filter_entry->map->dso->symtab_type == SYMTAB__KALLSYMS) {
 				pr_err(": No vmlinux file was found in the path:\n");
 				machine__fprintf_vmlinux_path(machine, stderr);
 			} else
tools/perf/util/annotate.c +1 -1
index 0d0830c..e01af2b 100644
@@ -294,7 +294,7 @@ fallback:
 		free_filename = false;
 	}
 
-	if (dso->origin == DSO__ORIG_KERNEL) {
+	if (dso->symtab_type == SYMTAB__KALLSYMS) {
 		char bf[BUILD_ID_SIZE * 2 + 16] = " with build id ";
 		char *build_id_msg = NULL;
 
tools/perf/util/symbol.c +32 -32

144 lines not on this page · raw message

tools/perf/util/symbol.h +13 -13
index 4d7ed09..db39c0c 100644
@@ -137,7 +137,7 @@ struct dso {
 	u8		 annotate_warned:1;
 	u8		 sname_alloc:1;
 	u8		 lname_alloc:1;
-	unsigned char	 origin;
+	unsigned char	 symtab_type;
 	u8		 sorted_by_name;
 	u8		 loaded;
 	u8		 build_id[BUILD_ID_SIZE];
@@ -188,18 +188,18 @@ size_t dso__fprintf_buildid(struct dso *self, FILE *fp);
 size_t dso__fprintf_symbols_by_name(struct dso *self, enum map_type type, FILE *fp);
 size_t dso__fprintf(struct dso *self, enum map_type type, FILE *fp);
 
-enum dso_origin {
-	DSO__ORIG_KERNEL = 0,
-	DSO__ORIG_GUEST_KERNEL,
-	DSO__ORIG_JAVA_JIT,
-	DSO__ORIG_BUILD_ID_CACHE,
-	DSO__ORIG_FEDORA,
-	DSO__ORIG_UBUNTU,
-	DSO__ORIG_BUILDID,
-	DSO__ORIG_DSO,
-	DSO__ORIG_GUEST_KMODULE,
-	DSO__ORIG_KMODULE,
-	DSO__ORIG_NOT_FOUND,
+enum symtab_type {
+	SYMTAB__KALLSYMS = 0,
+	SYMTAB__GUEST_KALLSYMS,
+	SYMTAB__JAVA_JIT,
+	SYMTAB__BUILD_ID_CACHE,
+	SYMTAB__FEDORA_DEBUGINFO,
+	SYMTAB__UBUNTU_DEBUGINFO,
+	SYMTAB__BUILDID_DEBUGINFO,
+	SYMTAB__SYSTEM_PATH_DSO,
+	SYMTAB__GUEST_KMODULE,
+	SYMTAB__SYSTEM_PATH_KMODULE,
+	SYMTAB__NOT_FOUND,
 };
 
 char dso__symtab_origin(const struct dso *self);