diff --git a/bundle.json b/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..a8adc5b75549f4a3b681441faa03f0f22b0f60fa --- /dev/null +++ b/bundle.json @@ -0,0 +1,39 @@ +{ + "name": "@ohos/smartperf_host", + "description": "xxx", + "version": "xxx", + "license": "Apache License 2.0", + "publishAs": "code-segment", + "segment": { + "destPath": "developtools/smartperf_host" + }, + "dirs": {}, + "scripts": {}, + "component": { + "name": "smartperf_host", + "subsystem": "developtools", + "adapted_system_type": [ + "standard" + ], + "rom": "xxxKB", + "ram": "xxxKB", + "deps": { + "components": [ + "c_utils" + ], + "third_party": [ + "zlib", + "libsec_static", + "bounds_checking_function", + "protobuf", + "libunwind", + "sqlite" + ] + }, + "build": { + "sub_component": [ + "//developtools/smartperf_host/trace_streamer:trace_streamer" + ] + } + } +} \ No newline at end of file diff --git a/patches/patches.json b/patches/patches.json new file mode 100644 index 0000000000000000000000000000000000000000..65982b06fb08f57a665498ddb328b2a4b59df9b3 --- /dev/null +++ b/patches/patches.json @@ -0,0 +1,9 @@ +{ + "patches": [ + { + "project": "productdefine_common", + "patch_file": "productdefine_common.patch", + "path": "productdefine/common" + } + ] +} \ No newline at end of file diff --git a/patches/productdefine_common.patch b/patches/productdefine_common.patch new file mode 100644 index 0000000000000000000000000000000000000000..9f500678525ef7b97a29ad01c1c0457341f6bb7c --- /dev/null +++ b/patches/productdefine_common.patch @@ -0,0 +1,83 @@ +diff --git a/inherit/default.json b/inherit/default.json +index 3621e9e..d894aae 100644 +--- a/inherit/default.json ++++ b/inherit/default.json +@@ -461,7 +461,11 @@ + { + "component": "packing_tool", + "features": [] +- } ++ }, ++ { ++ "component": "smartperf_host", ++ "features": [] ++ } + ] + }, + { +diff --git a/inherit/ipcamera.json b/inherit/ipcamera.json +index 4075a32..e74bfbc 100644 +--- a/inherit/ipcamera.json ++++ b/inherit/ipcamera.json +@@ -449,6 +449,10 @@ + { + "component": "hiperf", + "features": [] ++ }, ++ { ++ "component": "smartperf_host", ++ "features": [] + } + ] + }, +diff --git a/inherit/pc.json b/inherit/pc.json +index 89392c5..fffd9e9 100644 +--- a/inherit/pc.json ++++ b/inherit/pc.json +@@ -461,7 +461,11 @@ + { + "component": "packing_tool", + "features": [] +- } ++ }, ++ { ++ "component": "smartperf_host", ++ "features": [] ++ } + ] + }, + { +diff --git a/inherit/rich.json b/inherit/rich.json +index 5013860..09cce24 100644 +--- a/inherit/rich.json ++++ b/inherit/rich.json +@@ -469,7 +469,11 @@ + { + "component": "packing_tool", + "features": [] +- } ++ }, ++ { ++ "component": "smartperf_host", ++ "features": [] ++ } + ] + }, + { +diff --git a/inherit/tablet.json b/inherit/tablet.json +index 1e0e322..4281d5f 100644 +--- a/inherit/tablet.json ++++ b/inherit/tablet.json +@@ -428,7 +428,11 @@ + { + "component": "packing_tool", + "features": [] +- } ++ }, ++ { ++ "component": "smartperf_host", ++ "features": [] ++ } + ] + }, + { diff --git a/trace_streamer/BUILD.gn b/trace_streamer/BUILD.gn index 1bcdb155d41f38230b18540775ecfe5f60214f51..7190e798ba3499128ea677810bcdb386b7e60c84 100644 --- a/trace_streamer/BUILD.gn +++ b/trace_streamer/BUILD.gn @@ -10,27 +10,28 @@ # 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("build/ts.gni") -group("trace_streamer") { - if (is_test) { - deps = [ "test:unittest" ] - testonly = true - } else if (is_fuzz) { - deps = [ "test:fuzztest" ] - testonly = true - } else if (is_protoc) { - deps = [ "${THIRD_PARTY}/protobuf:protoc" ] - } else if (is_spb) { - deps = [ "src/proto_reader/protoc_plugin:protoreader_plugin" ] - } else if (is_sdkdemo) { - deps = [ "sdk/demo_sdk:trace_streamer_sdk_builtin" ] - } else if (is_dubai_sdk) { - deps = [ "sdk/dubai_sdk:trace_streamer_dubai_builtin" ] - } else if (is_sdkdemo_test) { - deps = [ "sdk/test:sdkunittest" ] - } else if (use_wasm) { - deps = [ "src:trace_streamer_builtin" ] - } else { - deps = [ "src:trace_streamer" ] - } +import("//build/ohos.gni") + +ohos_executable("trace_streamer") { + cflags = [ "-D COMPILE_WITH_OHOS" ] + sources = [ "src/main.cpp" ] + include_dirs = [ + "src/base", + "./", + "src/trace_streamer", + "src/filter", + "src/table", + "src/trace_data", + "src/include", + "src/rpc", + "src/", + "src/parser", + "src/cfg", + "src/proto_reader/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", + ] } diff --git a/trace_streamer/src/main.cpp b/trace_streamer/src/main.cpp index eff838d3595c732f54fc3957972a9fec7fa673e2..f13e2d20c3e99ebd8b20a34904be413a6563e8e5 100644 --- a/trace_streamer/src/main.cpp +++ b/trace_streamer/src/main.cpp @@ -45,7 +45,9 @@ namespace TraceStreamer { using namespace SysTuning::TraceStreamer; using namespace SysTuning::base; constexpr size_t G_CHUNK_SIZE = 1024 * 1024; +#ifndef COMPILE_WITH_OHOS constexpr int G_MIN_PARAM_NUM = 2; +#endif constexpr size_t G_FILE_PERMISSION = 664; // set version info in meta.cpp please void ExportStatusToLog(const std::string& dbPath, TraceParserStatus status) @@ -297,6 +299,7 @@ int CheckArgs(int argc, char** argv, TraceExportOption& traceExportOption, HttpO } // namespace SysTuning int main(int argc, char** argv) { +#ifndef COMPILE_WITH_OHOS if (argc < G_MIN_PARAM_NUM) { ShowHelpInfo(argv[0]); return 1; @@ -354,5 +357,6 @@ int main(int argc, char** argv) if (!tsOption.sqlOperatorFilePath.empty()) { ReadSqlFileAndPrintResult(ts, tsOption.sqlOperatorFilePath); } +#endif return 0; }