From a5effb9af5de3e07d9eef20b97a741dac441510e Mon Sep 17 00:00:00 2001 From: jichuan Date: Thu, 13 Jul 2023 11:03:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?Fix:=E5=88=A0=E9=99=A4=E5=86=97=E4=BD=99?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: jichuan --- .../base-ui/chart/pie/LitChartPie.test.ts | 22 +---- .../component/trace/base/TraceRow.test.ts | 8 -- .../TabPaneIOTierStatistics.test.ts | 94 +++++++++---------- 3 files changed, 48 insertions(+), 76 deletions(-) diff --git a/ide/test/base-ui/chart/pie/LitChartPie.test.ts b/ide/test/base-ui/chart/pie/LitChartPie.test.ts index 1e580fde..6b727e11 100644 --- a/ide/test/base-ui/chart/pie/LitChartPie.test.ts +++ b/ide/test/base-ui/chart/pie/LitChartPie.test.ts @@ -34,9 +34,9 @@ beforeAll(() => { jest.spyOn(document.documentElement, 'scrollTop', 'get').mockImplementation(() => fakeWindow.scrollTop); }); -window.ResizeObserver = - window.ResizeObserver || - jest.fn().mockImplementation(() => ({ +window.ResizeObserver + = window.ResizeObserver + || jest.fn().mockImplementation(() => ({ disconnect: jest.fn(), observe: jest.fn(), unobserve: jest.fn(), @@ -48,17 +48,6 @@ describe('litChartPie Test', () => { expect(litChartPie).not.toBeUndefined(); }); - // it('litChartPieTest02', function () { - // document.body.innerHTML = ` - //
- // - //
`; - // let clo = document.getElementById('chart-pie') as LitChartPie; - // let mouseMoveEvent: MouseEvent = new MouseEvent('mousemove', { movementX: 1, movementY: 2 }); - // // this.cfg!.hoverHandler - // clo.canvas.dispatchEvent(mouseMoveEvent); - // }); - it('litChartPieTest03', function () { Utils.uuid = jest.fn(() => { return Math.floor(Math.random() * 10 + 1); @@ -364,11 +353,6 @@ describe('litChartPie Test', () => { let mouseOutEvent: MouseEvent = new MouseEvent('mouseout', { movementX: 1, movementY: 2 }); clo.canvas.dispatchEvent(mouseOutEvent); expect(clo.config).not.toBeUndefined(); - // clo.dataSource = [ - // {pid:1, pName:"1", tid:1, tName:"11", total:12, size:"big core",timeStr:'11'}, - // {pid:2, pName:"2", tid:2, tName: "222", total:13, size:"big core",timeStr:'22'} - // ] - // expect(clo.data[0].obj.pid).toBe(2) }); it('litChartPieTest05', function () { diff --git a/ide/test/trace/component/trace/base/TraceRow.test.ts b/ide/test/trace/component/trace/base/TraceRow.test.ts index 969613bd..4a5f8a21 100644 --- a/ide/test/trace/component/trace/base/TraceRow.test.ts +++ b/ide/test/trace/component/trace/base/TraceRow.test.ts @@ -284,17 +284,9 @@ describe('TraceRow Test', () => { }); it('TraceRow Test25', () => { - // let traceRow = new TraceRow({canvasNumber:1,alpha: true, contextId: '2d', isOffScreen: true}); - // traceRow.expansion = false; - // expect(traceRow.expansion).toBeFalsy(); }); it('TraceRow Test26', () => { - // let traceRow = new TraceRow({canvasNumber:1,alpha: true, contextId: '2d', isOffScreen: true}); - // traceRow.parentNode = jest.fn(()=>true); - // traceRow.parentNode.lastChild = jest.fn(()=>true); - // traceRow.expansion = true; - // expect(traceRow.expansion).toBeTruthy(); }); it('TraceRow Test27', () => { diff --git a/ide/test/trace/component/trace/sheet/file-system/TabPaneIOTierStatistics.test.ts b/ide/test/trace/component/trace/sheet/file-system/TabPaneIOTierStatistics.test.ts index 54489d3f..51e810be 100644 --- a/ide/test/trace/component/trace/sheet/file-system/TabPaneIOTierStatistics.test.ts +++ b/ide/test/trace/component/trace/sheet/file-system/TabPaneIOTierStatistics.test.ts @@ -22,19 +22,15 @@ import crypto from 'crypto'; // @ts-ignore import { TabPaneFilter } from '../../../../../../dist/trace/component/trace/sheet/TabPaneFilter.js'; // @ts-ignore -import {getTabPaneIOTierStatisticsData} from "../../../../../../dist/trace/database/SqlLite.js"; +import {getTabPaneIOTierStatisticsData} from '../../../../../../dist/trace/database/SqlLite.js'; // @ts-ignore -window.ResizeObserver = - window.ResizeObserver || - jest.fn().mockImplementation(() => ({ +window.ResizeObserver + = window.ResizeObserver + || jest.fn().mockImplementation(() => ({ disconnect: jest.fn(), observe: jest.fn(), unobserve: jest.fn(), })); -// -// jest.mock('../../../../../../dist/base-ui/table/lit-table.js', () => { -// return {}; -// }); const sqlit = require('../../../../../../dist/trace/database/SqlLite.js'); jest.mock('../../../../../../dist/trace/database/SqlLite.js'); @@ -46,7 +42,7 @@ Object.defineProperty(global.self, 'crypto', { }); describe('TabPaneIOTierStatistics Test', () => { - document.body.innerHTML = ``; + document.body.innerHTML = ''; let tabPane = document.querySelector('#io-tier-statistics'); let param = { @@ -97,52 +93,52 @@ describe('TabPaneIOTierStatistics Test', () => { let queryResult = sqlit.getTabPaneIOTierStatisticsData; queryResult.mockResolvedValue([ { - "pid": 186, - "pname": "kworker/u8:4", - "tier": 0, - "ipid": 2, - "path": "-", - "count": 3, - "allDuration": 19543418, - "minDuration": 6408209, - "maxDuration": 6668084, - "avgDuration": 6514472.66666667 + 'pid': 186, + 'pname': 'kworker/u8:4', + 'tier': 0, + 'ipid': 2, + 'path': '-', + 'count': 3, + 'allDuration': 19543418, + 'minDuration': 6408209, + 'maxDuration': 6668084, + 'avgDuration': 6514472.66666667 }, { - "pid": 186, - "pname": "kworker/u8:4", - "tier": 0, - "ipid": 2, - "path": "/data/thermal/config/configLevel", - "count": 1, - "allDuration": 5916167, - "minDuration": 5916167, - "maxDuration": 5916167, - "avgDuration": 5916167 + 'pid': 186, + 'pname': 'kworker/u8:4', + 'tier': 0, + 'ipid': 2, + 'path': '/data/thermal/config/configLevel', + 'count': 1, + 'allDuration': 5916167, + 'minDuration': 5916167, + 'maxDuration': 5916167, + 'avgDuration': 5916167 }, { - "pid": 186, - "pname": "kworker/u8:4", - "tier": 0, - "ipid": 2, - "path": "/data/local/tmp/hiebpf.data", - "count": 2, - "allDuration": 9192751, - "minDuration": 2386417, - "maxDuration": 6806334, - "avgDuration": 4596375.5 + 'pid': 186, + 'pname': 'kworker/u8:4', + 'tier': 0, + 'ipid': 2, + 'path': '/data/local/tmp/hiebpf.data', + 'count': 2, + 'allDuration': 9192751, + 'minDuration': 2386417, + 'maxDuration': 6806334, + 'avgDuration': 4596375.5 }, { - "pid": 237, - "pname": "jbd2/mmcblk0p11", - "tier": 0, - "ipid": 7, - "path": "-", - "count": 7, - "allDuration": 32377630, - "minDuration": 2749251, - "maxDuration": 5033292, - "avgDuration": 4625375.71428571 + 'pid': 237, + 'pname': 'jbd2/mmcblk0p11', + 'tier': 0, + 'ipid': 7, + 'path': '-', + 'count': 7, + 'allDuration': 32377630, + 'minDuration': 2749251, + 'maxDuration': 5033292, + 'avgDuration': 4625375.71428571 } ]); tabPane.data = param; -- Gitee From c2ec2a1dd4e82306258190851e2d8fd535dec299 Mon Sep 17 00:00:00 2001 From: jichuan Date: Thu, 13 Jul 2023 11:04:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E6=94=AF=E6=8C=81=E4=B8=BB=E7=BA=BF?= =?UTF-8?q?=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: jichuan --- trace_streamer/BUILD.gn | 14 +- trace_streamer/build.sh | 16 +- trace_streamer/build/config.gni | 21 -- trace_streamer/build/protoc.sh | 10 +- trace_streamer/build/protoc_w.sh | 2 +- trace_streamer/build/ts.gni | 82 +++--- trace_streamer/build_operator.sh | 4 +- trace_streamer/gn/BUILD.gn | 3 - trace_streamer/gn/CONFIG.gn | 1 - trace_streamer/gn/toolchain/BUILD.gn | 6 +- .../prebuilts/patch_hiperf/BUILD.gn | 2 +- trace_streamer/sdk/demo_sdk/BUILD.gn | 9 - trace_streamer/sdk/dubai_sdk/BUILD.gn | 9 - trace_streamer/src/BUILD.gn | 260 +++++++++--------- trace_streamer/src/base/BUILD.gn | 20 +- trace_streamer/src/base/clock_filter.cpp | 13 +- trace_streamer/src/base/index_map.cpp | 4 +- trace_streamer/src/base/index_map.h | 5 +- trace_streamer/src/filter/BUILD.gn | 15 +- .../src/filter/app_start_filter.cpp | 23 +- trace_streamer/src/filter/frame_filter.cpp | 11 +- trace_streamer/src/filter/frame_filter.h | 1 - .../src/filter/native_hook_filter.cpp | 8 +- .../filter/offline_symbolization_filter.cpp | 4 +- trace_streamer/src/include/BUILD.gn | 4 +- trace_streamer/src/parser/BUILD.gn | 25 +- .../bytrace_parser/bytrace_event_parser.cpp | 2 +- .../src/parser/ebpf_parser/BUILD.gn | 6 +- .../ebpf_parser/bio_latency_data_parser.cpp | 2 +- .../parser/ebpf_parser/ebpf_data_reader.cpp | 13 +- .../ebpf_parser/file_system_data_parser.cpp | 2 +- .../ebpf_parser/paged_memory_data_parser.cpp | 4 +- .../src/parser/hiperf_parser/BUILD.gn | 15 +- .../parser/hiperf_parser/perf_data_parser.cpp | 6 +- .../parser/htrace_pbreader_parser/BUILD.gn | 55 ++-- .../htrace_clock_detail_parser.cpp | 14 +- .../htrace_cpu_data_parser.cpp | 1 - .../htrace_cpu_data_parser.h | 1 - .../htrace_event_parser.cpp | 7 +- .../htrace_network_parser.cpp | 2 +- .../htrace_pbreader_parser/htrace_parser.cpp | 16 +- .../htrace_pbreader_parser/htrace_parser.h | 7 - .../src/parser/print_event_parser.cpp | 9 +- trace_streamer/src/proto_reader/BUILD.gn | 6 +- .../src/proto_reader/include/data_area.h | 4 +- .../src/proto_reader/proto_reader.cpp | 6 +- .../src/proto_reader/protoc_plugin/BUILD.gn | 7 +- .../protoc_plugin/proto_reader_plugin.cpp | 1 - trace_streamer/src/protos/protos.gni | 2 +- trace_streamer/src/protos/services/BUILD.gn | 10 +- .../protos/types/plugins/agent_data/BUILD.gn | 12 +- .../types/plugins/bytrace_plugin/BUILD.gn | 14 +- .../protos/types/plugins/cpu_data/BUILD.gn | 18 +- .../protos/types/plugins/diskio_data/BUILD.gn | 18 +- .../plugins/ftrace_data/default/BUILD.gn | 18 +- .../protos/types/plugins/hidump_data/BUILD.gn | 18 +- .../protos/types/plugins/hiebpf_data/BUILD.gn | 4 + .../protos/types/plugins/hilog_data/BUILD.gn | 18 +- .../types/plugins/hiperf_call_plugin/BUILD.gn | 8 +- .../protos/types/plugins/hiperf_data/BUILD.gn | 14 +- .../types/plugins/hisysevent_data/BUILD.gn | 18 +- .../protos/types/plugins/js_memory/BUILD.gn | 18 +- .../protos/types/plugins/memory_data/BUILD.gn | 18 +- .../protos/types/plugins/native_hook/BUILD.gn | 18 +- .../types/plugins/network_data/BUILD.gn | 18 +- .../types/plugins/process_data/BUILD.gn | 18 +- .../protos/types/plugins/sample_data/BUILD.gn | 4 + .../protos/types/plugins/stream_data/BUILD.gn | 4 + .../protos/types/plugins/test_data/BUILD.gn | 8 +- trace_streamer/src/rpc/rpc_server.cpp | 2 - trace_streamer/src/table/BUILD.gn | 8 +- trace_streamer/src/table/base/BUILD.gn | 4 +- trace_streamer/src/table/ebpf/BUILD.gn | 4 +- trace_streamer/src/table/ftrace/BUILD.gn | 4 +- .../src/table/ftrace/process_table.cpp | 2 - trace_streamer/src/table/hi_sysevent/BUILD.gn | 4 +- trace_streamer/src/table/hiperf/BUILD.gn | 4 +- trace_streamer/src/table/js_memory/BUILD.gn | 4 +- trace_streamer/src/table/monitor/BUILD.gn | 4 +- trace_streamer/src/table/native_hook/BUILD.gn | 4 +- trace_streamer/src/trace_data/BUILD.gn | 4 +- .../src/trace_data/trace_data_cache.cpp | 6 - .../src/trace_data/trace_stdtype.cpp | 2 +- trace_streamer/src/trace_data/trace_stdtype.h | 11 +- .../trace_streamer/trace_streamer_filters.h | 4 - .../trace_streamer_selector.cpp | 3 - trace_streamer/test/BUILD.gn | 25 +- .../test/test_fuzzer/bytrace_fuzzer/BUILD.gn | 2 +- .../test/test_fuzzer/htrace_fuzzer/BUILD.gn | 2 +- .../test/test_fuzzer/selector_fuzzer/BUILD.gn | 2 +- trace_streamer/test/test_ts.gni | 1 - 91 files changed, 566 insertions(+), 576 deletions(-) diff --git a/trace_streamer/BUILD.gn b/trace_streamer/BUILD.gn index e1328b00..839a23f8 100644 --- a/trace_streamer/BUILD.gn +++ b/trace_streamer/BUILD.gn @@ -10,15 +10,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -if (target_os == "ohos") { - import("//build/ohos.gni") -} else { - import("build/ts.gni") -} - +import("build/ts.gni") group("trace_streamer") { - if (target_os == "ohos") { - } else if (is_test) { + if (is_test) { deps = [ "test:unittest" ] testonly = true } else if (is_fuzz) { @@ -27,7 +21,9 @@ group("trace_streamer") { } else if (is_protoc) { deps = [ "${THIRD_PARTY}/protobuf:protoc" ] } else if (is_spb) { - deps = [ "src/proto_reader/protoc_plugin:protoreader_plugin" ] + deps = [ + "src/proto_reader/protoc_plugin:protoreader_plugin(${host_toolchain})", + ] } else if (is_sdkdemo) { deps = [ "sdk/demo_sdk:trace_streamer_sdk_builtin" ] } else if (is_dubai_sdk) { diff --git a/trace_streamer/build.sh b/trace_streamer/build.sh index e1cb2f2a..1a2737ac 100755 --- a/trace_streamer/build.sh +++ b/trace_streamer/build.sh @@ -39,15 +39,19 @@ usage="Usage: $basename $0 wasm/test/fuzz/protoc debug/release/clean" ./dl_tools.sh $gn_path if { [ "$1" == "dubaisdk" ] || [ "$1" == "sdkdemo" ] || [ "$1" == "wasm" ] || [ "$1" == "test" ] || [ "$1" == "fuzz" ]; } && [ "$#" -ne 0 ];then - if [ ! -f "out/$1/clang_x64/developtools/profiler/protoc" ] && [ "$1" != "protoc" ];then + TARGET_DIR=$1 + if [[ $PARAMS == *"debug"* ]]; then + TARGET_DIR=$1"_debug" + fi + if [ ! -f "out/$TARGET_DIR/clang_x64/developtools/smartperf_host/protoc" ] && [ "$1" != "protoc" ];then ./build.sh protoc - mkdir -p out/$1/clang_x64/developtools/profiler - cp out/$target_os/clang_x64/developtools/profiler/protoc out/$1/clang_x64/developtools/profiler/protoc + mkdir -p out/$TARGET_DIR/clang_x64/developtools/smartperf_host + cp out/$target_os/clang_x64/developtools/smartperf_host/protoc out/$TARGET_DIR/clang_x64/developtools/smartperf_host/protoc fi - if [ ! -f "out/$1/clang_x64/developtools/profiler/protoreader_plugin" ] && [ "$1" != "spb" ] && [ -f "out/$1/clang_x64/developtools/profiler/protoc" ];then + if [ ! -f "out/$TARGET_DIR/clang_x64/developtools/smartperf_host/protoreader_plugin" ] && [ "$1" != "spb" ] && [ -f "out/$TARGET_DIR/clang_x64/developtools/smartperf_host/protoc" ];then ./build.sh spb - mkdir -p out/$1/clang_x64/developtools/profiler - cp out/$target_os/clang_x64/developtools/profiler/protoreader_plugin out/$1/clang_x64/developtools/profiler/protoreader_plugin + mkdir -p out/$TARGET_DIR/clang_x64/developtools/smartperf_host + cp out/$target_os/clang_x64/developtools/smartperf_host/protoreader_plugin out/$TARGET_DIR/clang_x64/developtools/smartperf_host/protoreader_plugin fi fi if [ $target_os == "windows" ];then diff --git a/trace_streamer/build/config.gni b/trace_streamer/build/config.gni index f11538dc..f287cf24 100644 --- a/trace_streamer/build/config.gni +++ b/trace_streamer/build/config.gni @@ -11,24 +11,3 @@ # See the License for the specific language governing permissions and # limitations under the License. import("ts.gni") -asdk_libs_dir="." -host_toolchain = "" -OHOS_TRACE_STREAMER_PROTOS_DIR = get_path_info("../src", "abspath") -OHOS_PROFILER_3RDPARTY_DIR = get_path_info("../third_party/", "abspath") -OHOS_PROFILER_3RDPARTY_GRPC_DIR = "${OHOS_PROFILER_3RDPARTY_DIR}/grpc" -OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR = "${OHOS_PROFILER_3RDPARTY_DIR}/protobuf" -OHOS_PROFILER_3RDPARTY_GOOGLETEST_DIR = - "${OHOS_PROFILER_3RDPARTY_DIR}/googletest" - -OHOS_PROFILER_SUBSYS_NAME = "developtools" -OHOS_PROFILER_PART_NAME = "profiler" -OHOS_PROFILER_TEST_MODULE_OUTPUT_PATH = "profiler" - -build_l2 = false -if (getenv("BUILD_L2") == "true") { - build_l2 = true -} - -declare_args() { - profiler_SmartPerf = true -} diff --git a/trace_streamer/build/protoc.sh b/trace_streamer/build/protoc.sh index 2dfdf634..7537db2c 100755 --- a/trace_streamer/build/protoc.sh +++ b/trace_streamer/build/protoc.sh @@ -14,10 +14,12 @@ set -e THIS_DIR=$(dirname ${BASH_SOURCE[0]}) -PROJECT_TOP=$(realpath $THIS_DIR/../../..) -TAIL_DIR="developtools/profiler" +PROJECT_TOP=$(realpath $THIS_DIR/../../../..) +TAIL_DIR="thirdparty/protobuf" +SUBSYS_DIR="developtools/smartperf_host" if [[ $2 == *"developtools"* ]]; then TAIL_DIR="." + SUBSYS_DIR="." PROJECT_TOP=$(realpath $THIS_DIR/..) fi OHOS_X64_OUT=$PROJECT_TOP/$2/ @@ -25,8 +27,8 @@ LIBCXX_X64_OUT=$PROJECT_TOP/$1/ndk/libcxx/linux_x86_64 SUBSYS_X64_OUT=$PROJECT_TOP/$2/$TAIL_DIR PROTOC=$PROJECT_TOP/$2/$TAIL_DIR/protoc -OPT_PLUGIN_PROTOREADER_PATH=$PROJECT_TOP/$2/$TAIL_DIR/protoreader_plugin -OPT_PLUGIN_PROTOREADER="--plugin=protoc-gen-plugin=$PROJECT_TOP/$2/$TAIL_DIR/protoreader_plugin --plugin_out=wrapper_namespace=ProtoReader" +OPT_PLUGIN_PROTOREADER_PATH=$PROJECT_TOP/$2/$SUBSYS_DIR/protoreader_plugin +OPT_PLUGIN_PROTOREADER="--plugin=protoc-gen-plugin=$PROJECT_TOP/$2/$SUBSYS_DIR/protoreader_plugin --plugin_out=wrapper_namespace=ProtoReader" OPT_OUT=--opt_out OPT_PROTOREADER_OUT=--cpp_out PYTHON_SHELL=$THIS_DIR/make_standard_proto.py # shell path diff --git a/trace_streamer/build/protoc_w.sh b/trace_streamer/build/protoc_w.sh index 6b1f6e26..ebc7a8ad 100644 --- a/trace_streamer/build/protoc_w.sh +++ b/trace_streamer/build/protoc_w.sh @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/trace_streamer/build/ts.gni b/trace_streamer/build/ts.gni index b15b9927..8c30a926 100755 --- a/trace_streamer/build/ts.gni +++ b/trace_streamer/build/ts.gni @@ -10,47 +10,23 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# import("config.gni") -if (target_os == "linux" || target_os == "macx" || target_os == "windows") { - clang_x64_folder = "." - THIRD_PARTY = "//third_party" - SRC = "//src" - PREBUILTS = "//prebuilts" - # kernel_version = "5.10.79_aarch64" - kernel_version = "." - if (target == "test") { - enable_ts_utest = true - } else { - enable_ts_utest = false +declare_args() { + profiler_SmartPerf = true + is_independent_compile = false } - device_kernel_version = "default" - is_ohos = false - PERF_DIR = "//third_party" - OHOS_TRACE_STREAMER_PROTOS_DIR = get_path_info("../src", "abspath") - OHOS_TRACE_STREAMER_DIR = get_path_info("../", "abspath") - OHOS_TRACE_STREAMER_DIR_PROTOC= get_path_info("./protoc.sh", "abspath") - - if (target_os == "windows") { - OHOS_TRACE_STREAMER_DIR_PROTOC= get_path_info("./protoc_w.sh", "abspath") - } else { - script_executable = "/usr/bin/env" - } - OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR = get_path_info("../third_party/protobuf", "abspath") +if (is_independent_compile) { + asdk_libs_dir="." + host_toolchain = "" + PERF_DIR = "//third_party" + clang_x64_folder = "." + enable_ts_utest = (target == "test") } else { - script_executable = "/usr/bin/env" - clang_x64_folder = "clang_x64" + PERF_DIR = "//developtools" with_ebpf_help_table = false - OHOS_TRACE_STREAMER_DIR = get_path_info("..", "abspath") - OHOS_TRACE_STREAMER_DIR_PROTOC= get_path_info("/protoc.sh", "abspath") - THIRD_PARTY = get_path_info("../../../../../../third_party/", "abspath") - PERF_DIR = get_path_info("../../../../../", "abspath") - SRC = "${OHOS_TRACE_STREAMER_DIR}/src" - PREBUILTS = "${OHOS_TRACE_STREAMER_DIR}/prebuilts" - target = "trace_steamer" + clang_x64_folder = "clang_x64" is_macx = false - with_perf = true is_test = false is_protoc = false is_spb = false @@ -58,12 +34,34 @@ if (target_os == "linux" || target_os == "macx" || target_os == "windows") { is_dubai_sdk = false is_sdkdemo_test = false use_wasm = false - enable_ts_utest = true - kernel_version = "." + enable_ts_utest = false is_fuzz = false - target = "trace_streamer" - is_ohos = true } -if (is_ohos) { - import("../../../../build/config.gni") -} \ No newline at end of file + +script_executable = "/usr/bin/env" +device_kernel_version = "default" +OHOS_TRACE_STREAMER_PROTOS_DIR = get_path_info("../src", "abspath") + +OHOS_TRACE_STREAMER_DIR = get_path_info("../", "abspath") +SRC = "${OHOS_TRACE_STREAMER_DIR}/src" +PREBUILTS = "//prebuilts" +THIRD_PARTY = "//third_party" +kernel_version = "." + +OHOS_TRACE_STREAMER_DIR_PROTOC= get_path_info("./protoc.sh", "abspath") + +if (target_os == "windows") { + OHOS_TRACE_STREAMER_DIR_PROTOC= get_path_info("./protoc_w.sh", "abspath") +} + +OHOS_PROFILER_3RDPARTY_GRPC_DIR = "${THIRD_PARTY}/grpc" +OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR = "${THIRD_PARTY}/protobuf" +OHOS_PROFILER_3RDPARTY_GOOGLETEST_DIR = "${THIRD_PARTY}/googletest" +OHOS_PROFILER_SUBSYS_NAME = "developtools" +OHOS_PROFILER_PART_NAME = "smartperf_host" +OHOS_PROFILER_TEST_MODULE_OUTPUT_PATH = "smartperf_host" + +build_l2 = false +if (getenv("BUILD_L2") == "true") { + build_l2 = true +} diff --git a/trace_streamer/build_operator.sh b/trace_streamer/build_operator.sh index ac4a134e..8b1068fb 100755 --- a/trace_streamer/build_operator.sh +++ b/trace_streamer/build_operator.sh @@ -15,7 +15,7 @@ set -e ext="/clang_x64" target_dir="linux" subsys_name="developtools" -part_name="profiler" +part_name="smartperf_host" is_debug="$1" target="$2" target_os="$3" @@ -78,7 +78,7 @@ if [ "$is_clean" == "true" ];then prebuilts/$gn_path/$gn gen out/"$target_dir""$ext"/$subsys_name/$part_name --clean prebuilts/$gn_path/$ninja -C out/"$target_dir""$ext"/$subsys_name/$part_name -t clean else - prebuilts/$gn_path/$gn gen out/"$target_dir""$ext"/$subsys_name/$part_name --args='is_debug='"$is_debug"' target="'"$target"'" target_os="'"$target_os"'"' + prebuilts/$gn_path/$gn gen out/"$target_dir""$ext"/$subsys_name/$part_name --args='is_debug='"$is_debug"' target="'"$target"'" target_os="'"$target_os"'" is_independent_compile=true' echo "begin to build ..." mkdir -p out/windows touch out/windows/trace_streamer.exe diff --git a/trace_streamer/gn/BUILD.gn b/trace_streamer/gn/BUILD.gn index 5a02ff77..be63ea1d 100755 --- a/trace_streamer/gn/BUILD.gn +++ b/trace_streamer/gn/BUILD.gn @@ -137,9 +137,6 @@ config("default") { "-D __KERNEL__", ] } - if (with_perf) { - cflags += [ "-D WITH_PERF" ] - } if (with_ebpf_help_table) { cflags += [ "-D WITH_EBPF_HELP" ] } diff --git a/trace_streamer/gn/CONFIG.gn b/trace_streamer/gn/CONFIG.gn index 8b4791d9..29d63b33 100755 --- a/trace_streamer/gn/CONFIG.gn +++ b/trace_streamer/gn/CONFIG.gn @@ -14,7 +14,6 @@ is_win = false is_linux = false is_macx = false is_protoc = false -with_perf = true with_ebpf_help_table = false is_mingw = false with_libunwind = false diff --git a/trace_streamer/gn/toolchain/BUILD.gn b/trace_streamer/gn/toolchain/BUILD.gn index 3b315094..37f5bc3d 100755 --- a/trace_streamer/gn/toolchain/BUILD.gn +++ b/trace_streamer/gn/toolchain/BUILD.gn @@ -14,12 +14,12 @@ import("//gn/wasm.gni") declare_args() { if (target_os == "linux" || target_os == "macx") { - cc = "/usr/bin/clang" - cxx = "/usr/bin/clang++" + cc = "clang" + cxx = "clang++" pic = "-fPIC" rebuild_string = "" extra_asmflags = "" - asm = "/usr/bin/clang" + asm = "clang" } else if (target_os == "windows") { cc = "gcc.exe" cxx = "g++.exe" diff --git a/trace_streamer/prebuilts/patch_hiperf/BUILD.gn b/trace_streamer/prebuilts/patch_hiperf/BUILD.gn index f2869ab4..f724fe22 100644 --- a/trace_streamer/prebuilts/patch_hiperf/BUILD.gn +++ b/trace_streamer/prebuilts/patch_hiperf/BUILD.gn @@ -82,7 +82,7 @@ ohos_source_set("hiperf_src") { ] } -group("hiperf") { +group("hiperf_platform_common") { deps = [ ":elf", ":hiperf_src", diff --git a/trace_streamer/sdk/demo_sdk/BUILD.gn b/trace_streamer/sdk/demo_sdk/BUILD.gn index 498c279f..97ea1db6 100755 --- a/trace_streamer/sdk/demo_sdk/BUILD.gn +++ b/trace_streamer/sdk/demo_sdk/BUILD.gn @@ -52,9 +52,6 @@ ohos_source_set("lib") { "${THIRD_PARTY}/protobuf/src", ] public_deps = [ "protos/types/plugins/mock_data:mock_data_cpp" ] - if (with_perf) { - include_dirs += [] - } } ohos_source_set("trace_streamer_sdk") { subsystem_name = "trace_streamer" @@ -116,18 +113,12 @@ ohos_source_set("trace_streamer_sdk") { "${THIRD_PARTY}/libunwind/src", ] } - if (with_perf) { - sources += [] - include_dirs += [] - } deps = [ "${SRC}/base:base", "${THIRD_PARTY}/sqlite:sqlite", "plugin:sdk_plugin", ] public_deps = [ "protos/types/plugins/mock_data:mock_data_cpp" ] - if (with_perf) { - } if (use_wasm || enable_ts_utest) { sources += [ diff --git a/trace_streamer/sdk/dubai_sdk/BUILD.gn b/trace_streamer/sdk/dubai_sdk/BUILD.gn index 3f1f9124..beff5bb0 100755 --- a/trace_streamer/sdk/dubai_sdk/BUILD.gn +++ b/trace_streamer/sdk/dubai_sdk/BUILD.gn @@ -52,9 +52,6 @@ ohos_source_set("lib") { "${THIRD_PARTY}/sqlite/include", "${THIRD_PARTY}/protobuf/src", ] - if (with_perf) { - include_dirs += [] - } public_deps = [ "protos/types/plugins/mock_data:mock_data_cpp" ] } source_set("trace_streamer_sdk") { @@ -115,17 +112,11 @@ source_set("trace_streamer_sdk") { "${THIRD_PARTY}/libunwind/src", ] } - if (with_perf) { - sources += [] - include_dirs += [] - } deps = [ "${SRC}/base:base", "${THIRD_PARTY}/sqlite:sqlite", "plugin:sdk_plugin", ] - if (with_perf) { - } if (use_wasm || enable_ts_utest) { sources += [ diff --git a/trace_streamer/src/BUILD.gn b/trace_streamer/src/BUILD.gn index f589630f..3ca2bc37 100644 --- a/trace_streamer/src/BUILD.gn +++ b/trace_streamer/src/BUILD.gn @@ -11,74 +11,83 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("../build/ohos.gni") +import("//build/ohos.gni") import("../build/ts.gni") if (use_wasm) { import("//gn/wasm.gni") } -if (use_wasm) { - ohos_source_set("trace_streamer_builtin") { - subsystem_name = "trace_streamer" - part_name = "src" - sources = [] - include_dirs = [] - deps = [] - public_deps = [] - } -} -ohos_source_set("lib") { - subsystem_name = "trace_streamer" - part_name = "lib" - sources = [ "main.cpp" ] - deps = [ - ":trace_streamer_source", - "proto_reader:proto_reader", - ] - include_dirs = [ - "base", - "..", - "trace_streamer", - "filter", - "table", - "trace_data", - "include", - "rpc", - "./", - "parser", - "cfg", - "proto_reader/include", - "${THIRD_PARTY}/sqlite/include", - "${THIRD_PARTY}/json-master/single_include/nlohmann", - "${THIRD_PARTY}/protobuf/src", - "${THIRD_PARTY}/hiperf/include", - ] - include_dirs += [ - "parser/htrace_pbreader_parser", - "parser/htrace_pbreader_parser/htrace_event_parser", - "parser/htrace_pbreader_parser/htrace_cpu_parser", +ohos_source_set("ts_sqlite") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + sources = [ "//third_party/sqlite/src/sqlite3.c" ] + include_dirs = [ "//third_party/sqlite/include" ] + cflags = [ + "-Wno-shorten-64-to-32", + "-Wno-double-promotion", + "-Wno-disabled-macro-expansion", + "-Wno-float-equal", + "-Wno-cast-qual", + "-Wno-conversion", + "-Wno-cast-align", + "-Wno-unused-macros", + "-Wno-comma", + "-Wno-unreachable-code-break", + "-Wno-unreachable-code", + "-Wno-unreachable-code-return", + "-DSQLITE_THREADSAFE=1", + "-DQLITE_DEFAULT_MEMSTATUS=0", + "-DSQLITE_LIKE_DOESNT_MATCH_BLOBS", + "-DSQLITE_OMIT_DEPRECATED", + "-DSQLITE_OMIT_SHARED_CACHE", + "-DHAVE_USLEEP", + "-DHAVE_UTIME", + "-DSQLITE_BYTEORDER=1234", + "-DSQLITE_DEFAULT_AUTOVACUUM=0", + "-DSQLITE_DEFAULT_MMAP_SIZE=0", + "-DSQLITE_CORE", + "-DSQLITE_TEMP_STORE=3", + "-DSQLITE_OMIT_LOAD_EXTENSION", ] - - if (with_perf) { - include_dirs += [ - "parser/hiperf_parser", - "${THIRD_PARTY}/hiperf/include", - "${THIRD_PARTY}/hiperf/include/nonlinux", - "${THIRD_PARTY}/hiperf/include/nonlinux/linux", - "${THIRD_PARTY}/perf_include/musl", - ] - } - public_deps = [] - if (!use_wasm && !is_test && !is_fuzz) { - public_deps += [ - "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc", - "proto_reader/protoc_plugin:protoreader_plugin", - ] - } } + +trace_streamer_include = [ + "base", + "..", + "trace_streamer", + "filter", + "table", + "trace_data", + "include", + "rpc", + "./", + "parser", + "cfg", + "proto_reader/include", + "parser/ebpf_parser", + "parser/htrace_pbreader_parser", + "parser/htrace_pbreader_parser/htrace_event_parser", + "parser/htrace_pbreader_parser/htrace_cpu_parser", + "parser/hiperf_parser", + "//developtools/hiperf/include", + "${THIRD_PARTY}/sqlite/include", + "${THIRD_PARTY}/json-master/single_include/nlohmann", + "${THIRD_PARTY}/json/single_include/nlohmann", + "${THIRD_PARTY}/protobuf/src", + "${THIRD_PARTY}/hiperf/include", + "${THIRD_PARTY}/hiperf/include/nonlinux", + "${THIRD_PARTY}/hiperf/include/nonlinux/linux", + "${THIRD_PARTY}/perf_include/musl", + "${THIRD_PARTY}/musl", + "${THIRD_PARTY}/libunwind/include", + "${THIRD_PARTY}/libunwind/src", + "${THIRD_PARTY}/perf_include/libbpf", + "${THIRD_PARTY}/googletest/googletest/include", +] + ohos_source_set("trace_streamer_source") { - subsystem_name = "trace_streamer" - part_name = "trace_streamer_source" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "cfg/trace_streamer_config.cpp", "cfg/trace_streamer_config.h", @@ -91,87 +100,31 @@ ohos_source_set("trace_streamer_source") { "trace_streamer/trace_streamer_selector.h", "version.cpp", ] - include_dirs = [ - "base", - "..", - "trace_streamer", - "filter", - "table", - "trace_data", - "include", - "rpc", - "./", - "parser", - "cfg", - "proto_reader/include", - "parser/ebpf_parser", - "${THIRD_PARTY}/sqlite/include", - "${THIRD_PARTY}/protobuf/src", - ] + if (!is_test && !is_fuzz) { + sources += [ "main.cpp" ] + } + if (use_wasm) { + sources += [ + "rpc/wasm_func.cpp", + "rpc/wasm_func.h", + ] + } + + include_dirs = trace_streamer_include if (use_wasm) { include_dirs += [ "../prebuilts/emsdk/emsdk/emscripten/cache/sysroot/include" ] } - if (is_macx && !is_test) { - cflags = [ "-D_XOPEN_SOURCE=600" ] - } if (is_test) { include_dirs += [ "../prebuilts/emsdk/emsdk/emscripten/system/include" ] } - include_dirs += [ - "parser/htrace_pbreader_parser", - "parser/htrace_pbreader_parser/htrace_event_parser", - "parser/htrace_pbreader_parser/htrace_cpu_parser", - ] - - include_dirs += [ - "${THIRD_PARTY}/libunwind/include", - "${THIRD_PARTY}/libunwind/src", - "${THIRD_PARTY}/json-master/single_include/nlohmann", - "${THIRD_PARTY}/hiperf/include", - "${THIRD_PARTY}/hiperf/include/nonlinux/linux", - "${THIRD_PARTY}/hiperf/include/nonlinux", - ] - - if (with_perf) { - include_dirs += [ - "parser/hiperf_parser", - "${THIRD_PARTY}/perf_include/libbpf", - "${THIRD_PARTY}/perf_include/musl", - ] - } - public_deps = [ - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/services:all_type_cpp_standard", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/cpu_data:cpu_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ftrace_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hilog_data:hilog_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hisysevent_data:hisysevent_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/memory_data:memory_data_encoder", - ] - - deps = [ - "${THIRD_PARTY}/sqlite:sqlite", - "base:base", - "filter:filter", - "parser:parser", - "table:table", - "trace_data:trace_data", - ] - if (with_perf) { - deps += [ "parser/hiperf_parser:hiperf_parser" ] - } else { - deps += [ "${THIRD_PARTY}/hiperf:elf" ] - } - - if (use_wasm) { - sources += [ - "rpc/wasm_func.cpp", - "rpc/wasm_func.h", - ] + cflags = [ "-D target_cpu_${target_cpu}" ] + if (!use_wasm && !is_win && !is_macx && !is_test) { + cflags += [ "-D HAVE_LIBUNWIND" ] } if (enable_ts_utest && !use_wasm) { - cflags = [ + cflags += [ "-fprofile-arcs", "-ftest-coverage", ] @@ -184,16 +137,55 @@ ohos_source_set("trace_streamer_source") { cflags += [ "-D IS_UT" ] } } + + public_deps = [ + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/services:ts_all_type_cpp_standard", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/cpu_data:cpu_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ftrace_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hilog_data:hilog_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hisysevent_data:hisysevent_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/memory_data:memory_data_reader", + ] + if (!use_wasm && !is_test && !is_fuzz) { + public_deps += [ + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc(${host_toolchain})", + "proto_reader/protoc_plugin:protoreader_plugin(${host_toolchain})", + ] + } + + deps = [ + ":ts_sqlite", + "base:base", + "filter:filter", + "parser:parser", + "parser/hiperf_parser:hiperf_parser", + "proto_reader:proto_reader", + "table:table", + "trace_data:trace_data", + ] } + if (use_wasm) { + ohos_source_set("trace_streamer_builtin") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + sources = [] + include_dirs = [] + deps = [] + public_deps = [] + } wasm_lib("trace_streamer_builtin_wasm") { name = "trace_streamer_builtin" - deps = [ ":lib" ] + deps = [ ":trace_streamer_source" ] } } else { if (!is_test && !is_fuzz) { - executable("trace_streamer") { - deps = [ ":lib" ] + ohos_executable("trace_streamer") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + sources = [] + include_dirs = trace_streamer_include + deps = [ ":trace_streamer_source" ] } } } diff --git a/trace_streamer/src/base/BUILD.gn b/trace_streamer/src/base/BUILD.gn index 547d2d88..643a88e3 100644 --- a/trace_streamer/src/base/BUILD.gn +++ b/trace_streamer/src/base/BUILD.gn @@ -14,8 +14,8 @@ import("//build/ohos.gni") import("../../build/ts.gni") ohos_source_set("base") { - subsystem_name = "trace_streamer" - part_name = "trace_streamer_source_base" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" deps = [ ":base_parser", ":base_table", @@ -44,13 +44,13 @@ ohos_source_set("base") { } } ohos_source_set("string_help") { - subsystem_name = "trace_streamer" - part_name = "string_help" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "string_help.cpp" ] } ohos_source_set("ibase") { - subsystem_name = "trace_streamer" - part_name = "ibase" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "codec_cov.h", "file.h", @@ -65,8 +65,8 @@ ohos_source_set("ibase") { sources += [ "/usr/x86_64-w64-mingw32/include/windows.h" ] } ohos_source_set("base_parser") { - subsystem_name = "trace_streamer" - part_name = "parser" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "htrace_plugin_time_parser.cpp", "htrace_plugin_time_parser.h", @@ -76,8 +76,8 @@ ohos_source_set("base_parser") { deps = [] } ohos_source_set("base_table") { - subsystem_name = "trace_streamer" - part_name = "table" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "filter_constraints.cpp", "index_map.cpp", diff --git a/trace_streamer/src/base/clock_filter.cpp b/trace_streamer/src/base/clock_filter.cpp index e527e874..9fce0b53 100644 --- a/trace_streamer/src/base/clock_filter.cpp +++ b/trace_streamer/src/base/clock_filter.cpp @@ -16,6 +16,7 @@ #include "clock_filter.h" #include #include +#include #include "log.h" #include "string_help.h" #include "ts_common.h" @@ -105,32 +106,32 @@ int32_t ClockFilter::InitSnapShotTimeRange(const uint8_t* data, int32_t len) std::vector snapShot; - TS_LOGI("SDK clockid: TS_CLOCK_BOOTTIME, ts:%llu", profilerSDKTraceFileHeader_->data.boottime); + TS_LOGI("SDK clockid: TS_CLOCK_BOOTTIME, ts:%" PRIu64 " ", profilerSDKTraceFileHeader_->data.boottime); if (profilerSDKTraceFileHeader_->data.boottime) { snapShot.push_back(SnapShot{TS_CLOCK_BOOTTIME, profilerSDKTraceFileHeader_->data.boottime}); } - TS_LOGI("SDK clockid: TS_CLOCK_REALTIME, ts:%llu", profilerSDKTraceFileHeader_->data.realtime); + TS_LOGI("SDK clockid: TS_CLOCK_REALTIME, ts:%" PRIu64 "", profilerSDKTraceFileHeader_->data.realtime); if (profilerSDKTraceFileHeader_->data.realtime) { snapShot.push_back(SnapShot{TS_CLOCK_REALTIME, profilerSDKTraceFileHeader_->data.realtime}); } - TS_LOGI("SDK clockid: TS_CLOCK_REALTIME_COARSE, ts:%llu", profilerSDKTraceFileHeader_->data.realtimeCoarse); + TS_LOGI("SDK clockid: TS_CLOCK_REALTIME_COARSE, ts:%" PRIu64 "", profilerSDKTraceFileHeader_->data.realtimeCoarse); if (profilerSDKTraceFileHeader_->data.realtimeCoarse) { snapShot.push_back(SnapShot{TS_CLOCK_REALTIME_COARSE, profilerSDKTraceFileHeader_->data.realtimeCoarse}); } - TS_LOGI("SDK clockid: TS_MONOTONIC, ts:%llu", profilerSDKTraceFileHeader_->data.monotonic); + TS_LOGI("SDK clockid: TS_MONOTONIC, ts:%" PRIu64 "", profilerSDKTraceFileHeader_->data.monotonic); if (profilerSDKTraceFileHeader_->data.monotonic) { snapShot.push_back(SnapShot{TS_MONOTONIC, profilerSDKTraceFileHeader_->data.monotonic}); } - TS_LOGI("SDK clockid: TS_MONOTONIC_COARSE, ts:%llu", profilerSDKTraceFileHeader_->data.monotonicCoarse); + TS_LOGI("SDK clockid: TS_MONOTONIC_COARSE, ts:%" PRIu64 "", profilerSDKTraceFileHeader_->data.monotonicCoarse); if (profilerSDKTraceFileHeader_->data.monotonicCoarse) { snapShot.push_back(SnapShot{TS_MONOTONIC_COARSE, profilerSDKTraceFileHeader_->data.monotonicCoarse}); } - TS_LOGI("SDK clockid: TS_MONOTONIC_RAW, ts:%llu", profilerSDKTraceFileHeader_->data.monotonicRaw); + TS_LOGI("SDK clockid: TS_MONOTONIC_RAW, ts:%" PRIu64 "", profilerSDKTraceFileHeader_->data.monotonicRaw); if (profilerSDKTraceFileHeader_->data.monotonicRaw) { snapShot.push_back(SnapShot{TS_MONOTONIC_RAW, profilerSDKTraceFileHeader_->data.monotonicRaw}); } diff --git a/trace_streamer/src/base/index_map.cpp b/trace_streamer/src/base/index_map.cpp index ac319688..eabc4ed2 100644 --- a/trace_streamer/src/base/index_map.cpp +++ b/trace_streamer/src/base/index_map.cpp @@ -21,7 +21,7 @@ namespace SysTuning { namespace TraceStreamer { -IndexMap::IndexMap(TableRowId start, TableRowId end) : end_(end), current_(start), start_(start), type_(COMPACT) {} +IndexMap::IndexMap(TableRowId start, TableRowId end) : end_(end), current_(start), start_(start) {} void IndexMap::CovertToIndexMap() { @@ -146,12 +146,14 @@ void IndexMap::FilterTS(unsigned char op, sqlite3_value* argv, const std::deque< break; case SQLITE_INDEX_CONSTRAINT_GT: v++; + [[fallthrough]]; case SQLITE_INDEX_CONSTRAINT_GE: { IntersectGreaterEqual(times, v, getValue); break; } case SQLITE_INDEX_CONSTRAINT_LE: v++; + [[fallthrough]]; case SQLITE_INDEX_CONSTRAINT_LT: IntersectLessEqual(times, v, getValue); break; diff --git a/trace_streamer/src/base/index_map.h b/trace_streamer/src/base/index_map.h index 28169a85..dfe32dcd 100644 --- a/trace_streamer/src/base/index_map.h +++ b/trace_streamer/src/base/index_map.h @@ -331,7 +331,7 @@ public: } } else { auto size = rows.size(); - for (auto i = 0; i < size; i++) { + for (size_t i = 0; i < size; i++) { if (rows[i] != invalidValue) { rowIndex_.push_back(i); } @@ -354,11 +354,8 @@ private: INDEX_TYPE_OUTER_INDEX, }; FindIndexType indexType_ = INDEX_TYPE_ID; - uint32_t indexSize_ = 0; - uint32_t index_ = 0; enum IndexType { COMPACT, SPARSE }; - uint8_t type_ = COMPACT; bool empty_ = true; bool desc_ = false; bool converted_ = false; diff --git a/trace_streamer/src/filter/BUILD.gn b/trace_streamer/src/filter/BUILD.gn index 2a4a2aa9..520f5c8b 100644 --- a/trace_streamer/src/filter/BUILD.gn +++ b/trace_streamer/src/filter/BUILD.gn @@ -15,8 +15,8 @@ import("//build/ohos.gni") import("../../build/ts.gni") ohos_source_set("filter") { - subsystem_name = "trace_streamer" - part_name = "trace_streamer_filter" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "app_start_filter.cpp", "app_start_filter.h", @@ -52,6 +52,8 @@ ohos_source_set("filter") { "symbols_filter.h", "system_event_measure_filter.cpp", "system_event_measure_filter.h", + "perf_data_filter.cpp", + "perf_data_filter.h", ] if (enable_ts_utest && !use_wasm) { @@ -68,7 +70,7 @@ ohos_source_set("filter") { cflags += [ "-D IS_UT" ] } } - public_deps = [ "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/native_hook:native_hook_data_encoder" ] + public_deps = [ "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/native_hook:native_hook_data_reader" ] deps = [] include_dirs = [ "${SRC}/base", @@ -84,11 +86,4 @@ ohos_source_set("filter") { "../proto_reader/include", ".", ] - - if (with_perf) { - sources += [ - "perf_data_filter.cpp", - "perf_data_filter.h", - ] - } } diff --git a/trace_streamer/src/filter/app_start_filter.cpp b/trace_streamer/src/filter/app_start_filter.cpp index b8b8928e..54fa7f2b 100644 --- a/trace_streamer/src/filter/app_start_filter.cpp +++ b/trace_streamer/src/filter/app_start_filter.cpp @@ -52,7 +52,6 @@ bool APPStartupFilter::CaclRsDataByPid() { auto frameSliceData = traceDataCache_->GetFrameSliceData(); auto sliceData = traceDataCache_->GetConstInternalSlicesData(); - auto itor = mAPPStartupData_.begin(); for (const auto& item : mAPPStartupData_) { if (item.second.empty()) { continue; @@ -68,8 +67,8 @@ bool APPStartupFilter::CaclRsDataByPid() auto endTime = startTime + frameSliceData->Durs()[m]; mAPPStartupData_[dataIndex].emplace( FIRST_FRAME_APP_PHASE, - std::move(std::make_unique(callId, itorSecond->second->ipid_, - itorSecond->second->tid_, startTime, endTime))); + std::make_unique(callId, itorSecond->second->ipid_, itorSecond->second->tid_, + startTime, endTime)); auto dstId = frameSliceData->Dsts()[m]; if (dstId == INVALID_UINT64) { continue; @@ -79,8 +78,8 @@ bool APPStartupFilter::CaclRsDataByPid() endTime = startTime + frameSliceData->Durs()[dstId]; mAPPStartupData_[dataIndex].emplace( FIRST_FRAME_RENDER_PHASE, - std::move(std::make_unique(callId, itorSecond->second->ipid_, - itorSecond->second->tid_, startTime, endTime))); + std::make_unique(callId, itorSecond->second->ipid_, itorSecond->second->tid_, + startTime, endTime)); break; } } @@ -147,8 +146,8 @@ DataIndex APPStartupFilter::GetThreadNameAndUpdateAPPStartupData(uint32_t row, auto callId = sliceData.CallIds()[row]; auto startTime = sliceData.TimeStampData()[row]; mAPPStartupData_[dataIndex].insert( - std::make_pair(startIndex, std::move(std::make_unique(callId, INVALID_UINT32, INVALID_UINT32, - startTime, INVALID_UINT64)))); + std::make_pair(startIndex, std::make_unique(callId, INVALID_UINT32, INVALID_UINT32, startTime, + INVALID_UINT64))); return dataIndex; } @@ -175,8 +174,8 @@ void APPStartupFilter::ParserAppStartup() } callId = sliceData.CallIds()[i]; mAPPStartupData_[traceDataCache_->GetDataIndex(mainThreadName.c_str())].insert(std::make_pair( - PROCESS_CREATING, std::move(std::make_unique(callId, INVALID_UINT32, INVALID_UINT32, - startTime, INVALID_UINT64)))); + PROCESS_CREATING, + std::make_unique(callId, INVALID_UINT32, INVALID_UINT32, startTime, INVALID_UINT64))); } else if (StartWith(nameString, APP_LAUNCH)) { GetThreadNameAndUpdateAPPStartupData(i, nameString, APPLICATION_LAUNCHING); } else if (StartWith(nameString, LAUNCH)) { @@ -193,9 +192,9 @@ void APPStartupFilter::ParserAppStartup() auto nameindex = threadData[callId].nameIndex_; auto ipid = threadData[callId].internalPid_; auto tid = threadData[callId].tid_; - mAPPStartupData_[nameindex].insert(std::make_pair( - UI_ABILITY_ONFOREGROUND, - std::move(std::make_unique(callId, ipid, tid, startTime, INVALID_UINT64)))); + mAPPStartupData_[nameindex].insert( + std::make_pair(UI_ABILITY_ONFOREGROUND, + std::make_unique(callId, ipid, tid, startTime, INVALID_UINT64))); } } UpdatePidByNameIndex(); diff --git a/trace_streamer/src/filter/frame_filter.cpp b/trace_streamer/src/filter/frame_filter.cpp index 4a0f6f7b..93b1fb5c 100644 --- a/trace_streamer/src/filter/frame_filter.cpp +++ b/trace_streamer/src/filter/frame_filter.cpp @@ -14,6 +14,7 @@ */ #include "frame_filter.h" #include +#include #include "log.h" #define ISINVALIDU32(value) (value == INVALID_UINT32) namespace SysTuning { @@ -55,7 +56,7 @@ bool FrameFilter::MarkRSOnvsyncEvent(uint64_t ts, uint32_t itid) { auto frame = vsyncRenderSlice_.find(itid); if (frame == vsyncRenderSlice_.end()) { - TS_LOGW("BeginOnvsyncEvent find for itid:%u failed, ts:%llu", itid, ts); + TS_LOGW("BeginOnvsyncEvent find for itid:%u failed, ts:%" PRIu64 "", itid, ts); return false; } if (!frame->second.size()) { @@ -173,11 +174,11 @@ bool FrameFilter::EndVsyncEvent(uint64_t ts, uint32_t itid) { auto frame = vsyncRenderSlice_.find(itid); if (frame == vsyncRenderSlice_.end()) { - TS_LOGW("EndVsyncEvent find for itid:%u ts:%llu failed", itid, ts); + TS_LOGW("EndVsyncEvent find for itid:%u ts:%" PRIu64" failed", itid, ts); return false; } if (!frame->second.size()) { - TS_LOGW("EndVsyncEvent find for itid:%u ts:%llu failed", itid, ts); + TS_LOGW("EndVsyncEvent find for itid:%u ts:%" PRIu64" failed", itid, ts); return false; } auto lastFrameSlice = frame->second.back(); @@ -226,11 +227,11 @@ bool FrameFilter::EndFrameQueue(uint64_t ts, uint32_t itid) { auto frame = vsyncRenderSlice_.find(itid); if (frame == vsyncRenderSlice_.end()) { - TS_LOGW("EndFrameQueue find for itid:%u ts:%llu failed", itid, ts); + TS_LOGW("EndFrameQueue find for itid:%u ts:%" PRIu64" failed", itid, ts); return false; } if (!frame->second.size()) { - TS_LOGW("EndFrameQueue find for itid:%u ts:%llu failed", itid, ts); + TS_LOGW("EndFrameQueue find for itid:%u ts:%" PRIu64" failed", itid, ts); return false; } auto firstFrameSlicePos = frame->second.begin(); diff --git a/trace_streamer/src/filter/frame_filter.h b/trace_streamer/src/filter/frame_filter.h index 71c5b2d4..73152c9b 100644 --- a/trace_streamer/src/filter/frame_filter.h +++ b/trace_streamer/src/filter/frame_filter.h @@ -77,7 +77,6 @@ private: std::unordered_map>> vsyncRenderSlice_ = {}; std::unordered_map>> dstRenderSlice_ = {}; - bool checkFrameAlwasy_ = false; }; } // namespace TraceStreamer } // namespace SysTuning diff --git a/trace_streamer/src/filter/native_hook_filter.cpp b/trace_streamer/src/filter/native_hook_filter.cpp index 0f660864..91e6eab6 100644 --- a/trace_streamer/src/filter/native_hook_filter.cpp +++ b/trace_streamer/src/filter/native_hook_filter.cpp @@ -15,6 +15,7 @@ #include "native_hook_filter.h" #include "native_hook_config.pbreader.h" +#include namespace SysTuning { namespace TraceStreamer { NativeHookFilter::NativeHookFilter(TraceDataCache* dataCache, const TraceStreamerFilters* filter) @@ -112,13 +113,12 @@ std::unique_ptr NativeHookFilter::ParseFrame(const ProtoRea } auto frameInfo = std::make_unique(reader.ip(), reader.sp(), symbolIndex, filePathIndex, reader.offset(), reader.symbol_offset()); - return std::move(frameInfo); + return frameInfo; } void NativeHookFilter::CompressStackAndFrames(ProtoReader::RepeatedDataAreaIterator frames) { std::vector framesHash; - uint64_t frameHash = INVALID_UINT64; std::string framesHashStr = ""; for (auto itor = frames; itor; itor++) { std::string_view frameStr(reinterpret_cast(itor->Data()), itor->Size()); @@ -671,7 +671,7 @@ void NativeHookFilter::MaybeUpdateCurrentSizeDur(uint64_t row, uint64_t timeStam void NativeHookFilter::UpdateSymbolIdsForSymbolizationFailed() { auto size = traceDataCache_->GetNativeHookFrameData()->Size(); - for (auto i = 0; i < size; ++i) { + for (size_t i = 0; i < size; ++i) { if (traceDataCache_->GetNativeHookFrameData()->SymbolNames()[i] == INVALID_UINT64) { auto filePathIndex = traceDataCache_->GetNativeHookFrameData()->FilePaths()[i]; auto filePathStr = traceDataCache_->dataDict_.GetDataFromDict(filePathIndex); @@ -873,7 +873,7 @@ bool NativeHookFilter::GetIpsWitchNeedResymbolization(DataIndex filePathId, std: bool value = false; for (auto itor = ipToFrameInfo_.begin(); itor != ipToFrameInfo_.end(); itor++) { if (!itor->second) { - TS_LOGI("ip :%lu can not symbolization! FrameInfo is nullptr", itor->first); + TS_LOGI("ip :%llu can not symbolization! FrameInfo is nullptr", itor->first); continue; } if (itor->second->filePathId_ == filePathId) { diff --git a/trace_streamer/src/filter/offline_symbolization_filter.cpp b/trace_streamer/src/filter/offline_symbolization_filter.cpp index 34c48805..3c0c538b 100644 --- a/trace_streamer/src/filter/offline_symbolization_filter.cpp +++ b/trace_streamer/src/filter/offline_symbolization_filter.cpp @@ -18,8 +18,8 @@ namespace SysTuning { namespace TraceStreamer { OfflineSymbolizationFilter::OfflineSymbolizationFilter(TraceDataCache* dataCache, const TraceStreamerFilters* filter) : FilterBase(dataCache, filter), - symbolTablePtrAndStValueToSymAddr_(nullptr), - filePathIdAndStValueToSymAddr_(nullptr) + filePathIdAndStValueToSymAddr_(nullptr), + symbolTablePtrAndStValueToSymAddr_(nullptr) { } std::shared_ptr>> OfflineSymbolizationFilter::OfflineSymbolization( diff --git a/trace_streamer/src/include/BUILD.gn b/trace_streamer/src/include/BUILD.gn index 3b7d9c90..406b80d3 100755 --- a/trace_streamer/src/include/BUILD.gn +++ b/trace_streamer/src/include/BUILD.gn @@ -12,8 +12,8 @@ # limitations under the License. import("//build/ohos.gni") ohos_source_set("ibase") { - subsystem_name = "trace_streamer" - part_name = "ibase" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "codec_cov.h", "file.h", diff --git a/trace_streamer/src/parser/BUILD.gn b/trace_streamer/src/parser/BUILD.gn index 3efd2247..dda3066a 100644 --- a/trace_streamer/src/parser/BUILD.gn +++ b/trace_streamer/src/parser/BUILD.gn @@ -15,8 +15,8 @@ import("//build/ohos.gni") import("../../build/ts.gni") ohos_source_set("parser") { - subsystem_name = "trace_streamer" - part_name = "parser" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "bytrace_parser/bytrace_event_parser.cpp", "bytrace_parser/bytrace_event_parser.h", @@ -31,16 +31,16 @@ ohos_source_set("parser") { "thread_state_flag.h", ] deps = [ - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/cpu_data:cpu_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/diskio_data:diskio_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hidump_data:hidump_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hilog_data:hilog_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hisysevent_data:hisysevent_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/js_memory:js_memory_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/memory_data:memory_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/native_hook:native_hook_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/network_data:network_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/process_data:process_data_encoder", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/cpu_data:cpu_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/diskio_data:diskio_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hidump_data:hidump_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hilog_data:hilog_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hisysevent_data:hisysevent_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/js_memory:js_memory_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/memory_data:memory_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/native_hook:native_hook_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/network_data:network_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/process_data:process_data_reader", "ebpf_parser:ebpf_parser", ] deps += [ "htrace_pbreader_parser:htrace_pbreader_parser" ] @@ -57,6 +57,7 @@ ohos_source_set("parser") { "${SRC}", ".", "${THIRD_PARTY}/json-master/single_include/nlohmann", + "${THIRD_PARTY}/json/single_include/nlohmann", ] include_dirs += [ "htrace_pbreader_parser" ] diff --git a/trace_streamer/src/parser/bytrace_parser/bytrace_event_parser.cpp b/trace_streamer/src/parser/bytrace_parser/bytrace_event_parser.cpp index 7fbc4068..810599a1 100644 --- a/trace_streamer/src/parser/bytrace_parser/bytrace_event_parser.cpp +++ b/trace_streamer/src/parser/bytrace_parser/bytrace_event_parser.cpp @@ -642,7 +642,7 @@ bool BytraceEventParser::BinderTransactionAllocBufEvent(const ArgsMap& args, con } void BytraceEventParser::ParseDataItem(const BytraceLine& line) { - eventList_.push_back(std::move(std::make_unique(line.ts, std::move(line)))); + eventList_.push_back(std::make_unique(line.ts, std::move(line))); return; } void BytraceEventParser::GetDataSegArgs(BytraceLine& bufLine, ArgsMap& args, uint32_t& tgid) const diff --git a/trace_streamer/src/parser/ebpf_parser/BUILD.gn b/trace_streamer/src/parser/ebpf_parser/BUILD.gn index dca9df37..4a1a9894 100644 --- a/trace_streamer/src/parser/ebpf_parser/BUILD.gn +++ b/trace_streamer/src/parser/ebpf_parser/BUILD.gn @@ -14,8 +14,8 @@ import("//build/ohos.gni") import("../../../build/ts.gni") ohos_source_set("ebpf_parser_src") { - subsystem_name = "trace_streamer" - part_name = "ebpf_parser_src" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "bio_latency_data_parser.cpp", "bio_latency_data_parser.h", @@ -44,7 +44,7 @@ ohos_source_set("ebpf_parser_src") { "${THIRD_PARTY}/protobuf/src", "${THIRD_PARTY}/sqlite/include", ] - public_deps = [ "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/memory_data:memory_data_encoder" ] + public_deps = [ "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/memory_data:memory_data_reader" ] if (is_win || is_macx) { include_dirs += [ "${THIRD_PARTY}/perf_include/linux", diff --git a/trace_streamer/src/parser/ebpf_parser/bio_latency_data_parser.cpp b/trace_streamer/src/parser/ebpf_parser/bio_latency_data_parser.cpp index 7f3e9c47..a12fb408 100644 --- a/trace_streamer/src/parser/ebpf_parser/bio_latency_data_parser.cpp +++ b/trace_streamer/src/parser/ebpf_parser/bio_latency_data_parser.cpp @@ -68,7 +68,7 @@ void BioLatencyDataParser::ParseBioLatencyEvent() auto newEndTs = streamFilters_->clockFilter_->ToPrimaryTraceTime(clockId_, endTs); timeParser_->UpdatePluginTimeRange(clockId_, endTs, newEndTs); if (newStartTs > newEndTs) { - TS_LOGE("File system event origin startTs = %lu, endTs = %lu, newStartTs = %lu, newEndTs = %lu", startTs, + TS_LOGE("File system event origin startTs = %llu, endTs = %llu, newStartTs = %llu, newEndTs = %llu", startTs, endTs, newStartTs, newEndTs); streamFilters_->statFilter_->IncreaseStat(TRACE_EVENT_EBPF_PAGED_MEMORY, STAT_EVENT_DATA_INVALID); return; diff --git a/trace_streamer/src/parser/ebpf_parser/ebpf_data_reader.cpp b/trace_streamer/src/parser/ebpf_parser/ebpf_data_reader.cpp index cc191bdf..fe1b8a86 100644 --- a/trace_streamer/src/parser/ebpf_parser/ebpf_data_reader.cpp +++ b/trace_streamer/src/parser/ebpf_parser/ebpf_data_reader.cpp @@ -16,6 +16,7 @@ #include "ebpf_data_reader.h" #include "file_system_data_parser.h" #include "string_help.h" +#include namespace SysTuning { namespace TraceStreamer { @@ -23,7 +24,7 @@ using namespace SysTuning::base; using namespace SysTuning::EbpfStdtype; EbpfDataReader::EbpfDataReader(TraceDataCache* dataCache, const TraceStreamerFilters* filter) : EventParserBase(dataCache, filter), - ebpfDataHeader_(reinterpret_cast(startAddr_)), + ebpfDataHeader_(nullptr), pidAndStartAddrToMapsAddr_(nullptr), elfAddrAndStValueToSymAddr_(nullptr), tracerEventToStrIndex_(INVALID_UINT64), @@ -47,20 +48,20 @@ bool EbpfDataReader::InitEbpfData(const std::deque& dequeBuffer, uint64 bool EbpfDataReader::InitEbpfHeader() { if (bufferSize_ < EbpfDataHeader::EBPF_DATA_HEADER_SIZE) { - TS_LOGE("buffer size less than ebpf data header!!!, bufferSize_ = %lu ", bufferSize_); + TS_LOGE("buffer size less than ebpf data header!!!, bufferSize_ = %llu ", bufferSize_); return false; } ebpfDataHeader_ = reinterpret_cast(startAddr_); if (ebpfDataHeader_->header.magic != EbpfDataHeader::HEADER_MAGIC) { - TS_LOGE("Get EBPF file header failed! magic = %lx", ebpfDataHeader_->header.magic); + TS_LOGE("Get EBPF file header failed! magic = %llx", ebpfDataHeader_->header.magic); return false; } if (ebpfDataHeader_->header.headSize != EbpfDataHeader::EBPF_DATA_HEADER_SIZE) { TS_LOGE("Get ebpf file header failed! headSize = %u", ebpfDataHeader_->header.headSize); return false; } - TS_LOGI("EBPF data header : magic = %llx, headSize = %llu, clock = %llu, cmdline = %s", + TS_LOGI("EBPF data header : magic = %" PRIu64", headSize = %u, clock = %u, cmdline = %s", ebpfDataHeader_->header.magic, ebpfDataHeader_->header.headSize, ebpfDataHeader_->header.clock, ebpfDataHeader_->cmdline); startAddr_ += EbpfDataHeader::EBPF_DATA_HEADER_SIZE; @@ -76,7 +77,7 @@ bool EbpfDataReader::ReadEbpfData() unresolvedLen_ -= EBPF_TITLE_SIZE; if (dataTitle->length > unresolvedLen_) { TS_LOGE("Get EBPF data Title failed!"); - TS_LOGE("type = %lx, length = %lx", dataTitle->type, dataTitle->length); + TS_LOGE("type = %x, length = %x", dataTitle->type, dataTitle->length); return false; } if (dataTitle->length == 0) { @@ -186,7 +187,7 @@ void EbpfDataReader::ReadKernelSymAddrMap(const KernelSymbolInfoHeader* elfAddr, maxKernelAddr_ = elfAddr->vaddrEnd; minKernelAddr_ = elfAddr->vaddrStart; for (auto i = 0; i < sysItemSize; i++) { - (void*)memset_s(strSymbolName_, MAX_SYMBOL_LENGTH, 0, MAX_SYMBOL_LENGTH); + (void)memset_s(strSymbolName_, MAX_SYMBOL_LENGTH, 0, MAX_SYMBOL_LENGTH); auto item = start + i; if (strncpy_s(strSymbolName_, MAX_SYMBOL_LENGTH, strTab + item->nameOffset, MAX_SYMBOL_LENGTH) < 0) { TS_LOGE("get kernel symbol name error"); diff --git a/trace_streamer/src/parser/ebpf_parser/file_system_data_parser.cpp b/trace_streamer/src/parser/ebpf_parser/file_system_data_parser.cpp index 7293d55a..0bb185e6 100644 --- a/trace_streamer/src/parser/ebpf_parser/file_system_data_parser.cpp +++ b/trace_streamer/src/parser/ebpf_parser/file_system_data_parser.cpp @@ -77,7 +77,7 @@ void FileSystemDataParser::ParseFileSystemEvent() auto newEndTs = streamFilters_->clockFilter_->ToPrimaryTraceTime(clockId_, fsFixedHeadrAddr->endTime); timeParser_->UpdatePluginTimeRange(clockId_, fsFixedHeadrAddr->endTime, newEndTs); if (newStartTs > newEndTs) { - TS_LOGE("File system event origin startTs = %lu, endTs = %lu, newStartTs = %lu, newEndTs = %lu", + TS_LOGE("File system event origin startTs = %llu, endTs = %llu, newStartTs = %llu, newEndTs = %llu", fsFixedHeadrAddr->startTime, fsFixedHeadrAddr->endTime, newStartTs, newEndTs); streamFilters_->statFilter_->IncreaseStat(TRACE_EVENT_EBPF_FILE_SYSTEM, STAT_EVENT_DATA_INVALID); return; diff --git a/trace_streamer/src/parser/ebpf_parser/paged_memory_data_parser.cpp b/trace_streamer/src/parser/ebpf_parser/paged_memory_data_parser.cpp index b159da1d..70a5a347 100644 --- a/trace_streamer/src/parser/ebpf_parser/paged_memory_data_parser.cpp +++ b/trace_streamer/src/parser/ebpf_parser/paged_memory_data_parser.cpp @@ -54,7 +54,7 @@ void PagedMemoryDataParser::ParsePagedMemoryEvent() currentCallId_ = callChainId_++; } } else { - currentCallId_ = INVALID_UINT64; + currentCallId_ = INVALID_UINT32; } auto type = pagedMemoryFixedHeadrAddr->type; @@ -71,7 +71,7 @@ void PagedMemoryDataParser::ParsePagedMemoryEvent() auto newEndTs = streamFilters_->clockFilter_->ToPrimaryTraceTime(clockId_, endTs); timeParser_->UpdatePluginTimeRange(clockId_, endTs, newEndTs); if (newStartTs > newEndTs) { - TS_LOGE("paged memory startTs = %lu, endTs = %lu, newStartTs = %lu, newEndTs = %lu", startTs, endTs, + TS_LOGE("paged memory startTs = %llu, endTs = %llu, newStartTs = %llu, newEndTs = %llu", startTs, endTs, newStartTs, newEndTs); streamFilters_->statFilter_->IncreaseStat(TRACE_EVENT_EBPF_PAGED_MEMORY, STAT_EVENT_DATA_INVALID); return; diff --git a/trace_streamer/src/parser/hiperf_parser/BUILD.gn b/trace_streamer/src/parser/hiperf_parser/BUILD.gn index 5dd0cb26..445869e4 100644 --- a/trace_streamer/src/parser/hiperf_parser/BUILD.gn +++ b/trace_streamer/src/parser/hiperf_parser/BUILD.gn @@ -14,8 +14,8 @@ import("//build/ohos.gni") import("../../../build/ts.gni") ohos_source_set("hiperf_parser_src") { - subsystem_name = "trace_streamer" - part_name = "hiperf_parser_src" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "perf_data_parser.cpp" ] include_dirs = [ "${THIRD_PARTY}/hiperf/include/nonlinux/linux", @@ -34,11 +34,18 @@ ohos_source_set("hiperf_parser_src") { "${THIRD_PARTY}/protobuf/src", "${THIRD_PARTY}/perf_include", "${THIRD_PARTY}/perf_include/libbpf", + "//developtools/hiperf/include", + "//commonlibrary/c_utils/base/include", + "${THIRD_PARTY}/googletest/googletest/include", ] include_dirs += [ "${THIRD_PARTY}/libunwind/include" ] + cflags = [ "-D target_cpu_${target_cpu}" ] + if (!use_wasm && !is_win && !is_macx && !is_test) { + cflags += [ "-D HAVE_LIBUNWIND" ] + } if (enable_ts_utest && !use_wasm) { - cflags = [ + cflags += [ "-fprofile-arcs", "-ftest-coverage", ] @@ -56,7 +63,7 @@ ohos_source_set("hiperf_parser_src") { group("hiperf_parser") { deps = [ ":hiperf_parser_src", - "${PERF_DIR}/hiperf:hiperf", + "${PERF_DIR}/hiperf:hiperf_platform_common", "${THIRD_PARTY}/protobuf:protobuf", "${THIRD_PARTY}/protobuf:protobuf_lite", ] diff --git a/trace_streamer/src/parser/hiperf_parser/perf_data_parser.cpp b/trace_streamer/src/parser/hiperf_parser/perf_data_parser.cpp index c268c099..0d75bee4 100644 --- a/trace_streamer/src/parser/hiperf_parser/perf_data_parser.cpp +++ b/trace_streamer/src/parser/hiperf_parser/perf_data_parser.cpp @@ -73,8 +73,8 @@ bool PerfDataParser::LoadPerfData() fprintf(stdout, "Failed to create file: %s", tmpPerfData_.c_str()); return false; } - auto ret = ftruncate(fd, 0); - if (bufferSize_ != write(fd, buffer_.get(), bufferSize_)) { + (void)ftruncate(fd, 0); + if (bufferSize_ != (size_t)write(fd, buffer_.get(), bufferSize_)) { close(fd); return false; } @@ -263,7 +263,7 @@ uint32_t PerfDataParser::UpdatePerfCallChainData(const std::unique_ptrsecond; callStackTemp.emplace_back( - std::move(std::make_unique(depth, frame->vaddrInFile_, fileId, symbolId))); + std::make_unique(depth, frame->vaddrInFile_, fileId, symbolId)); depth++; } // Determine whether to write callstack data to cache diff --git a/trace_streamer/src/parser/htrace_pbreader_parser/BUILD.gn b/trace_streamer/src/parser/htrace_pbreader_parser/BUILD.gn index fd98518f..d865bc06 100755 --- a/trace_streamer/src/parser/htrace_pbreader_parser/BUILD.gn +++ b/trace_streamer/src/parser/htrace_pbreader_parser/BUILD.gn @@ -13,8 +13,8 @@ import("//build/ohos.gni") import("../../../build/ts.gni") ohos_source_set("htrace_pbreader_parser_src") { - subsystem_name = "trace_streamer" - part_name = "htrace_pbreader_parser_src" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "../parser_base.cpp", "htrace_clock_detail_parser.cpp", @@ -62,6 +62,7 @@ ohos_source_set("htrace_pbreader_parser_src") { "${THIRD_PARTY}/protobuf/src", "${THIRD_PARTY}/sqlite/include", "${THIRD_PARTY}/json-master/single_include/nlohmann", + "${THIRD_PARTY}/json/single_include/nlohmann", "../../filter", "../../base", "../ebpf_parser", @@ -72,20 +73,24 @@ ohos_source_set("htrace_pbreader_parser_src") { "${THIRD_PARTY}/hiperf/include", "${THIRD_PARTY}/hiperf/include/nonlinux/linux", "${THIRD_PARTY}/hiperf/include/nonlinux", + "//developtools/hiperf/include", + "${THIRD_PARTY}/musl", + "${THIRD_PARTY}/googletest/googletest/include", + "${THIRD_PARTY}/perf_include/musl", + "${THIRD_PARTY}/perf_include/libbpf", + "${THIRD_PARTY}/perf_include/include", + "${THIRD_PARTY}/perf_include", + "${THIRD_PARTY}/perf_include/linux", + "../hiperf_parser", + "../hiperf_parser/include", ] - if (with_perf) { - include_dirs += [ - "${THIRD_PARTY}/perf_include/musl", - "${THIRD_PARTY}/perf_include/libbpf", - "${THIRD_PARTY}/perf_include/include", - "${THIRD_PARTY}/perf_include", - "${THIRD_PARTY}/perf_include/linux", - "../hiperf_parser", - "../hiperf_parser/include", - ] + + cflags = [ "-D target_cpu_${target_cpu}" ] + if (!use_wasm && !is_win && !is_macx && !is_test) { + cflags += [ "-D HAVE_LIBUNWIND" ] } if (enable_ts_utest && !use_wasm) { - cflags = [ + cflags += [ "-fprofile-arcs", "-ftest-coverage", ] @@ -97,18 +102,18 @@ ohos_source_set("htrace_pbreader_parser_src") { } public_deps = [] deps = [ - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/services:all_type_cpp_standard", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/cpu_data:cpu_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/diskio_data:diskio_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ftrace_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hidump_data:hidump_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hilog_data:hilog_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hisysevent_data:hisysevent_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/js_memory:js_memory_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/memory_data:memory_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/native_hook:native_hook_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/network_data:network_data_encoder", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/process_data:process_data_encoder", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/services:ts_all_type_cpp_standard", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/cpu_data:cpu_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/diskio_data:diskio_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ftrace_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hidump_data:hidump_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hilog_data:hilog_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hisysevent_data:hisysevent_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/js_memory:js_memory_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/memory_data:memory_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/native_hook:native_hook_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/network_data:network_data_reader", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/process_data:process_data_reader", ] } group("htrace_pbreader_parser") { diff --git a/trace_streamer/src/parser/htrace_pbreader_parser/htrace_clock_detail_parser.cpp b/trace_streamer/src/parser/htrace_pbreader_parser/htrace_clock_detail_parser.cpp index 102e7e8e..af1d16a9 100644 --- a/trace_streamer/src/parser/htrace_pbreader_parser/htrace_clock_detail_parser.cpp +++ b/trace_streamer/src/parser/htrace_pbreader_parser/htrace_clock_detail_parser.cpp @@ -19,6 +19,8 @@ #include "process_filter.h" #include "stat_filter.h" #include "symbols_filter.h" +#include + namespace SysTuning { namespace TraceStreamer { HtraceClockDetailParser::HtraceClockDetailParser(TraceDataCache* dataCache, const TraceStreamerFilters* filters) @@ -72,32 +74,32 @@ void HtraceClockDetailParser::Parse(const ProfilerTraceFileHeader* profilerTrace std::vector snapShot; TS_LOGI("got clock snapshot"); - TS_LOGI("clockid: TS_CLOCK_BOOTTIME, ts:%llu", profilerTraceFileHeader->data.boottime); + TS_LOGI("clockid: TS_CLOCK_BOOTTIME, ts:%" PRIu64"", profilerTraceFileHeader->data.boottime); if (profilerTraceFileHeader->data.boottime) { snapShot.push_back(SnapShot{TS_CLOCK_BOOTTIME, profilerTraceFileHeader->data.boottime}); } - TS_LOGI("clockid: TS_CLOCK_REALTIME, ts:%llu", profilerTraceFileHeader->data.realtime); + TS_LOGI("clockid: TS_CLOCK_REALTIME, ts:%" PRIu64"", profilerTraceFileHeader->data.realtime); if (profilerTraceFileHeader->data.realtime) { snapShot.push_back(SnapShot{TS_CLOCK_REALTIME, profilerTraceFileHeader->data.realtime}); } - TS_LOGI("clockid: TS_CLOCK_REALTIME_COARSE, ts:%llu", profilerTraceFileHeader->data.realtimeCoarse); + TS_LOGI("clockid: TS_CLOCK_REALTIME_COARSE, ts:%" PRIu64"", profilerTraceFileHeader->data.realtimeCoarse); if (profilerTraceFileHeader->data.realtimeCoarse) { snapShot.push_back(SnapShot{TS_CLOCK_REALTIME_COARSE, profilerTraceFileHeader->data.realtimeCoarse}); } - TS_LOGI("clockid: TS_MONOTONIC, ts:%llu", profilerTraceFileHeader->data.monotonic); + TS_LOGI("clockid: TS_MONOTONIC, ts:%" PRIu64"", profilerTraceFileHeader->data.monotonic); if (profilerTraceFileHeader->data.monotonic) { snapShot.push_back(SnapShot{TS_MONOTONIC, profilerTraceFileHeader->data.monotonic}); } - TS_LOGI("clockid: TS_MONOTONIC_COARSE, ts:%llu", profilerTraceFileHeader->data.monotonicCoarse); + TS_LOGI("clockid: TS_MONOTONIC_COARSE, ts:%" PRIu64"", profilerTraceFileHeader->data.monotonicCoarse); if (profilerTraceFileHeader->data.monotonicCoarse) { snapShot.push_back(SnapShot{TS_MONOTONIC_COARSE, profilerTraceFileHeader->data.monotonicCoarse}); } - TS_LOGI("clockid: TS_MONOTONIC_RAW, ts:%llu", profilerTraceFileHeader->data.monotonicRaw); + TS_LOGI("clockid: TS_MONOTONIC_RAW, ts:%" PRIu64"", profilerTraceFileHeader->data.monotonicRaw); if (profilerTraceFileHeader->data.monotonicRaw) { snapShot.push_back(SnapShot{TS_MONOTONIC_RAW, profilerTraceFileHeader->data.monotonicRaw}); } diff --git a/trace_streamer/src/parser/htrace_pbreader_parser/htrace_cpu_data_parser.cpp b/trace_streamer/src/parser/htrace_pbreader_parser/htrace_cpu_data_parser.cpp index 49153723..8869ef6b 100644 --- a/trace_streamer/src/parser/htrace_pbreader_parser/htrace_cpu_data_parser.cpp +++ b/trace_streamer/src/parser/htrace_pbreader_parser/htrace_cpu_data_parser.cpp @@ -36,7 +36,6 @@ void HtraceCpuDataParser::Parse(ProtoReader::BytesView tracePacket, uint64_t ts) return; } if (cpuData.has_cpu_usage_info()) { - auto cpuInfo = cpuData.cpu_usage_info(); auto userLoad = cpuData.user_load(); auto sysLoad = cpuData.sys_load(); auto process_num = cpuData.process_num(); diff --git a/trace_streamer/src/parser/htrace_pbreader_parser/htrace_cpu_data_parser.h b/trace_streamer/src/parser/htrace_pbreader_parser/htrace_cpu_data_parser.h index abb3282c..5954b8eb 100644 --- a/trace_streamer/src/parser/htrace_pbreader_parser/htrace_cpu_data_parser.h +++ b/trace_streamer/src/parser/htrace_pbreader_parser/htrace_cpu_data_parser.h @@ -71,7 +71,6 @@ public: private: std::string threadStateDesc_[ProtoReader::THREAD_WAITING + 1] = {"undefined", "Running", "Sleep", "Sloped", "Watting"}; - uint64_t lastLineSeq_ = 0; }; } // namespace TraceStreamer } // namespace SysTuning diff --git a/trace_streamer/src/parser/htrace_pbreader_parser/htrace_event_parser/htrace_event_parser.cpp b/trace_streamer/src/parser/htrace_pbreader_parser/htrace_event_parser/htrace_event_parser.cpp index 0b3afb07..b228be92 100644 --- a/trace_streamer/src/parser/htrace_pbreader_parser/htrace_event_parser/htrace_event_parser.cpp +++ b/trace_streamer/src/parser/htrace_pbreader_parser/htrace_event_parser/htrace_event_parser.cpp @@ -164,7 +164,7 @@ void HtraceEventParser::ParseDataItem(HtraceDataSegment& tracePacket, BuiltinClo lastOverwrite_ = msg.overwrite(); } if (lastOverwrite_ != msg.overwrite()) { - TS_LOGW("lost events:%lu", msg.overwrite() - lastOverwrite_); + TS_LOGW("lost events:%llu", msg.overwrite() - lastOverwrite_); lastOverwrite_ = msg.overwrite(); } streamFilters_->statFilter_->IncreaseStat(TRACE_EVENT_OTHER, STAT_EVENT_DATA_LOST); @@ -176,8 +176,7 @@ void HtraceEventParser::ParseDataItem(HtraceDataSegment& tracePacket, BuiltinClo ProtoReader::BytesView event(i->ToBytes()); uint64_t timeStamp = 0; if (event.size_ > MIN_DATA_AREA && event.data_[0] == tsTag) { - const uint8_t* nextData = - ProtoReader::VarIntDecode(event.data_ + DATA_AREA_START, event.data_ + DATA_AREA_END, &timeStamp); + (void)ProtoReader::VarIntDecode(event.data_ + DATA_AREA_START, event.data_ + DATA_AREA_END, &timeStamp); } eventTimeStamp_ = timeStamp; ftraceOriginStartTime_ = std::min(ftraceOriginStartTime_, eventTimeStamp_); @@ -188,7 +187,7 @@ void HtraceEventParser::ParseDataItem(HtraceDataSegment& tracePacket, BuiltinClo traceDataCache_->UpdateTraceTime(eventTimeStamp_); ProtoReader::BytesView commonField; eventList_.push_back( - std::move(std::make_unique(eventTimeStamp_, eventCpu_, tracePacket.seg, i->ToBytes()))); + std::make_unique(eventTimeStamp_, eventCpu_, tracePacket.seg, i->ToBytes())); FilterAllEventsReader(); } } diff --git a/trace_streamer/src/parser/htrace_pbreader_parser/htrace_network_parser.cpp b/trace_streamer/src/parser/htrace_pbreader_parser/htrace_network_parser.cpp index 49597383..79f80493 100644 --- a/trace_streamer/src/parser/htrace_pbreader_parser/htrace_network_parser.cpp +++ b/trace_streamer/src/parser/htrace_pbreader_parser/htrace_network_parser.cpp @@ -44,7 +44,7 @@ void HtraceNetworkParser::Parse(ProtoReader::BytesView tracePacket, uint64_t ts) ts = streamFilters_->clockFilter_->ToPrimaryTraceTime(TS_CLOCK_REALTIME, ts); streamFilters_->statFilter_->IncreaseStat(TRACE_NETWORK, STAT_EVENT_RECEIVED); - networkData_.push_back(std::move(TsNetworkData{ts, tv_sec, tv_nsec, rx_bytes, rx_packets, tx_bytes, tx_packets})); + networkData_.push_back(TsNetworkData{ts, tv_sec, tv_nsec, rx_bytes, rx_packets, tx_bytes, tx_packets}); } void HtraceNetworkParser::Finish() { diff --git a/trace_streamer/src/parser/htrace_pbreader_parser/htrace_parser.cpp b/trace_streamer/src/parser/htrace_pbreader_parser/htrace_parser.cpp index 5e079c36..f55fc980 100644 --- a/trace_streamer/src/parser/htrace_pbreader_parser/htrace_parser.cpp +++ b/trace_streamer/src/parser/htrace_pbreader_parser/htrace_parser.cpp @@ -46,9 +46,7 @@ HtraceParser::HtraceParser(TraceDataCache* dataCache, const TraceStreamerFilters processParser_(std::make_unique(dataCache, filters)), hisyseventParser_(std::make_unique(dataCache, filters)), jsMemoryParser_(std::make_unique(dataCache, filters)), -#if WITH_PERF perfDataParser_(std::make_unique(dataCache, filters)), -#endif #ifdef SUPPORTTHREAD supportThread_(true), dataSegArray_(std::make_unique(MAX_SEG_ARRAY_SIZE)) @@ -145,11 +143,9 @@ bool HtraceParser::ReparseSymbolFilesAndResymbolization(std::string& symbolsPath std::vector& symbolsPaths) { auto parsePerfStatus = false; -#if WITH_PERF std::vector dir; dir.emplace_back(symbolsPath); parsePerfStatus = perfDataParser_->PerfReloadSymbolFiles(dir); -#endif auto parseFileSOStatus = ParserFileSO(symbolsPath, symbolsPaths); if (!parseFileSOStatus) { elfSymbolTables_.reset(); @@ -184,9 +180,7 @@ void HtraceParser::WaitForParserEnd() jsMemoryParser_->Finish(); // keep final upate perf and ebpf data time range ebpfDataParser_->Finish(); -#if WITH_PERF perfDataParser_->Finish(); -#endif htraceNativeHookParser_->Finish(); htraceMemParser_->Finish(); traceDataCache_->GetDataSourceClockIdData()->SetDataSourceClockId(DATA_SOURCE_TYPE_TRACE, @@ -391,7 +385,7 @@ void HtraceParser::ParserData(HtraceDataSegment& dataSeg) return; } if (!supportThread_) { // do it only in wasm mode, wasm noThead_ will be true - if (dataSeg.status == STAT_EVENT_DATA_INVALID) { + if (dataSeg.status == TS_PARSE_STATUS_INVALID) { streamFilters_->statFilter_->IncreaseStat(TRACE_EVENT_OTHER, STAT_EVENT_DATA_INVALID); return; } @@ -586,7 +580,6 @@ bool HtraceParser::ParseDataRecursively(std::deque::iterator& packagesB } if (profilerTraceFileHeader_.data.dataType == ProfilerTraceFileHeader::HIPERF_DATA) { if (packagesBuffer_.size() >= profilerTraceFileHeader_.data.length - PACKET_HEADER_LENGTH) { -#if WITH_PERF auto size = profilerTraceFileHeader_.data.length - PACKET_HEADER_LENGTH; perfDataParser_->InitPerfDataAndLoad(packagesBuffer_, size); currentLength -= size; @@ -594,7 +587,6 @@ bool HtraceParser::ParseDataRecursively(std::deque::iterator& packagesB profilerTraceFileHeader_.data.dataType = ProfilerTraceFileHeader::UNKNOW_TYPE; hasGotHeader_ = false; return true; -#endif } return false; } @@ -644,7 +636,7 @@ bool HtraceParser::ParseDataRecursively(std::deque::iterator& packagesB packagesBegin += nextLength_; currentLength -= nextLength_; if (nextLength_ > htraceCurentLength_) { - TS_LOGE("fatal error, data length not match nextLength_:%u, htraceCurentLength_:%llu", nextLength_, + TS_LOGE("fatal error, data length not match nextLength_:%u, htraceCurentLength_:%" PRIu64"", nextLength_, htraceCurentLength_); } htraceCurentLength_ -= nextLength_; @@ -694,7 +686,7 @@ bool HtraceParser::InitProfilerTraceFileHeader() } auto ret = memcpy_s(&profilerTraceFileHeader_, sizeof(profilerTraceFileHeader_), buffer, PACKET_HEADER_LENGTH); if (ret == -1 || profilerTraceFileHeader_.data.magic != ProfilerTraceFileHeader::HEADER_MAGIC) { - TS_LOGE("Get profiler trace file header failed! ret = %d, magic = %lx", ret, + TS_LOGE("Get profiler trace file header failed! ret = %d, magic = %llx", ret, profilerTraceFileHeader_.data.magic); return false; } @@ -702,7 +694,7 @@ bool HtraceParser::InitProfilerTraceFileHeader() TS_LOGE("Profiler Trace data is truncated!!!"); return false; } - TS_LOGI("magic = %lx, length = %llx, dataType = %llx, boottime = %llx", profilerTraceFileHeader_.data.magic, + TS_LOGI("magic = %llx, length = %" PRIu64", dataType = %x, boottime = %" PRIu64"", profilerTraceFileHeader_.data.magic, profilerTraceFileHeader_.data.length, profilerTraceFileHeader_.data.dataType, profilerTraceFileHeader_.data.boottime); #if IS_WASM diff --git a/trace_streamer/src/parser/htrace_pbreader_parser/htrace_parser.h b/trace_streamer/src/parser/htrace_pbreader_parser/htrace_parser.h index 44d4a031..cc704182 100644 --- a/trace_streamer/src/parser/htrace_pbreader_parser/htrace_parser.h +++ b/trace_streamer/src/parser/htrace_pbreader_parser/htrace_parser.h @@ -42,9 +42,7 @@ #include "htrace_symbols_detail_parser.h" #include "log.h" #include "parser_base.h" -#if WITH_PERF #include "perf_data_parser.h" -#endif #include "proto_reader_help.h" #include "string_help.h" #include "trace_data/trace_data_cache.h" @@ -55,9 +53,7 @@ namespace SysTuning { namespace TraceStreamer { using namespace SysTuning::base; using namespace OHOS::Developtools::HiPerf::ELF; -#if WITH_PERF using namespace OHOS::Developtools::HiPerf; -#endif class HtraceParser : public ParserBase { public: HtraceParser(TraceDataCache* dataCache, const TraceStreamerFilters* filters); @@ -119,9 +115,7 @@ private: std::unique_ptr processParser_; std::unique_ptr hisyseventParser_; std::unique_ptr jsMemoryParser_; -#if WITH_PERF std::unique_ptr perfDataParser_; -#endif std::unique_ptr ebpfDataParser_; std::atomic filterThreadStarted_{false}; const int32_t MAX_SEG_ARRAY_SIZE = 10000; @@ -131,7 +125,6 @@ private: bool exited_ = false; int32_t filterHead_ = 0; int32_t parseHead_ = 0; - size_t sizeAll_ = 0; size_t htraceLength_ = 1024; const int32_t sleepDur_ = 100; bool parseThreadStarted_ = false; diff --git a/trace_streamer/src/parser/print_event_parser.cpp b/trace_streamer/src/parser/print_event_parser.cpp index 63c0c943..7b9f862e 100644 --- a/trace_streamer/src/parser/print_event_parser.cpp +++ b/trace_streamer/src/parser/print_event_parser.cpp @@ -17,6 +17,7 @@ #include "frame_filter.h" #include "stat_filter.h" #include "string_to_numerical.h" +#include namespace SysTuning { namespace TraceStreamer { PrintEventParser::PrintEventParser(TraceDataCache* dataCache, const TraceStreamerFilters* filter) @@ -306,10 +307,10 @@ void PrintEventParser::HandleFrameSliceEndEvent(uint64_t ts, uint64_t pid, uint6 auto iTid = streamFilters_->processFilter_->GetInternalTid(tid); auto pos = std::find(vsyncSliceIds_.begin(), vsyncSliceIds_.end(), callStackRow); if (pos != vsyncSliceIds_.end()) { - TS_LOGD("ts:%llu, RenderSliceEnd:%llu, callStackRow:%zu", ts, tid, callStackRow); + TS_LOGD("ts:%" PRIu64", RenderSliceEnd:%" PRIu64", callStackRow:%zu", ts, tid, callStackRow); if (!streamFilters_->frameFilter_->EndVsyncEvent(ts, iTid)) { streamFilters_->statFilter_->IncreaseStat(TRACE_VSYNC, STAT_EVENT_NOTMATCH); - TS_LOGW("ts:%llu, RenderSliceEnd:%llu, callStackRow:%zu failed", ts, tid, callStackRow); + TS_LOGW("ts:%" PRIu64", RenderSliceEnd:%" PRIu64", callStackRow:%zu failed", ts, tid, callStackRow); } vsyncSliceIds_.erase(pos); } @@ -322,10 +323,10 @@ void PrintEventParser::HandleFrameQueueEndEvent(uint64_t ts, uint64_t pid, uint6 auto iTid = streamFilters_->processFilter_->GetInternalTid(tid); auto pos = std::find(frameCallIds_.begin(), frameCallIds_.end(), callStackRow); if (pos != frameCallIds_.end()) { - TS_LOGD("ts:%llu, frameSliceEnd:%u", ts, tid); + TS_LOGD("ts:%" PRIu64", frameSliceEnd:%" PRIu64"", ts, tid); if (!streamFilters_->frameFilter_->EndFrameQueue(ts, iTid)) { streamFilters_->statFilter_->IncreaseStat(TRACE_FRAMEQUEUE, STAT_EVENT_NOTMATCH); - TS_LOGW("ts:%llu, frameSliceEnd:%lu failed", ts, tid); + TS_LOGW("ts:%" PRIu64", frameSliceEnd:%" PRIu64" failed", ts, tid); } frameCallIds_.erase(pos); } diff --git a/trace_streamer/src/proto_reader/BUILD.gn b/trace_streamer/src/proto_reader/BUILD.gn index 531f7ab8..5768c79b 100755 --- a/trace_streamer/src/proto_reader/BUILD.gn +++ b/trace_streamer/src/proto_reader/BUILD.gn @@ -14,12 +14,10 @@ import("//build/ohos.gni") import("../../build/ts.gni") ohos_source_set("proto_reader") { - subsystem_name = "trace_streamer" - part_name = "proto_reader" - public_configs = [ "../../gn:default_config" ] + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" public_deps = [] include_dirs = [ "include" ] - deps = [ "../../gn:default_deps" ] sources = [ "proto_reader.cpp" ] include_dirs += [ "../include", diff --git a/trace_streamer/src/proto_reader/include/data_area.h b/trace_streamer/src/proto_reader/include/data_area.h index 1a3ac3fe..f5b8a191 100644 --- a/trace_streamer/src/proto_reader/include/data_area.h +++ b/trace_streamer/src/proto_reader/include/data_area.h @@ -83,14 +83,14 @@ public: { float res; uint32_t value32 = static_cast(intValue_); - (void*)memcpy_s(&res, sizeof(res), &value32, sizeof(value32)); + (void)memcpy_s(&res, sizeof(res), &value32, sizeof(value32)); return res; } double ToDouble() const { double res; - (void*)memcpy_s(&res, sizeof(res), &intValue_, sizeof(intValue_)); + (void)memcpy_s(&res, sizeof(res), &intValue_, sizeof(intValue_)); return res; } diff --git a/trace_streamer/src/proto_reader/proto_reader.cpp b/trace_streamer/src/proto_reader/proto_reader.cpp index 7c0db328..53c993b6 100644 --- a/trace_streamer/src/proto_reader/proto_reader.cpp +++ b/trace_streamer/src/proto_reader/proto_reader.cpp @@ -109,7 +109,7 @@ bool ProtoReaderBase::ParseFixed64Value(ParseDataAreaResult& result, return false; } - (void*)memcpy_s(&intValue, sizeof(uint64_t), startAddr, sizeof(uint64_t)); + (void)memcpy_s(&intValue, sizeof(uint64_t), startAddr, sizeof(uint64_t)); result.dataArea.SetDataAreaIntValue(intValue); result.next = cursor; result.status = OK; @@ -125,7 +125,7 @@ bool ProtoReaderBase::ParseFixed32Value(ParseDataAreaResult& result, if (cursor > endAddr) { return false; } - (void*)memcpy_s(&intValue, sizeof(uint64_t), startAddr, sizeof(uint32_t)); + (void)memcpy_s(&intValue, sizeof(uint64_t), startAddr, sizeof(uint32_t)); result.dataArea.SetDataAreaIntValue(intValue); result.next = cursor; result.status = OK; @@ -227,7 +227,7 @@ void ProtoReaderBase::MoveToLargerHeapStorage() { uint32_t largerVolume = volume_ << 1; std::unique_ptr largerVolumeStorage(new DataArea[largerVolume]); - (void*)memcpy_s(&largerVolumeStorage[0], sizeof(DataArea) * largerVolume, dataAreas_, sizeof(DataArea) * size_); + (void)memcpy_s(&largerVolumeStorage[0], sizeof(DataArea) * largerVolume, dataAreas_, sizeof(DataArea) * size_); lagerHeapStorage_ = std::move(largerVolumeStorage); dataAreas_ = &lagerHeapStorage_[0]; volume_ = largerVolume; diff --git a/trace_streamer/src/proto_reader/protoc_plugin/BUILD.gn b/trace_streamer/src/proto_reader/protoc_plugin/BUILD.gn index 6cba620c..b88c8db0 100755 --- a/trace_streamer/src/proto_reader/protoc_plugin/BUILD.gn +++ b/trace_streamer/src/proto_reader/protoc_plugin/BUILD.gn @@ -13,12 +13,13 @@ import("//build/ohos.gni") import("../../../build/ts.gni") ohos_executable("protoreader_plugin") { - subsystem_name = "protoreader_plugin" - part_name = "protoreader_plugin" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "proto_reader_plugin.cpp" ] deps = [ "${SRC}/base:string_help", - "${THIRD_PARTY}/protobuf:protoc_lib", + "${THIRD_PARTY}/protobuf:protobuf(${host_toolchain})", + "${THIRD_PARTY}/protobuf:protoc_lib(${host_toolchain})", ] include_dirs = [ "${SRC}/base", diff --git a/trace_streamer/src/proto_reader/protoc_plugin/proto_reader_plugin.cpp b/trace_streamer/src/proto_reader/protoc_plugin/proto_reader_plugin.cpp index d95bf7a4..63dfbdea 100644 --- a/trace_streamer/src/proto_reader/protoc_plugin/proto_reader_plugin.cpp +++ b/trace_streamer/src/proto_reader/protoc_plugin/proto_reader_plugin.cpp @@ -18,7 +18,6 @@ namespace SysTuning { namespace ProtoReader { const std::string SYS_NAMESPACE = "SysTuning"; -const int32_t MAX_DECODER_FIELDID = 999; const int32_t MIN_OPTIONS_SIZE = 2; bool ProtoReaderPlugin::Generate(const FileDescriptor* file, diff --git a/trace_streamer/src/protos/protos.gni b/trace_streamer/src/protos/protos.gni index b4c7ee79..142b06ff 100755 --- a/trace_streamer/src/protos/protos.gni +++ b/trace_streamer/src/protos/protos.gni @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("../../build/config.gni") +import("../../build/ts.gni") subsys_name = OHOS_PROFILER_SUBSYS_NAME part_name = OHOS_PROFILER_PART_NAME diff --git a/trace_streamer/src/protos/services/BUILD.gn b/trace_streamer/src/protos/services/BUILD.gn index a9ef5f82..1b7ef2ac 100755 --- a/trace_streamer/src/protos/services/BUILD.gn +++ b/trace_streamer/src/protos/services/BUILD.gn @@ -44,7 +44,7 @@ all_type_codegen_all += all_type_codegen all_type_codegen_all += all_type_codegen_standard all_type_codegen_all += all_type_codegen_reader -action("all_type_gen") { +action("ts_all_type_gen") { script = "${OHOS_TRACE_STREAMER_DIR_PROTOC}" sources = all_type_proto outputs = all_type_codegen_all @@ -60,14 +60,14 @@ action("all_type_gen") { args += rebase_path(sources, root_build_dir) if (!use_wasm && !is_test && !is_fuzz) { deps = [ - "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc", - "${SRC}/proto_reader/protoc_plugin:protoreader_plugin", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc(${host_toolchain})", + "${SRC}/proto_reader/protoc_plugin:protoreader_plugin(${host_toolchain})", ] } } -ohos_source_set("all_type_cpp_standard") { - deps = [ ":all_type_gen" ] +ohos_source_set("ts_all_type_cpp_standard") { + deps = [ ":ts_all_type_gen" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", diff --git a/trace_streamer/src/protos/types/plugins/agent_data/BUILD.gn b/trace_streamer/src/protos/types/plugins/agent_data/BUILD.gn index 4f9e90ee..bf6d8bc2 100755 --- a/trace_streamer/src/protos/types/plugins/agent_data/BUILD.gn +++ b/trace_streamer/src/protos/types/plugins/agent_data/BUILD.gn @@ -49,7 +49,7 @@ config("agent_include_config") { } ####################################################### -action("agent_data_cpp_gen") { +action("ts_agent_data_cpp_gen") { script = "${OHOS_TRACE_STREAMER_DIR_PROTOC}" sources = agent_sources outputs = agent_data_codegen_all @@ -65,14 +65,16 @@ action("agent_data_cpp_gen") { args += rebase_path(sources, root_build_dir) if (!use_wasm && !is_test && !is_fuzz) { deps = [ - "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc", - "${SRC}/proto_reader/protoc_plugin:protoreader_plugin", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc(${host_toolchain})", + "${SRC}/proto_reader/protoc_plugin:protoreader_plugin(${host_toolchain})", ] } } -ohos_source_set("agent_data_cpp") { - deps = [ ":agent_data_cpp_gen" ] +ohos_source_set("ts_agent_data_cpp") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_agent_data_cpp_gen" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", diff --git a/trace_streamer/src/protos/types/plugins/bytrace_plugin/BUILD.gn b/trace_streamer/src/protos/types/plugins/bytrace_plugin/BUILD.gn index ffdc82ba..beb68553 100755 --- a/trace_streamer/src/protos/types/plugins/bytrace_plugin/BUILD.gn +++ b/trace_streamer/src/protos/types/plugins/bytrace_plugin/BUILD.gn @@ -38,7 +38,7 @@ foreach(proto, bytrace_plugin_protos_defines) { bytrace_plugin_protos_codegen_all += bytrace_plugin_protos_codegen bytrace_plugin_protos_codegen_all += bytrace_plugin_protos_codegen_standard -action("bytrace_plugin_protos_protoc") { +action("ts_bytrace_plugin_protos_protoc") { script = "${OHOS_TRACE_STREAMER_DIR_PROTOC}" sources = bytrace_plugin_protos_defines outputs = bytrace_plugin_protos_codegen_all @@ -58,8 +58,10 @@ config("bytrace_plugin_protos_config") { include_dirs = [ "$proto_out_dir" ] } -ohos_source_set("bytrace_plugin_protos_cpp") { - deps = [ ":bytrace_plugin_protos_protoc" ] +ohos_source_set("ts_bytrace_plugin_protos_cpp") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_bytrace_plugin_protos_protoc" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", @@ -69,8 +71,10 @@ ohos_source_set("bytrace_plugin_protos_cpp") { sources = bytrace_plugin_protos_codegen } -ohos_source_set("bytrace_plugin_protos_cpp_standard") { - deps = [ ":bytrace_plugin_protos_protoc" ] +ohos_source_set("ts_bytrace_plugin_protos_cpp_standard") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_bytrace_plugin_protos_protoc" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", diff --git a/trace_streamer/src/protos/types/plugins/cpu_data/BUILD.gn b/trace_streamer/src/protos/types/plugins/cpu_data/BUILD.gn index 01da3bd2..b25017e4 100755 --- a/trace_streamer/src/protos/types/plugins/cpu_data/BUILD.gn +++ b/trace_streamer/src/protos/types/plugins/cpu_data/BUILD.gn @@ -42,7 +42,7 @@ config("cpu_include_config") { } ####################################################### -action("cpu_data_cpp_gen") { +action("ts_cpu_data_cpp_gen") { script = "${OHOS_TRACE_STREAMER_DIR_PROTOC}" sources = cpu_data_sources outputs = cpu_data_codegen_all @@ -58,14 +58,16 @@ action("cpu_data_cpp_gen") { args += rebase_path(sources, root_build_dir) if (!use_wasm && !is_test && !is_fuzz) { deps = [ - "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc", - "${SRC}/proto_reader/protoc_plugin:protoreader_plugin", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc(${host_toolchain})", + "${SRC}/proto_reader/protoc_plugin:protoreader_plugin(${host_toolchain})", ] } } -ohos_source_set("cpu_data_cpp") { - deps = [ ":cpu_data_cpp_gen" ] +ohos_source_set("ts_cpu_data_cpp") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_cpu_data_cpp_gen" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", @@ -75,8 +77,10 @@ ohos_source_set("cpu_data_cpp") { sources = cpu_data_codegen } -ohos_source_set("cpu_data_encoder") { - deps = [ ":cpu_data_cpp_gen" ] +ohos_source_set("cpu_data_reader") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_cpu_data_cpp_gen" ] include_dirs = [ "$proto_out_dir" ] public_configs = [ ":cpu_include_config" ] sources = cpu_data_codegen_reader diff --git a/trace_streamer/src/protos/types/plugins/diskio_data/BUILD.gn b/trace_streamer/src/protos/types/plugins/diskio_data/BUILD.gn index 66df231b..3e10a2de 100755 --- a/trace_streamer/src/protos/types/plugins/diskio_data/BUILD.gn +++ b/trace_streamer/src/protos/types/plugins/diskio_data/BUILD.gn @@ -42,7 +42,7 @@ config("diskio_include_config") { } ####################################################### -action("diskio_data_cpp_gen") { +action("ts_diskio_data_cpp_gen") { script = "${OHOS_TRACE_STREAMER_DIR_PROTOC}" sources = diskio_data_sources outputs = diskio_data_codegen_all @@ -58,14 +58,16 @@ action("diskio_data_cpp_gen") { args += rebase_path(sources, root_build_dir) if (!use_wasm && !is_test && !is_fuzz) { deps = [ - "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc", - "${SRC}/proto_reader/protoc_plugin:protoreader_plugin", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc(${host_toolchain})", + "${SRC}/proto_reader/protoc_plugin:protoreader_plugin(${host_toolchain})", ] } } -ohos_source_set("diskio_data_cpp") { - deps = [ ":diskio_data_cpp_gen" ] +ohos_source_set("ts_diskio_data_cpp") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_diskio_data_cpp_gen" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", @@ -75,8 +77,10 @@ ohos_source_set("diskio_data_cpp") { sources = diskio_data_codegen } -ohos_source_set("diskio_data_encoder") { - deps = [ ":diskio_data_cpp_gen" ] +ohos_source_set("diskio_data_reader") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_diskio_data_cpp_gen" ] include_dirs = [ "$proto_out_dir" ] public_configs = [ ":diskio_include_config" ] sources = diskio_data_codegen_reader diff --git a/trace_streamer/src/protos/types/plugins/ftrace_data/default/BUILD.gn b/trace_streamer/src/protos/types/plugins/ftrace_data/default/BUILD.gn index b22b0394..8979ba66 100755 --- a/trace_streamer/src/protos/types/plugins/ftrace_data/default/BUILD.gn +++ b/trace_streamer/src/protos/types/plugins/ftrace_data/default/BUILD.gn @@ -40,7 +40,7 @@ foreach(proto, ftrace_data_proto) { all_proto_codegen = ftrace_data_codegen all_proto_codegen += ftrace_data_codegen_reader -action("all_proto_gen") { +action("ts_all_proto_gen") { script = "${OHOS_TRACE_STREAMER_DIR_PROTOC}" sources = all_proto outputs = all_proto_codegen @@ -56,8 +56,8 @@ action("all_proto_gen") { args += rebase_path(sources, root_build_dir) if (!use_wasm && !is_test && !is_fuzz) { deps = [ - "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc", - "${SRC}/proto_reader/protoc_plugin:protoreader_plugin", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc(${host_toolchain})", + "${SRC}/proto_reader/protoc_plugin:protoreader_plugin(${host_toolchain})", ] } } @@ -66,8 +66,10 @@ config("public_configs") { include_dirs = [ "$proto_out_dir" ] } -ohos_source_set("ftrace_data_cpp") { - deps = [ ":all_proto_gen" ] +ohos_source_set("ts_ftrace_data_cpp") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_all_proto_gen" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", @@ -77,8 +79,10 @@ ohos_source_set("ftrace_data_cpp") { sources = ftrace_data_codegen } -ohos_source_set("ftrace_data_encoder") { - deps = [ ":all_proto_gen" ] +ohos_source_set("ftrace_data_reader") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_all_proto_gen" ] include_dirs = [ "$proto_out_dir" ] public_configs = [ ":public_configs" ] sources = ftrace_data_codegen_reader diff --git a/trace_streamer/src/protos/types/plugins/hidump_data/BUILD.gn b/trace_streamer/src/protos/types/plugins/hidump_data/BUILD.gn index 3a977bc3..36bb4f6c 100755 --- a/trace_streamer/src/protos/types/plugins/hidump_data/BUILD.gn +++ b/trace_streamer/src/protos/types/plugins/hidump_data/BUILD.gn @@ -42,7 +42,7 @@ config("hidump_include_config") { } ####################################################### -action("hidump_data_cpp_gen") { +action("ts_hidump_data_cpp_gen") { script = "${OHOS_TRACE_STREAMER_DIR_PROTOC}" sources = hidump_data_sources outputs = hidump_data_codegen_all @@ -58,14 +58,16 @@ action("hidump_data_cpp_gen") { args += rebase_path(sources, root_build_dir) if (!use_wasm && !is_test && !is_fuzz) { deps = [ - "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc", - "${SRC}/proto_reader/protoc_plugin:protoreader_plugin", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc(${host_toolchain})", + "${SRC}/proto_reader/protoc_plugin:protoreader_plugin(${host_toolchain})", ] } } -ohos_source_set("hidump_data_cpp") { - deps = [ ":hidump_data_cpp_gen" ] +ohos_source_set("ts_hidump_data_cpp") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_hidump_data_cpp_gen" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", @@ -75,8 +77,10 @@ ohos_source_set("hidump_data_cpp") { sources = hidump_data_codegen } -ohos_source_set("hidump_data_encoder") { - deps = [ ":hidump_data_cpp_gen" ] +ohos_source_set("hidump_data_reader") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_hidump_data_cpp_gen" ] include_dirs = [ "$proto_out_dir" ] public_configs = [ ":hidump_include_config" ] sources = hidump_data_codegen_reader diff --git a/trace_streamer/src/protos/types/plugins/hiebpf_data/BUILD.gn b/trace_streamer/src/protos/types/plugins/hiebpf_data/BUILD.gn index b1a0d404..d6e71f41 100755 --- a/trace_streamer/src/protos/types/plugins/hiebpf_data/BUILD.gn +++ b/trace_streamer/src/protos/types/plugins/hiebpf_data/BUILD.gn @@ -61,6 +61,8 @@ action("hiebpf_data_cpp_gen") { } ohos_source_set("hiebpf_data_cpp") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" deps = [ ":hiebpf_data_cpp_gen" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", @@ -72,6 +74,8 @@ ohos_source_set("hiebpf_data_cpp") { } ohos_source_set("hiebpf_data_cpp_standard") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" deps = [ ":hiebpf_data_cpp_gen" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", diff --git a/trace_streamer/src/protos/types/plugins/hilog_data/BUILD.gn b/trace_streamer/src/protos/types/plugins/hilog_data/BUILD.gn index b506730a..7b6f2a8d 100755 --- a/trace_streamer/src/protos/types/plugins/hilog_data/BUILD.gn +++ b/trace_streamer/src/protos/types/plugins/hilog_data/BUILD.gn @@ -42,7 +42,7 @@ config("hilog_include_config") { } ####################################################### -action("hilog_data_cpp_gen") { +action("ts_hilog_data_cpp_gen") { script = "${OHOS_TRACE_STREAMER_DIR_PROTOC}" sources = hilog_data_sources outputs = hilog_data_codegen_all @@ -58,14 +58,16 @@ action("hilog_data_cpp_gen") { args += rebase_path(sources, root_build_dir) if (!use_wasm && !is_test && !is_fuzz) { deps = [ - "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc", - "${SRC}/proto_reader/protoc_plugin:protoreader_plugin", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc(${host_toolchain})", + "${SRC}/proto_reader/protoc_plugin:protoreader_plugin(${host_toolchain})", ] } } -ohos_source_set("hilog_data_cpp") { - deps = [ ":hilog_data_cpp_gen" ] +ohos_source_set("ts_hilog_data_cpp") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_hilog_data_cpp_gen" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", @@ -75,8 +77,10 @@ ohos_source_set("hilog_data_cpp") { sources = hilog_data_codegen } -ohos_source_set("hilog_data_encoder") { - deps = [ ":hilog_data_cpp_gen" ] +ohos_source_set("hilog_data_reader") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_hilog_data_cpp_gen" ] include_dirs = [ "$proto_out_dir" ] public_configs = [ ":hilog_include_config" ] sources = hilog_data_codegen_reader diff --git a/trace_streamer/src/protos/types/plugins/hiperf_call_plugin/BUILD.gn b/trace_streamer/src/protos/types/plugins/hiperf_call_plugin/BUILD.gn index 68d44100..d597fe40 100755 --- a/trace_streamer/src/protos/types/plugins/hiperf_call_plugin/BUILD.gn +++ b/trace_streamer/src/protos/types/plugins/hiperf_call_plugin/BUILD.gn @@ -31,7 +31,7 @@ foreach(proto, hiperf_call_plugin_protos_defines) { ] } -action("hiperf_call_plugin_protos_protoc") { +action("ts_hiperf_call_plugin_protos_protoc") { script = "${OHOS_TRACE_STREAMER_DIR_PROTOC}" sources = hiperf_call_plugin_protos_defines outputs = hiperf_call_plugin_protos_codegen @@ -50,8 +50,10 @@ config("hiperf_call_plugin_protos_config") { include_dirs = [ "$proto_out_dir" ] } -source_set("hiperf_call_plugin_protos_cpp") { - deps = [ ":hiperf_call_plugin_protos_protoc" ] +source_set("ts_hiperf_call_plugin_protos_cpp") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_hiperf_call_plugin_protos_protoc" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", diff --git a/trace_streamer/src/protos/types/plugins/hiperf_data/BUILD.gn b/trace_streamer/src/protos/types/plugins/hiperf_data/BUILD.gn index 9364c9ca..175cd2db 100755 --- a/trace_streamer/src/protos/types/plugins/hiperf_data/BUILD.gn +++ b/trace_streamer/src/protos/types/plugins/hiperf_data/BUILD.gn @@ -38,7 +38,7 @@ foreach(proto, hiperf_data_protos_defines) { hiperf_data_protos_codegen_all += hiperf_data_protos_codegen hiperf_data_protos_codegen_all += hiperf_data_protos_codegen_standard -action("hiperf_data_protos_protoc") { +action("ts_hiperf_data_protos_protoc") { script = "${OHOS_TRACE_STREAMER_DIR_PROTOC}" sources = hiperf_data_protos_defines outputs = hiperf_data_protos_codegen_all @@ -58,8 +58,10 @@ config("hiperf_data_protos_config") { include_dirs = [ "$proto_out_dir" ] } -ohos_source_set("hiperf_data_cpp") { - deps = [ ":hiperf_data_protos_protoc" ] +ohos_source_set("ts_hiperf_data_cpp") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_hiperf_data_protos_protoc" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", @@ -69,8 +71,10 @@ ohos_source_set("hiperf_data_cpp") { sources = hiperf_data_protos_codegen } -ohos_source_set("hiperf_data_cpp_standard") { - deps = [ ":hiperf_data_protos_protoc" ] +ohos_source_set("ts_hiperf_data_cpp_standard") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_hiperf_data_protos_protoc" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", diff --git a/trace_streamer/src/protos/types/plugins/hisysevent_data/BUILD.gn b/trace_streamer/src/protos/types/plugins/hisysevent_data/BUILD.gn index 76cca46b..933ef5c5 100644 --- a/trace_streamer/src/protos/types/plugins/hisysevent_data/BUILD.gn +++ b/trace_streamer/src/protos/types/plugins/hisysevent_data/BUILD.gn @@ -44,7 +44,7 @@ config("hisysevent_include_config") { } ####################################################### -action("hisysevent_data_cpp_gen") { +action("ts_hisysevent_data_cpp_gen") { script = "${OHOS_TRACE_STREAMER_DIR_PROTOC}" sources = hisysevent_data_sources outputs = hisysevent_data_codegen_all @@ -60,14 +60,16 @@ action("hisysevent_data_cpp_gen") { args += rebase_path(sources, root_build_dir) if (!use_wasm && !is_test && !is_fuzz) { deps = [ - "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc", - "${SRC}/proto_reader/protoc_plugin:protoreader_plugin", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc(${host_toolchain})", + "${SRC}/proto_reader/protoc_plugin:protoreader_plugin(${host_toolchain})", ] } } -ohos_source_set("hisysevent_data_cpp") { - deps = [ ":hisysevent_data_cpp_gen" ] +ohos_source_set("ts_hisysevent_data_cpp") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_hisysevent_data_cpp_gen" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", @@ -77,8 +79,10 @@ ohos_source_set("hisysevent_data_cpp") { sources = hisysevent_data_codegen } -ohos_source_set("hisysevent_data_encoder") { - deps = [ ":hisysevent_data_cpp_gen" ] +ohos_source_set("hisysevent_data_reader") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_hisysevent_data_cpp_gen" ] include_dirs = [ "$proto_out_dir" ] public_configs = [ ":hisysevent_include_config" ] sources = hisysevent_data_codegen_reader diff --git a/trace_streamer/src/protos/types/plugins/js_memory/BUILD.gn b/trace_streamer/src/protos/types/plugins/js_memory/BUILD.gn index 34d4badc..959ac455 100755 --- a/trace_streamer/src/protos/types/plugins/js_memory/BUILD.gn +++ b/trace_streamer/src/protos/types/plugins/js_memory/BUILD.gn @@ -42,7 +42,7 @@ config("js_memory_include_config") { } ####################################################### -action("js_memory_data_cpp_gen") { +action("ts_js_memory_data_cpp_gen") { script = "${OHOS_TRACE_STREAMER_DIR_PROTOC}" sources = js_memory_data_sources outputs = js_memory_data_codegen_all @@ -58,14 +58,16 @@ action("js_memory_data_cpp_gen") { args += rebase_path(sources, root_build_dir) if (!use_wasm && !is_test && !is_fuzz) { deps = [ - "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc", - "${SRC}/proto_reader/protoc_plugin:protoreader_plugin", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc(${host_toolchain})", + "${SRC}/proto_reader/protoc_plugin:protoreader_plugin(${host_toolchain})", ] } } -ohos_source_set("js_memory_data_cpp") { - deps = [ ":js_memory_data_cpp_gen" ] +ohos_source_set("ts_js_memory_data_cpp") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_js_memory_data_cpp_gen" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", @@ -75,8 +77,10 @@ ohos_source_set("js_memory_data_cpp") { sources = js_memory_data_codegen } -ohos_source_set("js_memory_data_encoder") { - deps = [ ":js_memory_data_cpp_gen" ] +ohos_source_set("js_memory_data_reader") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_js_memory_data_cpp_gen" ] include_dirs = [ "$proto_out_dir" ] public_configs = [ ":js_memory_include_config" ] sources = js_memory_data_codegen_reader diff --git a/trace_streamer/src/protos/types/plugins/memory_data/BUILD.gn b/trace_streamer/src/protos/types/plugins/memory_data/BUILD.gn index c713e08b..df62e2ad 100755 --- a/trace_streamer/src/protos/types/plugins/memory_data/BUILD.gn +++ b/trace_streamer/src/protos/types/plugins/memory_data/BUILD.gn @@ -44,7 +44,7 @@ config("memory_include_config") { } ####################################################### -action("memory_data_cpp_gen") { +action("ts_memory_data_cpp_gen") { script = "${OHOS_TRACE_STREAMER_DIR_PROTOC}" sources = memory_data_sources outputs = memory_data_codegen_all @@ -60,14 +60,16 @@ action("memory_data_cpp_gen") { args += rebase_path(sources, root_build_dir) if (!use_wasm && !is_test && !is_fuzz) { deps = [ - "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc", - "${SRC}/proto_reader/protoc_plugin:protoreader_plugin", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc(${host_toolchain})", + "${SRC}/proto_reader/protoc_plugin:protoreader_plugin(${host_toolchain})", ] } } -ohos_source_set("memory_data_cpp") { - deps = [ ":memory_data_cpp_gen" ] +ohos_source_set("ts_memory_data_cpp") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_memory_data_cpp_gen" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", @@ -77,8 +79,10 @@ ohos_source_set("memory_data_cpp") { sources = memory_data_codegen } -ohos_source_set("memory_data_encoder") { - deps = [ ":memory_data_cpp_gen" ] +ohos_source_set("memory_data_reader") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_memory_data_cpp_gen" ] include_dirs = [ "$proto_out_dir" ] public_configs = [ ":memory_include_config" ] sources = memory_data_codegen_reader diff --git a/trace_streamer/src/protos/types/plugins/native_hook/BUILD.gn b/trace_streamer/src/protos/types/plugins/native_hook/BUILD.gn index 81140cad..4007a7b1 100755 --- a/trace_streamer/src/protos/types/plugins/native_hook/BUILD.gn +++ b/trace_streamer/src/protos/types/plugins/native_hook/BUILD.gn @@ -42,7 +42,7 @@ config("native_hook_include_config") { } ####################################################### -action("native_hook_cpp_gen") { +action("ts_native_hook_cpp_gen") { script = "${OHOS_TRACE_STREAMER_DIR_PROTOC}" sources = native_hook_sources outputs = native_hook_codegen_all @@ -58,14 +58,16 @@ action("native_hook_cpp_gen") { args += rebase_path(sources, root_build_dir) if (!use_wasm && !is_test && !is_fuzz) { deps = [ - "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc", - "${SRC}/proto_reader/protoc_plugin:protoreader_plugin", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc(${host_toolchain})", + "${SRC}/proto_reader/protoc_plugin:protoreader_plugin(${host_toolchain})", ] } } -ohos_source_set("native_hook_cpp") { - deps = [ ":native_hook_cpp_gen" ] +ohos_source_set("ts_native_hook_cpp") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_native_hook_cpp_gen" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", @@ -74,8 +76,10 @@ ohos_source_set("native_hook_cpp") { public_configs = [ ":native_hook_include_config" ] sources = native_hook_codegen } -source_set("native_hook_data_encoder") { - deps = [ ":native_hook_cpp_gen" ] +ohos_source_set("native_hook_data_reader") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_native_hook_cpp_gen" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", diff --git a/trace_streamer/src/protos/types/plugins/network_data/BUILD.gn b/trace_streamer/src/protos/types/plugins/network_data/BUILD.gn index 381c756c..5cff948a 100755 --- a/trace_streamer/src/protos/types/plugins/network_data/BUILD.gn +++ b/trace_streamer/src/protos/types/plugins/network_data/BUILD.gn @@ -42,7 +42,7 @@ config("network_include_config") { } ####################################################### -action("network_data_cpp_gen") { +action("ts_network_data_cpp_gen") { script = "${OHOS_TRACE_STREAMER_DIR_PROTOC}" sources = network_data_sources outputs = network_data_codegen_all @@ -58,14 +58,16 @@ action("network_data_cpp_gen") { args += rebase_path(sources, root_build_dir) if (!use_wasm && !is_test && !is_fuzz) { deps = [ - "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc", - "${SRC}/proto_reader/protoc_plugin:protoreader_plugin", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc(${host_toolchain})", + "${SRC}/proto_reader/protoc_plugin:protoreader_plugin(${host_toolchain})", ] } } -ohos_source_set("network_data_cpp") { - deps = [ ":network_data_cpp_gen" ] +ohos_source_set("ts_network_data_cpp") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_network_data_cpp_gen" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", @@ -75,8 +77,10 @@ ohos_source_set("network_data_cpp") { sources = network_data_codegen } -ohos_source_set("network_data_encoder") { - deps = [ ":network_data_cpp_gen" ] +ohos_source_set("network_data_reader") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_network_data_cpp_gen" ] include_dirs = [ "$proto_out_dir" ] public_configs = [ ":network_include_config" ] sources = network_data_codegen_reader diff --git a/trace_streamer/src/protos/types/plugins/process_data/BUILD.gn b/trace_streamer/src/protos/types/plugins/process_data/BUILD.gn index 1812bdff..4a6c27ae 100755 --- a/trace_streamer/src/protos/types/plugins/process_data/BUILD.gn +++ b/trace_streamer/src/protos/types/plugins/process_data/BUILD.gn @@ -42,7 +42,7 @@ config("process_include_config") { } ####################################################### -action("process_data_cpp_gen") { +action("ts_process_data_cpp_gen") { script = "${OHOS_TRACE_STREAMER_DIR_PROTOC}" sources = process_data_sources outputs = process_data_codegen_all @@ -58,14 +58,16 @@ action("process_data_cpp_gen") { args += rebase_path(sources, root_build_dir) if (!use_wasm && !is_test && !is_fuzz) { deps = [ - "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc", - "${SRC}/proto_reader/protoc_plugin:protoreader_plugin", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc(${host_toolchain})", + "${SRC}/proto_reader/protoc_plugin:protoreader_plugin(${host_toolchain})", ] } } -ohos_source_set("process_data_cpp") { - deps = [ ":process_data_cpp_gen" ] +ohos_source_set("ts_process_data_cpp") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_process_data_cpp_gen" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", @@ -75,8 +77,10 @@ ohos_source_set("process_data_cpp") { sources = process_data_codegen } -ohos_source_set("process_data_encoder") { - deps = [ ":process_data_cpp_gen" ] +ohos_source_set("process_data_reader") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" + deps = [ ":ts_process_data_cpp_gen" ] include_dirs = [ "$proto_out_dir" ] public_configs = [ ":process_include_config" ] sources = process_data_codegen_reader diff --git a/trace_streamer/src/protos/types/plugins/sample_data/BUILD.gn b/trace_streamer/src/protos/types/plugins/sample_data/BUILD.gn index cee7f3d3..21a6aa64 100755 --- a/trace_streamer/src/protos/types/plugins/sample_data/BUILD.gn +++ b/trace_streamer/src/protos/types/plugins/sample_data/BUILD.gn @@ -66,6 +66,8 @@ action("sample_data_cpp_gen") { } ohos_source_set("sample_data_cpp") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" deps = [ ":sample_data_cpp_gen" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", @@ -77,6 +79,8 @@ ohos_source_set("sample_data_cpp") { } ohos_source_set("sample_data_encoder") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" deps = [ ":sample_data_cpp_gen" ] include_dirs = [ "$proto_out_dir" ] public_configs = [ ":sample_include_config" ] diff --git a/trace_streamer/src/protos/types/plugins/stream_data/BUILD.gn b/trace_streamer/src/protos/types/plugins/stream_data/BUILD.gn index 4aa7d544..f385b92e 100755 --- a/trace_streamer/src/protos/types/plugins/stream_data/BUILD.gn +++ b/trace_streamer/src/protos/types/plugins/stream_data/BUILD.gn @@ -66,6 +66,8 @@ action("stream_data_cpp_gen") { } ohos_source_set("stream_data_cpp") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" deps = [ ":stream_data_cpp_gen" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", @@ -77,6 +79,8 @@ ohos_source_set("stream_data_cpp") { } ohos_source_set("stream_data_encoder") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" deps = [ ":stream_data_cpp_gen" ] include_dirs = [ "$proto_out_dir" ] public_configs = [ ":stream_include_config" ] diff --git a/trace_streamer/src/protos/types/plugins/test_data/BUILD.gn b/trace_streamer/src/protos/types/plugins/test_data/BUILD.gn index f932dbb1..4c00f903 100644 --- a/trace_streamer/src/protos/types/plugins/test_data/BUILD.gn +++ b/trace_streamer/src/protos/types/plugins/test_data/BUILD.gn @@ -55,13 +55,15 @@ action("test_data_cpp_gen") { args += rebase_path(sources, root_build_dir) if (!use_wasm && !is_test && !is_fuzz) { deps = [ - "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc", - "${SRC}/proto_reader/protoc_plugin:protoreader_plugin", + "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protoc(${host_toolchain})", + "${SRC}/proto_reader/protoc_plugin:protoreader_plugin(${host_toolchain})", ] } } source_set("test_data_cpp") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" deps = [ ":test_data_cpp_gen" ] public_deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", @@ -73,6 +75,8 @@ source_set("test_data_cpp") { } ohos_source_set("test_data_encoder") { + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" deps = [ ":test_data_cpp_gen" ] include_dirs = [ "$proto_out_dir" ] public_configs = [ ":test_include_config" ] diff --git a/trace_streamer/src/rpc/rpc_server.cpp b/trace_streamer/src/rpc/rpc_server.cpp index bd80be57..7b66cfd8 100644 --- a/trace_streamer/src/rpc/rpc_server.cpp +++ b/trace_streamer/src/rpc/rpc_server.cpp @@ -31,7 +31,6 @@ } while (0) namespace SysTuning { namespace TraceStreamer { -const int32_t MAX_LEN_STR = 100; uint32_t g_fileLen = 0; FILE* g_importFileFd = nullptr; bool RpcServer::ParseData(const uint8_t* data, size_t len, ResultCallBack resultCallBack) @@ -71,7 +70,6 @@ int32_t RpcServer::TraceStreamer_Init_ThirdParty_Config(const uint8_t* data, int TS_LOGE("TraceStreamer_Init_ThirdParty_Config is comming!"); std::string thirdPartyConfig = reinterpret_cast(data); TS_LOGE("thirdPartyConfig = %s", thirdPartyConfig.c_str()); - int32_t size = thirdPartyConfig.size(); std::vector comPonentStr = SplitStringToVec(thirdPartyConfig, ";"); const int32_t EVENT_COUNT_PAIR = 2; if (comPonentStr.size() % EVENT_COUNT_PAIR != 0) { diff --git a/trace_streamer/src/table/BUILD.gn b/trace_streamer/src/table/BUILD.gn index 622e6d86..212c7e65 100644 --- a/trace_streamer/src/table/BUILD.gn +++ b/trace_streamer/src/table/BUILD.gn @@ -15,8 +15,8 @@ import("//build/ohos.gni") import("../../build/ts.gni") ohos_source_set("table") { - subsystem_name = "trace_streamer" - part_name = "table" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" include_dirs = [ "${THIRD_PARTY}/sqlite/include", "${SRC}/base", @@ -50,8 +50,6 @@ ohos_source_set("table") { "js_memory:js_memory_tables", "monitor:monitor_tables", "native_hook:native_hook_tables", + "hiperf:hiperf_tables", ] - if (with_perf) { - deps += [ "hiperf:hiperf_tables" ] - } } diff --git a/trace_streamer/src/table/base/BUILD.gn b/trace_streamer/src/table/base/BUILD.gn index a7a88cba..5300f742 100644 --- a/trace_streamer/src/table/base/BUILD.gn +++ b/trace_streamer/src/table/base/BUILD.gn @@ -15,8 +15,8 @@ import("//build/ohos.gni") import("../../../build/ts.gni") ohos_source_set("base_tables") { - subsystem_name = "trace_streamer" - part_name = "table" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "args_table.cpp", "args_table.h", diff --git a/trace_streamer/src/table/ebpf/BUILD.gn b/trace_streamer/src/table/ebpf/BUILD.gn index 6c9b8ad6..67766626 100644 --- a/trace_streamer/src/table/ebpf/BUILD.gn +++ b/trace_streamer/src/table/ebpf/BUILD.gn @@ -15,8 +15,8 @@ import("//build/ohos.gni") import("../../../build/ts.gni") ohos_source_set("ebpf_tables") { - subsystem_name = "trace_streamer" - part_name = "table" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "bio_latency_sample_table.cpp", "bio_latency_sample_table.h", diff --git a/trace_streamer/src/table/ftrace/BUILD.gn b/trace_streamer/src/table/ftrace/BUILD.gn index 17621ccc..1565672a 100644 --- a/trace_streamer/src/table/ftrace/BUILD.gn +++ b/trace_streamer/src/table/ftrace/BUILD.gn @@ -15,8 +15,8 @@ import("//build/ohos.gni") import("../../../build/ts.gni") ohos_source_set("ftrace_tables") { - subsystem_name = "trace_streamer" - part_name = "table" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "app_startup_table.cpp", "app_startup_table.h", diff --git a/trace_streamer/src/table/ftrace/process_table.cpp b/trace_streamer/src/table/ftrace/process_table.cpp index e626528f..9be2d5b0 100644 --- a/trace_streamer/src/table/ftrace/process_table.cpp +++ b/trace_streamer/src/table/ftrace/process_table.cpp @@ -294,7 +294,6 @@ void ProcessTable::Cursor::FilterPid(unsigned char op, uint64_t value) } void ProcessTable::Cursor::FilterIndex(int32_t col, unsigned char op, sqlite3_value* argv) { - auto type = sqlite3_value_type(argv); switch (col) { case PID: /* code */ @@ -307,7 +306,6 @@ void ProcessTable::Cursor::FilterIndex(int32_t col, unsigned char op, sqlite3_va } void ProcessTable::Cursor::FilterId(unsigned char op, sqlite3_value* argv) { - auto type = sqlite3_value_type(argv); auto v = static_cast(sqlite3_value_int64(argv)); switch (op) { case SQLITE_INDEX_CONSTRAINT_EQ: diff --git a/trace_streamer/src/table/hi_sysevent/BUILD.gn b/trace_streamer/src/table/hi_sysevent/BUILD.gn index 9c56b531..fcf1a758 100644 --- a/trace_streamer/src/table/hi_sysevent/BUILD.gn +++ b/trace_streamer/src/table/hi_sysevent/BUILD.gn @@ -15,8 +15,8 @@ import("//build/ohos.gni") import("../../../build/ts.gni") ohos_source_set("hi_sysevent_tables") { - subsystem_name = "trace_streamer" - part_name = "table" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "device_state_table.cpp", "device_state_table.h", diff --git a/trace_streamer/src/table/hiperf/BUILD.gn b/trace_streamer/src/table/hiperf/BUILD.gn index 7feb5fca..1e282312 100644 --- a/trace_streamer/src/table/hiperf/BUILD.gn +++ b/trace_streamer/src/table/hiperf/BUILD.gn @@ -15,8 +15,8 @@ import("//build/ohos.gni") import("../../../build/ts.gni") ohos_source_set("hiperf_tables") { - subsystem_name = "trace_streamer" - part_name = "table" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "perf_call_chain_table.cpp", "perf_call_chain_table.h", diff --git a/trace_streamer/src/table/js_memory/BUILD.gn b/trace_streamer/src/table/js_memory/BUILD.gn index 8bab7474..9e242cbf 100644 --- a/trace_streamer/src/table/js_memory/BUILD.gn +++ b/trace_streamer/src/table/js_memory/BUILD.gn @@ -15,8 +15,8 @@ import("//build/ohos.gni") import("../../../build/ts.gni") ohos_source_set("js_memory_tables") { - subsystem_name = "trace_streamer" - part_name = "table" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "appname_table.cpp", "appname_table.h", diff --git a/trace_streamer/src/table/monitor/BUILD.gn b/trace_streamer/src/table/monitor/BUILD.gn index 068932e9..db680eb2 100644 --- a/trace_streamer/src/table/monitor/BUILD.gn +++ b/trace_streamer/src/table/monitor/BUILD.gn @@ -15,8 +15,8 @@ import("//build/ohos.gni") import("../../../build/ts.gni") ohos_source_set("monitor_tables") { - subsystem_name = "trace_streamer" - part_name = "table" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "cpu_usage_info_table.cpp", "cpu_usage_info_table.h", diff --git a/trace_streamer/src/table/native_hook/BUILD.gn b/trace_streamer/src/table/native_hook/BUILD.gn index a63af8dc..10a75c6c 100644 --- a/trace_streamer/src/table/native_hook/BUILD.gn +++ b/trace_streamer/src/table/native_hook/BUILD.gn @@ -15,8 +15,8 @@ import("//build/ohos.gni") import("../../../build/ts.gni") ohos_source_set("native_hook_tables") { - subsystem_name = "trace_streamer" - part_name = "table" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "native_hook_frame_table.cpp", "native_hook_frame_table.h", diff --git a/trace_streamer/src/trace_data/BUILD.gn b/trace_streamer/src/trace_data/BUILD.gn index 064716fc..a21f04aa 100644 --- a/trace_streamer/src/trace_data/BUILD.gn +++ b/trace_streamer/src/trace_data/BUILD.gn @@ -15,8 +15,8 @@ import("//build/ohos.gni") import("../../build/ts.gni") ohos_source_set("trace_data") { - subsystem_name = "trace_streamer" - part_name = "trace_data" + subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" + part_name = "${OHOS_PROFILER_PART_NAME}" sources = [ "trace_data_cache.cpp", "trace_data_cache.h", diff --git a/trace_streamer/src/trace_data/trace_data_cache.cpp b/trace_streamer/src/trace_data/trace_data_cache.cpp index 02c43db1..e6ea3cdf 100644 --- a/trace_streamer/src/trace_data/trace_data_cache.cpp +++ b/trace_streamer/src/trace_data/trace_data_cache.cpp @@ -63,13 +63,11 @@ #include "native_hook_statistic_table.h" #include "network_table.h" #include "paged_memory_sample_table.h" -#if WITH_PERF #include "perf_call_chain_table.h" #include "perf_files_table.h" #include "perf_report_table.h" #include "perf_sample_table.h" #include "perf_thread_table.h" -#endif #include "process_filter_table.h" #include "process_measure_filter_table.h" #include "process_table.h" @@ -180,13 +178,11 @@ void TraceDataCache::InitDB() TableBase::TableDeclare(*db_, this, "app_startup"); TableBase::TableDeclare(*db_, this, "static_initalize"); -#if WITH_PERF TableBase::TableDeclare(*db_, this, "perf_report"); TableBase::TableDeclare(*db_, this, "perf_sample"); TableBase::TableDeclare(*db_, this, "perf_callchain"); TableBase::TableDeclare(*db_, this, "perf_thread"); TableBase::TableDeclare(*db_, this, "perf_files"); -#endif #else TableBase::TableDeclare(*db_, this, "_process"); TableBase::TableDeclare(*db_, this, "_sched_slice"); @@ -260,13 +256,11 @@ void TraceDataCache::InitDB() TableBase::TableDeclare(*db_, this, "_hisys_event_measure"); TableBase::TableDeclare(*db_, this, "_device_state"); TableBase::TableDeclare(*db_, this, "_trace_config"); -#if WITH_PERF TableBase::TableDeclare(*db_, this, "_perf_report"); TableBase::TableDeclare(*db_, this, "_perf_sample"); TableBase::TableDeclare(*db_, this, "_perf_callchain"); TableBase::TableDeclare(*db_, this, "_perf_thread"); TableBase::TableDeclare(*db_, this, "_perf_files"); -#endif #endif dbInited = true; } diff --git a/trace_streamer/src/trace_data/trace_stdtype.cpp b/trace_streamer/src/trace_data/trace_stdtype.cpp index cc5ecc4d..bf2335ec 100644 --- a/trace_streamer/src/trace_data/trace_stdtype.cpp +++ b/trace_streamer/src/trace_data/trace_stdtype.cpp @@ -2303,7 +2303,7 @@ const std::deque& GPUSlice::Durs() const { return durs_; } -const size_t GPUSlice::Size() const +size_t GPUSlice::Size() const { return durs_.size(); } diff --git a/trace_streamer/src/trace_data/trace_stdtype.h b/trace_streamer/src/trace_data/trace_stdtype.h index 77ce8bd1..2e7b2157 100644 --- a/trace_streamer/src/trace_data/trace_stdtype.h +++ b/trace_streamer/src/trace_data/trace_stdtype.h @@ -139,7 +139,7 @@ public: states_.clear(); cpus_.clear(); } - const uint32_t Size() const + uint32_t Size() const { return itids_.size(); } @@ -869,8 +869,6 @@ private: std::deque symbolOffsets_ = {}; std::deque vaddrs_ = {}; std::map symbolIdToSymbolName_ = {}; - DataIndex libcFilePathIndex_ = INVALID_UINT64; - DataIndex muslFilePathIndex_ = INVALID_UINT64; }; class NativeHookStatistic : public CacheBase { @@ -1550,7 +1548,6 @@ private: std::deque flags_ = {}; std::deque appNames_ = {}; std::deque keyNames_ = {}; - uint32_t rowCount_ = 0; }; class SysEventMeasureData : public CacheBase { public: @@ -1822,7 +1819,7 @@ public: names_.emplace_back(name); return ts_.size(); } - const size_t Size() const + size_t Size() const { return ts_.size(); } @@ -1853,7 +1850,7 @@ public: clockIds_.emplace_back(clockId); return dataSourceNames_.size(); } - const size_t Size() const + size_t Size() const { return dataSourceNames_.size(); } @@ -2303,7 +2300,7 @@ public: size_t AppendNew(uint32_t frameRow, uint64_t dur); const std::deque& FrameRows() const; const std::deque& Durs() const; - const size_t Size() const; + size_t Size() const; private: std::deque frameRows_ = {}; diff --git a/trace_streamer/src/trace_streamer/trace_streamer_filters.h b/trace_streamer/src/trace_streamer/trace_streamer_filters.h index 9d0c114e..3cf61ad5 100644 --- a/trace_streamer/src/trace_streamer/trace_streamer_filters.h +++ b/trace_streamer/src/trace_streamer/trace_streamer_filters.h @@ -34,9 +34,7 @@ class SystemEventMeasureFilter; class HiSysEventMeasureFilter; class FrameFilter; class APPStartupFilter; -#if WITH_PERF class PerfDataFilter; -#endif class TraceStreamerFilters { public: TraceStreamerFilters(); @@ -68,9 +66,7 @@ public: std::unique_ptr hiSysEventMeasureFilter_; std::unique_ptr frameFilter_; std::unique_ptr appStartupFilter_; -#if WITH_PERF std::unique_ptr perfDataFilter_; -#endif }; } // namespace TraceStreamer } // namespace SysTuning diff --git a/trace_streamer/src/trace_streamer/trace_streamer_selector.cpp b/trace_streamer/src/trace_streamer/trace_streamer_selector.cpp index 3723a4ec..1979e9dc 100644 --- a/trace_streamer/src/trace_streamer/trace_streamer_selector.cpp +++ b/trace_streamer/src/trace_streamer/trace_streamer_selector.cpp @@ -31,9 +31,7 @@ #include "measure_filter.h" #include "parser/bytrace_parser/bytrace_parser.h" #include "parser/htrace_pbreader_parser/htrace_parser.h" -#if WITH_PERF #include "perf_data_filter.h" -#endif #include "process_filter.h" #include "slice_filter.h" #include "stat_filter.h" @@ -275,7 +273,6 @@ int32_t TraceStreamerSelector::UpdateTraceRangeTime(uint8_t* data, int32_t len) { std::string traceRangeStr; memcpy(&traceRangeStr, data, len); - int32_t size = traceRangeStr.size(); std::vector vTraceRangeStr = SplitStringToVec(traceRangeStr, ";"); uint64_t minTs = std::stoull(vTraceRangeStr.at(0)); uint64_t maxTs = std::stoull(vTraceRangeStr.at(1)); diff --git a/trace_streamer/test/BUILD.gn b/trace_streamer/test/BUILD.gn index ce7ca3e1..43814177 100755 --- a/trace_streamer/test/BUILD.gn +++ b/trace_streamer/test/BUILD.gn @@ -61,23 +61,23 @@ if (is_test) { ] deps = [ - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/cpu_data:cpu_data_cpp", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/diskio_data:diskio_data_cpp", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ftrace_data_cpp", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hidump_data:hidump_data_cpp", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hilog_data:hilog_data_cpp", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hisysevent_data:hisysevent_data_cpp", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/js_memory:js_memory_data_cpp", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/memory_data:memory_data_cpp", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/native_hook:native_hook_cpp", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/network_data:network_data_cpp", - "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/process_data:process_data_cpp", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/cpu_data:ts_cpu_data_cpp", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/diskio_data:ts_diskio_data_cpp", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/ftrace_data/${device_kernel_version}:ts_ftrace_data_cpp", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hidump_data:ts_hidump_data_cpp", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hilog_data:ts_hilog_data_cpp", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/hisysevent_data:ts_hisysevent_data_cpp", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/js_memory:ts_js_memory_data_cpp", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/memory_data:ts_memory_data_cpp", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/native_hook:ts_native_hook_cpp", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/network_data:ts_network_data_cpp", + "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/process_data:ts_process_data_cpp", "${OHOS_TRACE_STREAMER_PROTOS_DIR}/protos/types/plugins/test_data:test_data_cpp", "${THIRD_PARTY}/googletest:gtest", "${THIRD_PARTY}/googletest:gtest_main", "${THIRD_PARTY}/protobuf:protobuf", "${THIRD_PARTY}/protobuf:protobuf_lite", - "${THIRD_PARTY}/sqlite:sqlite", + # "${THIRD_PARTY}/sqlite:sqlite", "../src:trace_streamer_source", "../src/parser/htrace_pbreader_parser:htrace_pbreader_parser", "../src/proto_reader:proto_reader", @@ -107,6 +107,7 @@ if (is_test) { "${THIRD_PARTY}/protobuf/src/google/protobuf", "${THIRD_PARTY}/json-master/single_include/nlohmann", "${THIRD_PARTY}/perf_include/musl", + "${THIRD_PARTY}/sqlite/include", "../src/parser/htrace_pbreader_parser", "../src/parser/htrace_pbreader_parser/htrace_event_parser", "../src/parser/htrace_pbreader_parser/htrace_cpu_parser", diff --git a/trace_streamer/test/test_fuzzer/bytrace_fuzzer/BUILD.gn b/trace_streamer/test/test_fuzzer/bytrace_fuzzer/BUILD.gn index 97ed18a9..1c1ad9e3 100644 --- a/trace_streamer/test/test_fuzzer/bytrace_fuzzer/BUILD.gn +++ b/trace_streamer/test/test_fuzzer/bytrace_fuzzer/BUILD.gn @@ -48,7 +48,7 @@ ohos_fuzztest("ts_bytrace_fuzz_test") { deps = [ "${THIRD_PARTY}/protobuf:protobuf", "${THIRD_PARTY}/protobuf:protobuf_lite", - "${THIRD_PARTY}/sqlite:sqlite", + # "${THIRD_PARTY}/sqlite:sqlite", "../../../src:trace_streamer_source", "../../../src/proto_reader:proto_reader", ] diff --git a/trace_streamer/test/test_fuzzer/htrace_fuzzer/BUILD.gn b/trace_streamer/test/test_fuzzer/htrace_fuzzer/BUILD.gn index 1bdfaf6d..1dcb3bac 100644 --- a/trace_streamer/test/test_fuzzer/htrace_fuzzer/BUILD.gn +++ b/trace_streamer/test/test_fuzzer/htrace_fuzzer/BUILD.gn @@ -48,7 +48,7 @@ ohos_fuzztest("ts_htrace_fuzz_test") { deps = [ "${THIRD_PARTY}/protobuf:protobuf", "${THIRD_PARTY}/protobuf:protobuf_lite", - "${THIRD_PARTY}/sqlite:sqlite", + # "${THIRD_PARTY}/sqlite:sqlite", "../../../src:trace_streamer_source", "../../../src/proto_reader:proto_reader", ] diff --git a/trace_streamer/test/test_fuzzer/selector_fuzzer/BUILD.gn b/trace_streamer/test/test_fuzzer/selector_fuzzer/BUILD.gn index 146e2c73..511d61d2 100644 --- a/trace_streamer/test/test_fuzzer/selector_fuzzer/BUILD.gn +++ b/trace_streamer/test/test_fuzzer/selector_fuzzer/BUILD.gn @@ -48,7 +48,7 @@ ohos_fuzztest("ts_selector_fuzz_test") { deps = [ "${THIRD_PARTY}/protobuf:protobuf", "${THIRD_PARTY}/protobuf:protobuf_lite", - "${THIRD_PARTY}/sqlite:sqlite", + # "${THIRD_PARTY}/sqlite:sqlite", "../../../src:trace_streamer_source", "../../../src/proto_reader:proto_reader", ] diff --git a/trace_streamer/test/test_ts.gni b/trace_streamer/test/test_ts.gni index e67c6457..4a051f46 100755 --- a/trace_streamer/test/test_ts.gni +++ b/trace_streamer/test/test_ts.gni @@ -13,7 +13,6 @@ OHOS_PROTO_DIR = "" kernel_version = "." THIRD_PARTY = "//third_party" -SRC = "//src" PREBUILTS = "//prebuilts" if (target_os == "linux" || target_os == "windows" || target_os == "macx") { if (is_test) { -- Gitee