!198 miscservices_time dfx 告警清零

Merge pull request !198 from GlaryCastle/master
This commit is contained in:
openharmony_ci
2022-07-12 02:45:14 +00:00
committed by Gitee
10 changed files with 8 additions and 81 deletions
-3
View File
@@ -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",
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
-32
View File
@@ -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 <string>
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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
-40
View File
@@ -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
@@ -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;
@@ -257,4 +258,5 @@ HWTEST_F(TimeServiceTest, ProxyTimer004, TestSize.Level0)
EXPECT_TRUE(ret);
ret = TimeServiceClient::GetInstance()->ProxyTimer(uid, false, false);
EXPECT_TRUE(ret);
}
}