OSDN Git Service

simpleperf: fix tests in cloud android.
authorYabin Cui <yabinc@google.com>
Mon, 27 Jan 2020 21:59:24 +0000 (13:59 -0800)
committerYabin Cui <yabinc@google.com>
Tue, 28 Jan 2020 00:21:38 +0000 (16:21 -0800)
commit538fb5374333a6c4dbf3bf73d6a119621f67f802
tree4f2c56a4a59dcea475ebed378f565f1b600d4de1
parent0dddb15f6730dcdfdcce5c6630013a8b28393f7e
simpleperf: fix tests in cloud android.

Cloud android uses x86 cuttlefish without hardware counters and
tracepoint events.
Fix simpleperf tests before adding them to presubmit check:
 1. In HasHardwareCounter(), mark cf_x86 platform as not having
hardware counters. So tests needing hardware counters will be
skipped on cloud android.
 2. Modify most record_cmd tests to not requiring hardware
counters, and use task-clock instead of cpu-cycles when hardware
counters are not available.
 3. Skip tests needing tracepoint events on cloud android.

Bug: none
Test: run simpleperf_unit_tests on cuttlefish.
Change-Id: Id776b86a1248d4ac80ae96e308520f3a41a54184
simpleperf/cmd_record_test.cpp
simpleperf/event_selection_set.cpp
simpleperf/test_util.h