diff options
| author | Arnaldo Carvalho de Melo <[email protected]> | 2017-12-11 17:47:49 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2017-12-27 15:15:52 +0000 |
| commit | 4e8fbc1c975c667c61a3073da81b338b9bf61c37 (patch) | |
| tree | e4a27eb5ee86c43a49e898ac8416487f5c68a6e5 /tools/perf/util/annotate.c | |
| parent | perf annotate: Use perf_env when obtaining the arch name (diff) | |
| download | kernel-4e8fbc1c975c667c61a3073da81b338b9bf61c37.tar.gz kernel-4e8fbc1c975c667c61a3073da81b338b9bf61c37.zip | |
perf env: Adopt perf_env__arch() from the annotate code
And use it in the libunwind case, with both passing a valid perf_env to
extract the arch to be normalized from and passing NULL with the same
semantic as in the annotate code: to get it from uname() uts.machine.
Now the code to generate per arch errno translation tables (int/string)
can use it to decode perf.data files recorded in a different arch than
that where 'perf trace' (or any other analysis tool) runs.
Cc: Adrian Hunter <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Hendrik Brueckner <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Michael Petlan <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Thomas Richter <[email protected]>
Cc: Wang Nan <[email protected]>
Link: https://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/util/annotate.c')
| -rw-r--r-- | tools/perf/util/annotate.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index eac45ccd5c32..68e687d1bf99 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -26,7 +26,6 @@ #include <pthread.h> #include <linux/bitops.h> #include <linux/kernel.h> -#include <sys/utsname.h> #include "sane_ctype.h" @@ -1420,21 +1419,6 @@ fallback: return 0; } -static const char *perf_env__arch(struct perf_env *env) -{ - struct utsname uts; - char *arch_name; - - if (!env) { /* Assume local operation */ - if (uname(&uts) < 0) - return NULL; - arch_name = uts.machine; - } else - arch_name = env->arch; - - return normalize_arch(arch_name); -} - static int symbol__disassemble(struct symbol *sym, struct annotate_args *args) { struct map *map = args->map; |
