mirror of https://github.com/torvalds/linux.git
perf lock: Fix segfault due to missing kernel map
Kernel maps are encoded in PERF_RECORD_MMAP2 samples but "perf lock
report" and "perf lock contention" do not process MMAP2 samples.
Because of that, machine->vmlinux_map stays NULL and any later access
triggers a segmentation fault.
Fix it by adding ->mmap2() callbacks.
Fixes: 53b00ff358 ("perf record: Make --buildid-mmap the default")
Reported-by: Tycho Andersen (AMD) <tycho@kernel.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com>
Tested-by: Tycho Andersen (AMD) <tycho@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ananth Narayan <ananth.narayan@amd.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sandipan Das <sandipan.das@amd.com>
Cc: Santosh Shukla <santosh.shukla@amd.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
84003ab3d0
commit
d0206db94b
|
|
@ -1867,6 +1867,7 @@ static int __cmd_report(bool display_info)
|
|||
eops.sample = process_sample_event;
|
||||
eops.comm = perf_event__process_comm;
|
||||
eops.mmap = perf_event__process_mmap;
|
||||
eops.mmap2 = perf_event__process_mmap2;
|
||||
eops.namespaces = perf_event__process_namespaces;
|
||||
eops.tracing_data = perf_event__process_tracing_data;
|
||||
session = perf_session__new(&data, &eops);
|
||||
|
|
@ -2023,6 +2024,7 @@ static int __cmd_contention(int argc, const char **argv)
|
|||
eops.sample = process_sample_event;
|
||||
eops.comm = perf_event__process_comm;
|
||||
eops.mmap = perf_event__process_mmap;
|
||||
eops.mmap2 = perf_event__process_mmap2;
|
||||
eops.tracing_data = perf_event__process_tracing_data;
|
||||
|
||||
perf_env__init(&host_env);
|
||||
|
|
|
|||
Loading…
Reference in New Issue