summaryrefslogtreecommitdiff
path: root/simpleperf/event_selection_set.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2020-11-12 10:14:21 -0800
committerYabin Cui <yabinc@google.com>2020-11-12 10:24:31 -0800
commit2cb6c168e6539d9b057ec14d29a8588379cba53a (patch)
tree8ad7f2cf7a20da551f8f271d7eeed8341b533f06 /simpleperf/event_selection_set.cpp
parent769c2b61d5feeafb84b2ed7f436cc0a07b77b64b (diff)
downloadextras-2cb6c168e6539d9b057ec14d29a8588379cba53a.tar.gz
simpleperf: wake up per sample in monitor cmd.
It is to show samples in real time. Also flush stdout after printing each sample. Bug: none Test: run simpleperf_unit_test. Change-Id: I7de8ae82deedb76d736c7635f6818ba7b6f440bc
Diffstat (limited to 'simpleperf/event_selection_set.cpp')
-rw-r--r--simpleperf/event_selection_set.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/simpleperf/event_selection_set.cpp b/simpleperf/event_selection_set.cpp
index b92f1005..2ef634b4 100644
--- a/simpleperf/event_selection_set.cpp
+++ b/simpleperf/event_selection_set.cpp
@@ -488,6 +488,15 @@ bool EventSelectionSet::RecordNotExecutableMaps() const {
return groups_[0][0].event_attr.mmap_data == 1;
}
+void EventSelectionSet::WakeupPerSample() {
+ for (auto& group : groups_) {
+ for (auto& selection : group) {
+ selection.event_attr.watermark = 0;
+ selection.event_attr.wakeup_events = 1;
+ }
+ }
+}
+
bool EventSelectionSet::SetTracepointFilter(const std::string& filter) {
// 1. Find the tracepoint event to set filter.
EventSelection* selection = nullptr;