summaryrefslogtreecommitdiff
path: root/simpleperf/cmd_report_test.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2016-09-29 15:59:33 -0700
committerYabin Cui <yabinc@google.com>2016-10-19 17:36:54 -0700
commitc0565bb21e2997d7a01dda40ea2b16e067e7e28c (patch)
tree67eb9dee47c8b11539d27e3053b7fd34109200a5 /simpleperf/cmd_report_test.cpp
parentc9ff61e5f456f229731e0092cbcb6ea3020a933e (diff)
downloadextras-c0565bb21e2997d7a01dda40ea2b16e067e7e28c.tar.gz
Simpleperf: add --max-stack and --percent-limit options for report cmd.
Bug: http://b/24905115 Test: run simpleperf-unit-test. Change-Id: I177f618f923f90069c0380063f0c3f93427dedd7
Diffstat (limited to 'simpleperf/cmd_report_test.cpp')
-rw-r--r--simpleperf/cmd_report_test.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/simpleperf/cmd_report_test.cpp b/simpleperf/cmd_report_test.cpp
index 704076a4..e00b5ee6 100644
--- a/simpleperf/cmd_report_test.cpp
+++ b/simpleperf/cmd_report_test.cpp
@@ -415,6 +415,28 @@ TEST_F(ReportCommandTest, report_data_generated_by_linux_perf) {
ASSERT_TRUE(success);
}
+TEST_F(ReportCommandTest, max_stack_and_percent_limit_option) {
+ Report(PERF_DATA_MAX_STACK_AND_PERCENT_LIMIT, {"-g"});
+ ASSERT_TRUE(success);
+ ASSERT_NE(content.find("89.03"), std::string::npos);
+
+ Report(PERF_DATA_MAX_STACK_AND_PERCENT_LIMIT, {"-g", "--max-stack", "0"});
+ ASSERT_TRUE(success);
+ ASSERT_EQ(content.find("89.03"), std::string::npos);
+ Report(PERF_DATA_MAX_STACK_AND_PERCENT_LIMIT, {"-g", "--max-stack", "1"});
+ ASSERT_TRUE(success);
+ ASSERT_NE(content.find("89.03"), std::string::npos);
+
+ Report(PERF_DATA_MAX_STACK_AND_PERCENT_LIMIT,
+ {"-g", "--percent-limit", "90"});
+ ASSERT_TRUE(success);
+ ASSERT_EQ(content.find("89.03"), std::string::npos);
+ Report(PERF_DATA_MAX_STACK_AND_PERCENT_LIMIT,
+ {"-g", "--percent-limit", "70"});
+ ASSERT_TRUE(success);
+ ASSERT_NE(content.find("89.03"), std::string::npos);
+}
+
#if defined(__linux__)
#include "event_selection_set.h"