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)
committerYabin Cui <yabinc@google.com>
Fri, 25 Aug 2017 18:17:45 +0000 (11:17 -0700)
commitb3ae56e485b4d971a909a8b04da65713a3d56872
tree56681c39830852d7b370c1934717bc40e3ac6285
parentc7d0f96ab46fef789bbdddfa4fc6d8ea95ba003b
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
Test: run CtsSimpleperfTestCases.
Change-Id: Ia02ed498f49c9c6c452023ad31abb01a58071152
simpleperf/event_selection_set.cpp