summaryrefslogtreecommitdiff
path: root/simpleperf/cmd_stat_test.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2016-03-31 14:39:19 -0700
committerYabin Cui <yabinc@google.com>2016-04-01 10:54:47 -0700
commit4b6720d137c15b9485318255e89ffcd3c76ab579 (patch)
tree4c624d63da960690396c0c9e8d03d9fb84d96443 /simpleperf/cmd_stat_test.cpp
parenteaa9c1dc0c2c7bd4570e0b7c605bac207e6ab3a3 (diff)
downloadextras-4b6720d137c15b9485318255e89ffcd3c76ab579.tar.gz
simpleperf: loosen unwinding arch check for system wide collection.
When doing system wide collection, it is possible that there are 32-bit compat processes running on 64-bit devices. It is not proper to abort in this situation. So loosen the check to allow it. Also add corresponding test. Bug: 27927427 Change-Id: I5c9253eb6e474497e4f37e234e0e523e141fab20
Diffstat (limited to 'simpleperf/cmd_stat_test.cpp')
-rw-r--r--simpleperf/cmd_stat_test.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/simpleperf/cmd_stat_test.cpp b/simpleperf/cmd_stat_test.cpp
index 27f1f091..1935b5fe 100644
--- a/simpleperf/cmd_stat_test.cpp
+++ b/simpleperf/cmd_stat_test.cpp
@@ -35,9 +35,7 @@ TEST(stat_cmd, event_option) {
}
TEST(stat_cmd, system_wide_option) {
- if (IsRoot()) {
- ASSERT_TRUE(StatCmd()->Run({"-a", "sleep", "1"}));
- }
+ TEST_IN_ROOT(ASSERT_TRUE(StatCmd()->Run({"-a", "sleep", "1"})));
}
TEST(stat_cmd, verbose_option) {
@@ -45,9 +43,7 @@ TEST(stat_cmd, verbose_option) {
}
TEST(stat_cmd, tracepoint_event) {
- if (IsRoot()) {
- ASSERT_TRUE(StatCmd()->Run({"-a", "-e", "sched:sched_switch", "sleep", "1"}));
- }
+ TEST_IN_ROOT(ASSERT_TRUE(StatCmd()->Run({"-a", "-e", "sched:sched_switch", "sleep", "1"})));
}
TEST(stat_cmd, event_modifier) {
@@ -87,7 +83,5 @@ TEST(stat_cmd, no_monitored_threads) {
TEST(stat_cmd, cpu_option) {
ASSERT_TRUE(StatCmd()->Run({"--cpu", "0", "sleep", "1"}));
- if (IsRoot()) {
- ASSERT_TRUE(StatCmd()->Run({"--cpu", "0", "-a", "sleep", "1"}));
- }
+ TEST_IN_ROOT(ASSERT_TRUE(StatCmd()->Run({"--cpu", "0", "-a", "sleep", "1"})));
}