diff options
author | Yabin Cui <yabinc@google.com> | 2020-11-12 10:14:21 -0800 |
---|---|---|
committer | Yabin Cui <yabinc@google.com> | 2020-11-12 10:24:31 -0800 |
commit | 2cb6c168e6539d9b057ec14d29a8588379cba53a (patch) | |
tree | 8ad7f2cf7a20da551f8f271d7eeed8341b533f06 /simpleperf/event_selection_set.cpp | |
parent | 769c2b61d5feeafb84b2ed7f436cc0a07b77b64b (diff) | |
download | extras-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.cpp | 9 |
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; |