From a047116523a4b702af5a0b852c80527e6e475354 Mon Sep 17 00:00:00 2001 From: wenlong12 Date: Thu, 31 Mar 2022 14:39:16 +0800 Subject: [PATCH 1/2] fix ut test failed issue Signed-off-by: wenlong12 Signed-off-by: wenlong12 --- include/perf_events.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/perf_events.h b/include/perf_events.h index e85c311..82e2f78 100644 --- a/include/perf_events.h +++ b/include/perf_events.h @@ -228,7 +228,7 @@ public: static constexpr uint64_t DEFAULT_SAMPLE_PERIOD = 1; static constexpr uint64_t DEFAULT_TIMEOUT = 10 * 1000; static constexpr size_t MIN_BUFFER_SIZE = 64 * 1024 * 1024; - static constexpr size_t MAX_BUFFER_SIZE = 256 * 1024 * 1024; + static constexpr size_t MAX_BUFFER_SIZE = 128 * 1024 * 1024; static constexpr size_t BUFFER_LOW_LEVEL = 10 * 1024 * 1024; static constexpr size_t BUFFER_CRITICAL_LEVEL = 5 * 1024 * 1024; -- Gitee From be9c18cb315411317504d752e7fad54fabbec1d5 Mon Sep 17 00:00:00 2001 From: wenlong12 Date: Thu, 31 Mar 2022 14:39:16 +0800 Subject: [PATCH 2/2] fix ut test failed issue Signed-off-by: wenlong12 Signed-off-by: wenlong12 --- include/perf_events.h | 2 +- .../common/native/subcommand_record_test.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/perf_events.h b/include/perf_events.h index e85c311..82e2f78 100644 --- a/include/perf_events.h +++ b/include/perf_events.h @@ -228,7 +228,7 @@ public: static constexpr uint64_t DEFAULT_SAMPLE_PERIOD = 1; static constexpr uint64_t DEFAULT_TIMEOUT = 10 * 1000; static constexpr size_t MIN_BUFFER_SIZE = 64 * 1024 * 1024; - static constexpr size_t MAX_BUFFER_SIZE = 256 * 1024 * 1024; + static constexpr size_t MAX_BUFFER_SIZE = 128 * 1024 * 1024; static constexpr size_t BUFFER_LOW_LEVEL = 10 * 1024 * 1024; static constexpr size_t BUFFER_CRITICAL_LEVEL = 5 * 1024 * 1024; diff --git a/test/unittest/common/native/subcommand_record_test.cpp b/test/unittest/common/native/subcommand_record_test.cpp index 03edc0d..d149818 100644 --- a/test/unittest/common/native/subcommand_record_test.cpp +++ b/test/unittest/common/native/subcommand_record_test.cpp @@ -129,6 +129,18 @@ HWTEST_F(SubCommandRecordTest, StopSecondsMaxErr, TestSize.Level1) TestRecordCommand(opt, false); } +// system wide +HWTEST_F(SubCommandRecordTest, SystemWide, TestSize.Level1) +{ + TestRecordCommand("-d 2 -a ", true, false); +} + +// exclude hiperf +HWTEST_F(SubCommandRecordTest, ExcludePerf, TestSize.Level1) +{ + TestRecordCommand("-d 2 -a --exclude-hiperf ", true, false); +} + // select cpu HWTEST_F(SubCommandRecordTest, SelectCpu, TestSize.Level1) { -- Gitee