summaryrefslogtreecommitdiff
path: root/simpleperf/event_selection_set.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2015-06-15 14:36:43 -0700
committerYabin Cui <yabinc@google.com>2015-06-15 14:37:26 -0700
commit6e8a9a4e52242f82104644bca0318284b3bbdd6b (patch)
tree961422e237f09d7bdc80944bdca0841d49626496 /simpleperf/event_selection_set.cpp
parentdecc11c6b5f88c72d2ca72be5efe6064f2176d1c (diff)
downloadextras-6e8a9a4e52242f82104644bca0318284b3bbdd6b.tar.gz
Simpleperf: support callchain sampling in record command.
Bug: 19483574 Change-Id: Icd8ed7c316144fc51d54f196872061533bdeef2b
Diffstat (limited to 'simpleperf/event_selection_set.cpp')
-rw-r--r--simpleperf/event_selection_set.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/simpleperf/event_selection_set.cpp b/simpleperf/event_selection_set.cpp
index 644938c1..b1618bd8 100644
--- a/simpleperf/event_selection_set.cpp
+++ b/simpleperf/event_selection_set.cpp
@@ -92,6 +92,12 @@ bool EventSelectionSet::SetBranchSampling(uint64_t branch_sample_type) {
return true;
}
+void EventSelectionSet::EnableCallChainSampling() {
+ for (auto& selection : selections_) {
+ selection.event_attr.sample_type |= PERF_SAMPLE_CALLCHAIN;
+ }
+}
+
bool EventSelectionSet::OpenEventFilesForAllCpus() {
std::vector<int> cpus = GetOnlineCpus();
if (cpus.empty()) {