summaryrefslogtreecommitdiff
path: root/simpleperf/cmd_stat_test.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2020-01-10 15:33:11 -0800
committerYabin Cui <yabinc@google.com>2020-01-21 17:30:14 -0800
commitdc2708c996f42edd7fcb81bf06776ea7b7412725 (patch)
tree928bf92176d29c95b720d1d12cec1b856473c7cf /simpleperf/cmd_stat_test.cpp
parent47bdf26065a8ca17c908aa4b825b306cd3cae020 (diff)
downloadextras-dc2708c996f42edd7fcb81bf06776ea7b7412725.tar.gz
simpleperf: add --per-thread option to stat cmd.
It shows event count for each thread. Bug: 146220391 Test: run simpleperf_unit_test. Change-Id: I6346b787eb630c49631e477d0e83bf1901a9f2b3
Diffstat (limited to 'simpleperf/cmd_stat_test.cpp')
-rw-r--r--simpleperf/cmd_stat_test.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/simpleperf/cmd_stat_test.cpp b/simpleperf/cmd_stat_test.cpp
index 11edde17..7a95fdf0 100644
--- a/simpleperf/cmd_stat_test.cpp
+++ b/simpleperf/cmd_stat_test.cpp
@@ -327,3 +327,8 @@ TEST(stat_cmd, use_devfreq_counters_option) {
GTEST_LOG_(INFO) << "This test tests an option only available on Android.";
#endif
}
+
+TEST(stat_cmd, per_thread_option) {
+ ASSERT_TRUE(StatCmd()->Run({"--per-thread", "sleep", "0.1"}));
+ TEST_IN_ROOT(StatCmd()->Run({"--per-thread", "-a", "--duration", "0.1"}));
+}