diff --git a/Cargo.toml b/Cargo.toml deleted file mode 100644 index b762364d904051106708093238e01c3e816425e2..0000000000000000000000000000000000000000 --- a/Cargo.toml +++ /dev/null @@ -1,17 +0,0 @@ -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# 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. - -[workspace] -members = [ - "interfaces/rust/innerkits/hitrace_meter", -] diff --git a/interfaces/native/innerkits/src/hitrace_dump.cpp b/interfaces/native/innerkits/src/hitrace_dump.cpp index 24f5ba0ce200eef6215b63f74658a628031f0487..7395d4fa2cbdbfdae608f8900504ca5d710844c6 100644 --- a/interfaces/native/innerkits/src/hitrace_dump.cpp +++ b/interfaces/native/innerkits/src/hitrace_dump.cpp @@ -894,11 +894,11 @@ void ClearOldTraceFileInDirectory() if (remove((DEFAULT_OUTPUT_DIR+fileNames[0]).c_str()) == 0) { HILOG_INFO(LOG_CORE, "ClearOldTraceFileInDirectory: delete first: %{public}s success.", fileNames[0].c_str()); - fileNames.erase(fileNames.begin()); } else { HILOG_ERROR(LOG_CORE, "ClearOldTraceFileInDirectory: delete first: %{public}s failed, errno: %{public}d.", fileNames[0].c_str(), errno); } + fileNames.erase(fileNames.begin()); } } diff --git a/interfaces/native/innerkits/src/hitrace_meter.cpp b/interfaces/native/innerkits/src/hitrace_meter.cpp index 177c5602c909ba492a7e93716343e0e3525aad92..992b01fea9a49d98b47573a6a70896d5d785c713 100644 --- a/interfaces/native/innerkits/src/hitrace_meter.cpp +++ b/interfaces/native/innerkits/src/hitrace_meter.cpp @@ -416,7 +416,7 @@ bool WriteTraceToFile(char* buf, const int len) char* GetTraceBuffer(int size) { - if (g_writeOffset + size > DEFAULT_CACHE_SIZE && g_writeOffset + size < MAX_FILE_SIZE) { + if ((g_writeOffset + size) > DEFAULT_CACHE_SIZE && (g_writeOffset + size) < MAX_FILE_SIZE) { // The remaining space is insufficient to cache the data. Write the data to the file. if (!WriteTraceToFile(g_traceBuffer.get(), g_writeOffset)) { return nullptr; diff --git a/interfaces/rust/innerkits/hitrace_meter/Cargo.toml b/interfaces/rust/innerkits/hitrace_meter/Cargo.toml deleted file mode 100644 index a238a50113f20e404b5dcfa71736230f22ec3243..0000000000000000000000000000000000000000 --- a/interfaces/rust/innerkits/hitrace_meter/Cargo.toml +++ /dev/null @@ -1,20 +0,0 @@ -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# 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. - -[package] -name = "hitrace_meter_rust" -version = "1.0.0" -edition = "2021" -license = "Apache-2.0" -description = "cross-thread, cross-process, and cross-device service call chain" -repository = "https://gitee.com/openharmony/hiviewdfx_hitrace.git"