From 4f2afb18d6b29962986a36a8a97c8a4a956eeac3 Mon Sep 17 00:00:00 2001 From: buzhenwang Date: Tue, 5 Aug 2025 20:01:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=8F=E6=84=9F=E8=AF=8D=E6=8E=92=E6=9F=A5?= =?UTF-8?q?=20Signed-off-by:leiguangyu=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: buzhenwang --- demo/cpp/hiperf_demo.cpp | 4 ++-- script/testModule/test_01_command_script.py | 2 +- src/virtual_runtime.cpp | 3 --- test/unittest/common/native/cpu_usage_test.cpp | 4 ++-- test/unittest/common/native/hiperf_client_test.cpp | 4 ++-- test/unittest/common/native/spe_decoder_test.cpp | 4 ++-- test/unittest/common/native/subcommand_record_test.cpp | 8 ++++---- test/unittest/common/native/subcommand_stat_test.cpp | 4 ++-- test/unittest/common/native/utilities_test.cpp | 4 ++-- 9 files changed, 17 insertions(+), 20 deletions(-) diff --git a/demo/cpp/hiperf_demo.cpp b/demo/cpp/hiperf_demo.cpp index 6dc9b98..eed836f 100644 --- a/demo/cpp/hiperf_demo.cpp +++ b/demo/cpp/hiperf_demo.cpp @@ -21,9 +21,9 @@ using namespace OHOS::Developtools::HiPerf; #if defined(__aarch64__) -static const std::string TEST_PROCESSES = "com.ohos.sceneboard"; -#else static const std::string TEST_PROCESSES = "com.ohos.launcher"; +#else +static const std::string TEST_PROCESSES = "hiview"; #endif namespace HiperfClientDemo { diff --git a/script/testModule/test_01_command_script.py b/script/testModule/test_01_command_script.py index a04af53..e32d9e3 100644 --- a/script/testModule/test_01_command_script.py +++ b/script/testModule/test_01_command_script.py @@ -91,7 +91,7 @@ def parser_add_argument(): other_group.add_argument('--not_hdc_root', action='store_true', help="""Force hdc to run in non root mode. """) args = parser.parse_args() - args.package_name = 'com.ohos.sceneboard' + args.package_name = 'hiview' return args diff --git a/src/virtual_runtime.cpp b/src/virtual_runtime.cpp index 6128a17..eb0a2a4 100644 --- a/src/virtual_runtime.cpp +++ b/src/virtual_runtime.cpp @@ -931,9 +931,6 @@ void VirtualRuntime::UpdateSymbols(std::shared_ptr map, pid_t pid) * seg2 /data/storage/el1/bundle/entry.hap r-xp ELF * seg3 /data/storage/el1/bundle/entry.hap r--p ABC * seg4 /data/storage/el1/bundle/entry.hap r--p ABC - * seg1 /system/app/SceneBoard/SceneBoard.hap r--p ABC - * seg2 /system/app/SceneBoard/SceneBoard.hap r--p ABC - * seg3 /system/app/SceneBoard/SceneBoard.hap r--p ABC * segN .hap r--p .an/jit/etc * 1.map.name == symbolsFile.filePath_ * 2.map.FileType == symbolsFiles_[map.symbolFileIndex] diff --git a/test/unittest/common/native/cpu_usage_test.cpp b/test/unittest/common/native/cpu_usage_test.cpp index d22fc6a..74717e1 100644 --- a/test/unittest/common/native/cpu_usage_test.cpp +++ b/test/unittest/common/native/cpu_usage_test.cpp @@ -43,7 +43,7 @@ public: void TestCpuUsage(const std::string &option, unsigned int expect, bool fixPid); - std::string testProcesses = "com.ohos.sceneboard"; + std::string testProcesses = "com.ohos.launcher"; }; void CpuUsageTest::SetUpTestCase() {} @@ -53,7 +53,7 @@ void CpuUsageTest::TearDownTestCase() {} void CpuUsageTest::SetUp() { if (!HiPerf::CheckTestApp(testProcesses)) { - testProcesses = "com.ohos.launcher"; + testProcesses = "hiview"; } } diff --git a/test/unittest/common/native/hiperf_client_test.cpp b/test/unittest/common/native/hiperf_client_test.cpp index 2b05b84..26f8910 100644 --- a/test/unittest/common/native/hiperf_client_test.cpp +++ b/test/unittest/common/native/hiperf_client_test.cpp @@ -426,9 +426,9 @@ HWTEST_F(HiperfClientTest, SetDataLimit, TestSize.Level2) HWTEST_F(HiperfClientTest, SetAppPackage, TestSize.Level0) { HiperfClient::RecordOption opt; - std::string testProcesses = "com.ohos.sceneboard"; + std::string testProcesses = "com.ohos.launcher"; if (!CheckTestApp(testProcesses)) { - testProcesses = "com.ohos.launcher"; + testProcesses = "hiview"; } opt.SetAppPackage(testProcesses); diff --git a/test/unittest/common/native/spe_decoder_test.cpp b/test/unittest/common/native/spe_decoder_test.cpp index b31f3b4..4360ae5 100644 --- a/test/unittest/common/native/spe_decoder_test.cpp +++ b/test/unittest/common/native/spe_decoder_test.cpp @@ -93,9 +93,9 @@ HWTEST_F(SpeDecoderTest, TestGetSpeEventNameByType, TestSize.Level1) HWTEST_F(SpeDecoderTest, TestRecord, TestSize.Level0) { StdoutRecord stdoutRecord; - std::string testProcesses = "com.ohos.sceneboard"; + std::string testProcesses = "com.ohos.launcher"; if (!CheckTestApp(testProcesses)) { - testProcesses = "com.ohos.launcher"; + testProcesses = "hiview"; } std::string cmdString = "record -e arm_spe_0/load_filter=1,min_latency=100/ -d 10 --app "; cmdString += " " + testProcesses; diff --git a/test/unittest/common/native/subcommand_record_test.cpp b/test/unittest/common/native/subcommand_record_test.cpp index db55df8..3b6196a 100644 --- a/test/unittest/common/native/subcommand_record_test.cpp +++ b/test/unittest/common/native/subcommand_record_test.cpp @@ -69,7 +69,7 @@ public: static std::string testProcesses; }; -std::string SubCommandRecordTest::testProcesses = "com.ohos.sceneboard"; +std::string SubCommandRecordTest::testProcesses = "com.ohos.launcher"; void SubCommandRecordTest::SetUpTestCase() {} @@ -78,7 +78,7 @@ void SubCommandRecordTest::TearDownTestCase() {} void SubCommandRecordTest::SetUp() { if (!CheckTestApp(SubCommandRecordTest::testProcesses)) { - SubCommandRecordTest::testProcesses = "com.ohos.launcher"; + SubCommandRecordTest::testProcesses = "hiview"; } SubCommand::ClearSubCommands(); // clear the subCommands left from other UT ASSERT_EQ(SubCommand::GetSubCommands().size(), 0u); @@ -223,7 +223,7 @@ bool CheckJsonReport(const std::string& fileName, const std::string& symbolsFile bool find = false; for (int i = 0; i < size; i++) { auto item = cJSON_GetArrayItem(list, i); - if (SubCommandRecordTest::testProcesses == item->valuestring) { + if (std::string(item->valuestring).find(SubCommandRecordTest::testProcesses) != std::string::npos) { find = true; break; } @@ -1868,7 +1868,7 @@ HWTEST_F(SubCommandRecordTest, ChecKernel, TestSize.Level1) */ HWTEST_F(SubCommandRecordTest, RecordAndReport, TestSize.Level1) { - const std::string cmd = "hiperf record -d 5 --app " + + const std::string cmd = "hiperf record -d 5 -s dwarf --app " + SubCommandRecordTest::testProcesses + " -o /data/local/tmp/perf.data"; EXPECT_EQ(CheckTraceCommandOutput(cmd, {"Process and Saving data..."}), true); diff --git a/test/unittest/common/native/subcommand_stat_test.cpp b/test/unittest/common/native/subcommand_stat_test.cpp index 3360a72..c87c083 100644 --- a/test/unittest/common/native/subcommand_stat_test.cpp +++ b/test/unittest/common/native/subcommand_stat_test.cpp @@ -2441,9 +2441,9 @@ HWTEST_F(SubCommandStatTest, TestOnSubCommand_control04, TestSize.Level1) HWTEST_F(SubCommandStatTest, TestOnSubCommand_control05, TestSize.Level1) { ASSERT_TRUE(RemoveFile(TEST_FILE)); - std::string testProcesses = "com.ohos.sceneboard"; + std::string testProcesses = "com.ohos.launcher"; if (!CheckTestApp(testProcesses)) { - testProcesses = "com.ohos.launcher"; + testProcesses = "hiview"; } std::string testCmd = "hiperf stat --control prepare --app " + testProcesses + " --restart"; const int waitSeconds = 30; // app restart need 30s diff --git a/test/unittest/common/native/utilities_test.cpp b/test/unittest/common/native/utilities_test.cpp index f442aac..10c1688 100644 --- a/test/unittest/common/native/utilities_test.cpp +++ b/test/unittest/common/native/utilities_test.cpp @@ -1009,9 +1009,9 @@ HWTEST_F(UtilitiesTest, IsNumeric_Invalid_WithAlpha, TestSize.Level1) */ HWTEST_F(UtilitiesTest, IsDebugableApp, TestSize.Level1) { - std::string testProcesses = "com.ohos.sceneboard"; + std::string testProcesses = "com.ohos.launcher"; if (!CheckTestApp(testProcesses)) { - testProcesses = "com.ohos.launcher"; + testProcesses = "hiview"; } EXPECT_FALSE(IsDebugableApp(testProcesses)); } -- Gitee