OSDN Git Service

simpleperf: fix check of opening perf event files.
authorYabin Cui <yabinc@google.com>
Fri, 25 Aug 2017 18:17:45 +0000 (11:17 -0700)
committerElliott Hughes <enh@google.com>
Mon, 28 Aug 2017 19:07:10 +0000 (19:07 +0000)
commit16006b9403d4e26f56d6492e0fa99b483e5dac31
tree3f1932b819342d8a1b99297aeefdc8aea709ab10
parenteb29dced7182d4fc955fd380ba97c67f8285e5b0
simpleperf: fix check of opening perf event files.

When asked to monitor a process, record/stat cmd checks if we can
open perf event files for all threads successfully. However, it
fails when the monitored process has an exiting thread. This makes
record_cmd.duration_option test flakey, when there are exiting
threads in other tests, like record_cmd.handle_SIGHUP.

To fix this, only check if we can open perf event files for at
least one thread for each monitored process.

Bug: http://b/65047463
Bug: 64709603 (presubmit balking at the line above)
Test: run CtsSimpleperfTestCases.
Change-Id: Ia02ed498f49c9c6c452023ad31abb01a58071152
(cherry picked from commit b3ae56e485b4d971a909a8b04da65713a3d56872)
simpleperf/event_selection_set.cpp