aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-kvm.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2014-08-12 02:40:45 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-08-13 15:42:21 -0400
commit0a7e6d1b6844bec2d6817615a693c7fce447b80d (patch)
tree5bdb9ce67fa5b7c301c16e817f9b1d803a44374c /tools/perf/builtin-kvm.c
parentcb2ffae241cfdd6d90acb7ec5f52ad8401885dd2 (diff)
perf tools: Check recorded kernel version when finding vmlinux
Currently vmlinux_path__init() only tries to find vmlinux file from current directory, /boot and some canonical directories with version number of the running kernel. This can be a problem when reporting old data recorded on a kernel version not running currently. We can use --symfs option for this but it's annoying for user to do it always. As we already have the info in the perf.data file, it can be changed to use it for the search automatically. Before: $ perf report ... # Samples: 4K of event 'cpu-clock' # Event count (approx.): 1067250000 # # Overhead Command Shared Object Symbol # ........ .......... ................. .............................. 71.87% swapper [kernel.kallsyms] [k] recover_probed_instruction After: # Overhead Command Shared Object Symbol # ........ .......... ................. .................... 71.87% swapper [kernel.kallsyms] [k] native_safe_halt This requires to change signature of symbol__init() to receive struct perf_session_env *. Reported-by: Minchan Kim <minchan@kernel.org> Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1407825645-24586-14-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-kvm.c')
-rw-r--r--tools/perf/builtin-kvm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 7f2b55513863..14d03edc81c2 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -1064,7 +1064,7 @@ static int read_events(struct perf_kvm_stat *kvm)
1064 return -EINVAL; 1064 return -EINVAL;
1065 } 1065 }
1066 1066
1067 symbol__init(); 1067 symbol__init(&kvm->session->header.env);
1068 1068
1069 if (!perf_session__has_traces(kvm->session, "kvm record")) 1069 if (!perf_session__has_traces(kvm->session, "kvm record"))
1070 return -EINVAL; 1070 return -EINVAL;
@@ -1314,7 +1314,7 @@ static int kvm_events_live(struct perf_kvm_stat *kvm,
1314 kvm->opts.target.uid_str = NULL; 1314 kvm->opts.target.uid_str = NULL;
1315 kvm->opts.target.uid = UINT_MAX; 1315 kvm->opts.target.uid = UINT_MAX;
1316 1316
1317 symbol__init(); 1317 symbol__init(NULL);
1318 disable_buildid_cache(); 1318 disable_buildid_cache();
1319 1319
1320 use_browser = 0; 1320 use_browser = 0;