diff options
author | Yabin Cui <yabinc@google.com> | 2019-08-12 16:53:46 -0700 |
---|---|---|
committer | Yabin Cui <yabinc@google.com> | 2019-08-20 14:47:30 -0700 |
commit | 52f32a45cade2f23b13532e253b203b4a21a4017 (patch) | |
tree | ee1ab7a834443e172f346c6d5e2efb5411876606 /simpleperf/cmd_stat_test.cpp | |
parent | c0dabf28cad04993dd7bf8184af71f3230afa64f (diff) | |
download | extras-52f32a45cade2f23b13532e253b203b4a21a4017.tar.gz |
simpleperf: add --use-devfreq-counters option.
On devices like pixel 3, there are 7 hardware counters in cpu pmu.
But 4 of them are used by devfreq to monitor memory latency.
In case we need more than 3 counters, add an option to let devfreq
release counters.
Also add a warning of using this option if it seems we need more
counters.
Bug: none
Test: run simpleperf_unit_test.
Change-Id: I9a13716a8b64c8e0fc03a79b0c11dd29da169c56
Diffstat (limited to 'simpleperf/cmd_stat_test.cpp')
-rw-r--r-- | simpleperf/cmd_stat_test.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/simpleperf/cmd_stat_test.cpp b/simpleperf/cmd_stat_test.cpp index ecc7404e..3668cb91 100644 --- a/simpleperf/cmd_stat_test.cpp +++ b/simpleperf/cmd_stat_test.cpp @@ -303,3 +303,11 @@ TEST(stat_cmd, app_option_for_profileable_app) { TEST_REQUIRE_APPS(); TestStatingApps("com.android.simpleperf.profileable"); } + +TEST(stat_cmd, use_devfreq_counters_option) { +#if defined(__ANDROID__) + TEST_IN_ROOT(StatCmd()->Run({"--use-devfreq-counters", "sleep", "0.1"})); +#else + GTEST_LOG_(INFO) << "This test tests an option only available on Android."; +#endif +} |