summaryrefslogtreecommitdiff
path: root/simpleperf/event_selection_set.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2016-03-18 12:30:31 -0700
committerYabin Cui <yabinc@google.com>2016-03-18 16:24:56 -0700
commit48460892306fbc232d7623b1aa5be1aefdc1a8a7 (patch)
treee67cfcd29f7a8d5e1260745686b44e56ee695a37 /simpleperf/event_selection_set.cpp
parent47ea8eeab1ad047432fcecf5b9abb2d015ee66ed (diff)
downloadextras-48460892306fbc232d7623b1aa5be1aefdc1a8a7.tar.gz
Simpleperf: remove dependency on global current_arch.
When running unit tests on arm64 devices: [OK] ReportCommandTest.dwarf_callgraph [OK] record_cmd.dwarf_callchain_sampling. ERROR: can't unwind data recorded on a different architecture. It is because ReportCommandtest.dwarf_callgraph opens a perf.data recorded on x86_64, and changes current_arch. It causes a problem when the test record_cmd.dwarf_callchain_sampling calls libbacktrace built on aarch64. Athough it doesn't make the test fail, we should fix this. Change-Id: I2cd70369a769ef2199cab2302b8b824369be0907
Diffstat (limited to 'simpleperf/event_selection_set.cpp')
-rw-r--r--simpleperf/event_selection_set.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/simpleperf/event_selection_set.cpp b/simpleperf/event_selection_set.cpp
index d99966a2..fad8b1e1 100644
--- a/simpleperf/event_selection_set.cpp
+++ b/simpleperf/event_selection_set.cpp
@@ -45,7 +45,7 @@ bool IsDwarfCallChainSamplingSupported() {
perf_event_attr attr = CreateDefaultPerfEventAttr(*type);
attr.sample_type |= PERF_SAMPLE_CALLCHAIN | PERF_SAMPLE_REGS_USER | PERF_SAMPLE_STACK_USER;
attr.exclude_callchain_user = 1;
- attr.sample_regs_user = GetSupportedRegMask();
+ attr.sample_regs_user = GetSupportedRegMask(GetBuildArch());
attr.sample_stack_user = 8192;
return IsEventAttrSupportedByKernel(attr);
}
@@ -166,7 +166,7 @@ bool EventSelectionSet::EnableDwarfCallChainSampling(uint32_t dump_stack_size) {
selection.event_attr.sample_type |=
PERF_SAMPLE_CALLCHAIN | PERF_SAMPLE_REGS_USER | PERF_SAMPLE_STACK_USER;
selection.event_attr.exclude_callchain_user = 1;
- selection.event_attr.sample_regs_user = GetSupportedRegMask();
+ selection.event_attr.sample_regs_user = GetSupportedRegMask(GetBuildArch());
selection.event_attr.sample_stack_user = dump_stack_size;
}
return true;