summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2019-12-20 20:51:51 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-12-20 20:51:51 +0000
commit0b0c2c9862ee4ea07cb3b8923e84cc568f77036a (patch)
treea6f21793acac39b29b5daa012065e9db3fe1ff5e
parentf556af4808189ea82c3a12f9e0615a3acbc5ff01 (diff)
parentccd6aa0eb7c0fa1040a6318ac36da160d59a9549 (diff)
downloadextras-0b0c2c9862ee4ea07cb3b8923e84cc568f77036a.tar.gz
Merge "simpleperf: fix pmu event tests."
-rw-r--r--simpleperf/cmd_list.cpp1
-rw-r--r--simpleperf/cmd_list_test.cpp3
-rw-r--r--simpleperf/cmd_record_test.cpp1
-rw-r--r--simpleperf/cmd_stat_test.cpp1
4 files changed, 4 insertions, 2 deletions
diff --git a/simpleperf/cmd_list.cpp b/simpleperf/cmd_list.cpp
index a15127be..4ac333e4 100644
--- a/simpleperf/cmd_list.cpp
+++ b/simpleperf/cmd_list.cpp
@@ -156,6 +156,7 @@ bool ListCommand::Run(const std::vector<std::string>& args) {
{"tracepoint", {PERF_TYPE_TRACEPOINT, "tracepoint events"}},
{"user-space-sampler", {SIMPLEPERF_TYPE_USER_SPACE_SAMPLERS, "user-space samplers"}},
{"cs-etm", {-1, "coresight etm events"}},
+ {"pmu", {SIMPLEPERF_TYPE_PMU, "pmu events"}}
};
std::vector<std::string> names;
diff --git a/simpleperf/cmd_list_test.cpp b/simpleperf/cmd_list_test.cpp
index 79c6ea90..6712b0a4 100644
--- a/simpleperf/cmd_list_test.cpp
+++ b/simpleperf/cmd_list_test.cpp
@@ -46,6 +46,5 @@ TEST_F(ListCommandTest, show_features_option) {
}
TEST_F(ListCommandTest, pmu_option) {
- TEST_REQUIRE_PMU_COUNTER();
- TEST_IN_ROOT(ASSERT_TRUE(list_cmd->Run({"pmu"})));
+ ASSERT_TRUE(list_cmd->Run({"pmu"}));
}
diff --git a/simpleperf/cmd_record_test.cpp b/simpleperf/cmd_record_test.cpp
index 40939927..5f96ebf5 100644
--- a/simpleperf/cmd_record_test.cpp
+++ b/simpleperf/cmd_record_test.cpp
@@ -995,6 +995,7 @@ TEST(record_cmd, include_filter_option) {
TEST(record_cmd, pmu_event_option) {
TEST_REQUIRE_PMU_COUNTER();
+ TEST_REQUIRE_HW_COUNTER();
std::string event_string;
if (GetBuildArch() == ARCH_X86_64) {
event_string = "cpu/cpu-cycles/";
diff --git a/simpleperf/cmd_stat_test.cpp b/simpleperf/cmd_stat_test.cpp
index 7b66ce5b..11edde17 100644
--- a/simpleperf/cmd_stat_test.cpp
+++ b/simpleperf/cmd_stat_test.cpp
@@ -73,6 +73,7 @@ TEST(stat_cmd, rN_event) {
TEST(stat_cmd, pmu_event) {
TEST_REQUIRE_PMU_COUNTER();
+ TEST_REQUIRE_HW_COUNTER();
std::string event_string;
if (GetBuildArch() == ARCH_X86_64) {
event_string = "cpu/instructions/";