From cf90cbe31551aca7ecb2ea2c738e6c4f621c09ac Mon Sep 17 00:00:00 2001 From: GlaryCastle Date: Fri, 8 Jul 2022 18:17:38 +0800 Subject: [PATCH] Signed-off-by: GlaryCastle Changes to be committed: modified: services/BUILD.gn modified: services/dfx/include/time_cmd_dispatcher.h modified: services/dfx/include/time_cmd_parse.h modified: services/dfx/include/time_sysevent.h deleted: services/dfx/include/time_trace.h modified: services/dfx/src/time_cmd_dispatcher.cpp modified: services/dfx/src/time_cmd_parse.cpp modified: services/dfx/src/time_sysevent.cpp deleted: services/dfx/src/time_trace.cpp modified: services/time_manager/test/unittest/src/time_service_test.cpp --- services/BUILD.gn | 3 -- services/dfx/include/time_cmd_dispatcher.h | 2 +- services/dfx/include/time_cmd_parse.h | 2 +- services/dfx/include/time_sysevent.h | 2 +- services/dfx/include/time_trace.h | 32 --------------- services/dfx/src/time_cmd_dispatcher.cpp | 2 +- services/dfx/src/time_cmd_parse.cpp | 2 +- services/dfx/src/time_sysevent.cpp | 2 +- services/dfx/src/time_trace.cpp | 40 ------------------- .../test/unittest/src/time_service_test.cpp | 2 + 10 files changed, 8 insertions(+), 81 deletions(-) delete mode 100644 services/dfx/include/time_trace.h delete mode 100644 services/dfx/src/time_trace.cpp diff --git a/services/BUILD.gn b/services/BUILD.gn index 28690b5..0909f3d 100755 --- a/services/BUILD.gn +++ b/services/BUILD.gn @@ -42,7 +42,6 @@ ohos_shared_library("time_service") { "dfx/src/time_cmd_dispatcher.cpp", "dfx/src/time_cmd_parse.cpp", "dfx/src/time_sysevent.cpp", - "dfx/src/time_trace.cpp", "time_manager/src/itimer_info.cpp", "time_manager/src/net_conn_callback_observer.cpp", "time_manager/src/nitz_subscriber.cpp", @@ -79,8 +78,6 @@ ohos_shared_library("time_service") { "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "hisysevent_native:libhisysevent", - "hitrace_native:hitrace_meter", - "hitrace_native:libhitrace", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "relational_store:native_appdatafwk", diff --git a/services/dfx/include/time_cmd_dispatcher.h b/services/dfx/include/time_cmd_dispatcher.h index ea37259..ad88a81 100644 --- a/services/dfx/include/time_cmd_dispatcher.h +++ b/services/dfx/include/time_cmd_dispatcher.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2022 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/services/dfx/include/time_cmd_parse.h b/services/dfx/include/time_cmd_parse.h index 75f4d07..04ffba2 100644 --- a/services/dfx/include/time_cmd_parse.h +++ b/services/dfx/include/time_cmd_parse.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2022 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/services/dfx/include/time_sysevent.h b/services/dfx/include/time_sysevent.h index c9803b8..f7dceb9 100644 --- a/services/dfx/include/time_sysevent.h +++ b/services/dfx/include/time_sysevent.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2022 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/services/dfx/include/time_trace.h b/services/dfx/include/time_trace.h deleted file mode 100644 index 863bb5a..0000000 --- a/services/dfx/include/time_trace.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -#ifndef TIME_TRACE_H -#define TIME_TRACE_H - -#include - -namespace OHOS { -namespace MiscServices { -void InitHiTrace(); -void ValueTrace(const std::string &name, int64_t count); -class TimeTrace { -public: - explicit TimeTrace(const std::string &value); - virtual ~TimeTrace(); -}; -} // namespace MiscServices -} // namespace OHOS -#endif // TIME_TRACE_H diff --git a/services/dfx/src/time_cmd_dispatcher.cpp b/services/dfx/src/time_cmd_dispatcher.cpp index afb6167..e20997f 100644 --- a/services/dfx/src/time_cmd_dispatcher.cpp +++ b/services/dfx/src/time_cmd_dispatcher.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2022 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/services/dfx/src/time_cmd_parse.cpp b/services/dfx/src/time_cmd_parse.cpp index 2e58fa5..705f313 100644 --- a/services/dfx/src/time_cmd_parse.cpp +++ b/services/dfx/src/time_cmd_parse.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2022 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/services/dfx/src/time_sysevent.cpp b/services/dfx/src/time_sysevent.cpp index 94f18a7..c8fe713 100644 --- a/services/dfx/src/time_sysevent.cpp +++ b/services/dfx/src/time_sysevent.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2022 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/services/dfx/src/time_trace.cpp b/services/dfx/src/time_trace.cpp deleted file mode 100644 index 2d599f7..0000000 --- a/services/dfx/src/time_trace.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ -#include "time_trace.h" - -#include "hitrace_meter.h" - -namespace OHOS { -namespace MiscServices { -void InitHiTrace() -{ - UpdateTraceLabel(); -} - -void ValueTrace(const std::string &name, int64_t count) -{ - CountTrace(HITRACE_TAG_MISC, name, count); -} -TimeTrace::TimeTrace(const std::string &value) -{ - StartTrace(HITRACE_TAG_MISC, value); -} - -TimeTrace::~TimeTrace() -{ - FinishTrace(HITRACE_TAG_MISC); -} -} // namespace MiscServices -} // namespace OHOS diff --git a/services/time_manager/test/unittest/src/time_service_test.cpp b/services/time_manager/test/unittest/src/time_service_test.cpp index 34a0cd6..69bbb05 100644 --- a/services/time_manager/test/unittest/src/time_service_test.cpp +++ b/services/time_manager/test/unittest/src/time_service_test.cpp @@ -19,6 +19,7 @@ #include "timer_info_test.h" #include "time_service_test.h" +namespace { using namespace testing::ext; using namespace OHOS; using namespace OHOS::MiscServices; @@ -366,4 +367,5 @@ HWTEST_F(TimeServiceTest, ProxyTimer004, TestSize.Level0) EXPECT_TRUE(ret); ret = TimeServiceClient::GetInstance()->ProxyTimer(uid, false, false); EXPECT_TRUE(ret); +} } \ No newline at end of file