summaryrefslogtreecommitdiff
path: root/simpleperf/cmd_stat_test.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2015-10-26 16:15:29 -0700
committerYabin Cui <yabinc@google.com>2015-10-30 12:08:08 -0700
commitcb4c17ea53269ced994a2d849cbafb1afd5296e1 (patch)
tree167b3af4203bc2f74d8a49d986522e47d89f44c5 /simpleperf/cmd_stat_test.cpp
parentc5ca81d0d4adc1da4325a89dc958b515691a4e0d (diff)
downloadextras-cb4c17ea53269ced994a2d849cbafb1afd5296e1.tar.gz
simpleperf: support --cpu option in record/stat command.
--cpu option is used to record on selected cpus. Change-Id: If5bb9b42a064d2ff69fbeec77906fc79943dddc1
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 c6c4ef74..8de50fc0 100644
--- a/simpleperf/cmd_stat_test.cpp
+++ b/simpleperf/cmd_stat_test.cpp
@@ -69,3 +69,8 @@ TEST(stat_cmd, existing_threads) {
TEST(stat_cmd, no_monitored_threads) {
ASSERT_FALSE(StatCmd()->Run({""}));
}
+
+TEST(stat_cmd, cpu_option) {
+ ASSERT_TRUE(StatCmd()->Run({"--cpu", "0", "sleep", "1"}));
+ ASSERT_TRUE(StatCmd()->Run({"--cpu", "0", "-a", "sleep", "1"}));
+}