From f1fa35457c658792564a8a0f6f0e52f675c33022 Mon Sep 17 00:00:00 2001 From: im-off-this-week Date: Thu, 12 May 2022 20:09:01 +0800 Subject: [PATCH 1/4] dfx add hisysevent for distributed_screen Signed-off-by: im-off-this-week --- bundle.json | 3 + hisysevent.yaml | 87 +++++++++++++++++++ .../innerkits/native_cpp/screen_sink/BUILD.gn | 1 + .../callback/dscreen_sink_load_callback.cpp | 15 ++++ .../screen_sink/src/dscreen_sink_handler.cpp | 21 +++++ .../native_cpp/screen_source/BUILD.gn | 1 + .../callback/dscreen_source_load_callback.cpp | 15 ++++ .../src/dscreen_source_handler.cpp | 21 +++++ .../test/unittest/screensinktest/BUILD.gn | 2 +- .../test/unittest/screensourcetest/BUILD.gn | 2 +- services/screenclient/BUILD.gn | 1 + .../src/screen_client_window_adapter.cpp | 21 +++++ services/screenservice/sourceservice/BUILD.gn | 1 + .../dscreenmgr/src/screen_manager_adapter.cpp | 33 +++++++ .../decoder/src/image_sink_decoder.cpp | 22 +++++ .../screentransport/screensinktrans/BUILD.gn | 1 + .../encoder/src/image_source_encoder.cpp | 22 +++++ .../screensourcetrans/BUILD.gn | 1 + .../softbusadapter/src/softbus_adapter.cpp | 39 +++++++++ 19 files changed, 307 insertions(+), 2 deletions(-) create mode 100644 hisysevent.yaml diff --git a/bundle.json b/bundle.json index 05d7e2de..e5afdc47 100644 --- a/bundle.json +++ b/bundle.json @@ -23,6 +23,9 @@ ], "rom":"2000k", "ram":"6M", + "hisysevent_config": [ + "//foundation/distributedhardware/distributedscreen/hisysevent.yaml" + ], "deps":{ "components":[ "appexecfwk_standard", diff --git a/hisysevent.yaml b/hisysevent.yaml new file mode 100644 index 00000000..4652dfb9 --- /dev/null +++ b/hisysevent.yaml @@ -0,0 +1,87 @@ +# 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. + +##################################################### +# below is the format of defining event # +##################################################### +#domain: domain name. [Only one domain name can be defined at the top] +# +#author: the author name who defined this event. +#date: the date when this event was defined, format is YYYY-MM-DD. +#logged: source file which refer to this event. +#usage: the usage of this event. +#//Define event name and event properties. +#@EVENT_NAME: the event definition part begin. +# // __BASE is used for defining the basic info of the event. +# // "type" optional values are: FAULT, STATISTICS, SECURITY, BEHAVIOR. +# // "level" optional values are: CRITICAL, MINOR. +# // "tag" set tags with may used by subscriber of this event, multiple tags devided by space. +# // "desc" full description of this event. +# @PARAMETER: {type: parameter type, arrsize: array length(optional), desc: parameter description}. +# // follow the __BASE block, each line defines a parameter of this event. +# // "type" optional values are: INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, UINT64, FLOAT, DOUBLE, STRING. +# // "arrsize" of the parameter is an array, set a non-zero value. +# // "desc" full description of this parameter. + +##################################################### +# Example of some hiviewdfx events definition # +##################################################### + +domain: DSCREEN + +SA_ERROR: + __BASE: {type: FAULT, level: CRITICAL, desc: dscreen sa error occured} + PID: {type: INT32, desc: dscreen pid} + UID: {type: INT32, desc: dscreen uid} + MSG: {type: STRING, desc: dscreen sa error info} + +VIRTUALSCREEN_ERROR: + __BASE: {type: FAULT, level: CRITICAL, desc: virtual screen error occured} + PID: {type: INT32, desc: dscreen pid} + UID: {type: INT32, desc: dscreen uid} + MSG: {type: STRING, desc: dscreen virtual screen error info} + +SOFTBUS_SESSIONSERVER_ERROR: + __BASE: {type: FAULT, level: CRITICAL, desc: softbus sessionserver error occured} + PID: {type: INT32, desc: dscreen pid} + UID: {type: INT32, desc: dscreen uid} + PKGNAME: {type: STRING, desc: softbus package name} + SESSIONNAME: {type: STRING, desc: softbus session name} + MSG: {type: STRING, desc: dscreen softbus sessionserver error info} + +SOFTBUS_SESSION_ERROR: + __BASE: {type: FAULT, level: CRITICAL, desc: softbus session error occured} + PID: {type: INT32, desc: dscreen pid} + UID: {type: INT32, desc: dscreen uid} + MYSESSIONNAME: {type: STRING, desc: softbus my session name} + PEERSESSIONNAME: {type: STRING, desc: softbus peer session name} + PEERDEVID: {type: STRING, desc: peer network id} + MSG: {type: STRING, desc: dscreen softbus session error info} + +VIDEO_ENCODER_ERROR: + __BASE: {type: FAULT, level: CRITICAL, desc: video encoder error occured} + PID: {type: INT32, desc: dscreen pid} + UID: {type: INT32, desc: dscreen uid} + MSG: {type: STRING, desc: dscreen video encoder error info} + +VIDEO_DECODER_ERROR: + __BASE: {type: FAULT, level: CRITICAL, desc: video decoder error occured} + PID: {type: INT32, desc: dscreen pid} + UID: {type: INT32, desc: dscreen uid} + MSG: {type: STRING, desc: dscreen video decoder error info} + +WINDOW_ERROR: + __BASE: {type: FAULT, level: CRITICAL, desc: screenregion window error occured} + PID: {type: INT32, desc: dscreen pid} + UID: {type: INT32, desc: dscreen uid} + MSG: {type: STRING, desc: dscreen virtual window error info} \ No newline at end of file diff --git a/interfaces/innerkits/native_cpp/screen_sink/BUILD.gn b/interfaces/innerkits/native_cpp/screen_sink/BUILD.gn index adc10a54..4e469f9a 100644 --- a/interfaces/innerkits/native_cpp/screen_sink/BUILD.gn +++ b/interfaces/innerkits/native_cpp/screen_sink/BUILD.gn @@ -46,6 +46,7 @@ ohos_shared_library("distributed_screen_sink_sdk") { ] external_deps = [ + "hisysevent_native:libhisysevent", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "safwk:system_ability_fwk", diff --git a/interfaces/innerkits/native_cpp/screen_sink/src/callback/dscreen_sink_load_callback.cpp b/interfaces/innerkits/native_cpp/screen_sink/src/callback/dscreen_sink_load_callback.cpp index 2911bce4..620a6723 100644 --- a/interfaces/innerkits/native_cpp/screen_sink/src/callback/dscreen_sink_load_callback.cpp +++ b/interfaces/innerkits/native_cpp/screen_sink/src/callback/dscreen_sink_load_callback.cpp @@ -14,6 +14,11 @@ */ #include "dscreen_sink_load_callback.h" +#include + +#include "hisysevent.h" + +#include "dscreen_errcode.h" #include "dscreen_log.h" #include "dscreen_sink_handler.h" @@ -38,6 +43,16 @@ void DScreenSinkLoadCallback::OnLoadSystemAbilitySuccess( void DScreenSinkLoadCallback::OnLoadSystemAbilityFail(int32_t systemAbilityId) { DHLOGE("load screen SA failed, systemAbilityId:%d", systemAbilityId); + int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( + OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + "SA_ERROR", + OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, + "PID", getpid(), + "UID", getuid(), + "MSG", "dscreen sink OnLoadSystemAbilityFail."); + if (res != DH_SUCCESS) { + DHLOGE("Write HiSysEvent error, res:%d", res); + } } } } \ No newline at end of file diff --git a/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp b/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp index 440e5537..56100b05 100644 --- a/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp +++ b/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp @@ -15,6 +15,7 @@ #include "dscreen_sink_handler.h" +#include "hisysevent.h" #include "if_system_ability_manager.h" #include "iservice_registry.h" @@ -56,6 +57,16 @@ int32_t DScreenSinkHandler::InitSink(const std::string ¶ms) if (ret != ERR_OK) { DHLOGE("Failed to Load systemAbility, systemAbilityId:%d, ret code:%d", DISTRIBUTED_HARDWARE_SCREEN_SINK_SA_ID, ret); + int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( + OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + "SA_ERROR", + OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, + "PID", getpid(), + "UID", getuid(), + "MSG", "dscreen sink LoadSystemAbility call failed."); + if (res != DH_SUCCESS) { + DHLOGE("Write HiSysEvent error, res:%d", res); + } return ERR_DH_SCREEN_SA_GET_SINKPROXY_FAIL; } } @@ -64,6 +75,16 @@ int32_t DScreenSinkHandler::InitSink(const std::string ¶ms) [this]() { return dScreenSinkProxy_ != nullptr; }); if (!waitStatus) { DHLOGE("screen load sa timeout"); + int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( + OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + "SA_ERROR", + OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, + "PID", getpid(), + "UID", getuid(), + "MSG", "dscreen sink sa load timeout."); + if (res != DH_SUCCESS) { + DHLOGE("Write HiSysEvent error, res:%d", res); + } return ERR_DH_SCREEN_SA_LOAD_TIMEOUT; } diff --git a/interfaces/innerkits/native_cpp/screen_source/BUILD.gn b/interfaces/innerkits/native_cpp/screen_source/BUILD.gn index 565bc5e6..8ca358db 100644 --- a/interfaces/innerkits/native_cpp/screen_source/BUILD.gn +++ b/interfaces/innerkits/native_cpp/screen_source/BUILD.gn @@ -48,6 +48,7 @@ ohos_shared_library("distributed_screen_source_sdk") { ] external_deps = [ + "hisysevent_native:libhisysevent", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "safwk:system_ability_fwk", diff --git a/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_load_callback.cpp b/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_load_callback.cpp index bd712611..168b15cd 100644 --- a/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_load_callback.cpp +++ b/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_load_callback.cpp @@ -14,6 +14,11 @@ */ #include "dscreen_source_load_callback.h" +#include + +#include "hisysevent.h" + +#include "dscreen_errcode.h" #include "dscreen_log.h" #include "dscreen_source_handler.h" @@ -37,6 +42,16 @@ void DScreenSourceLoadCallback::OnLoadSystemAbilitySuccess( void DScreenSourceLoadCallback::OnLoadSystemAbilityFail(int32_t systemAbilityId) { DHLOGE("load screen SA failed, systemAbilityId:%d", systemAbilityId); + int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( + OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + "SA_ERROR", + OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, + "PID", getpid(), + "UID", getuid(), + "MSG", "dscreen source OnLoadSystemAbilityFail."); + if (res != DH_SUCCESS) { + DHLOGE("Write HiSysEvent error, res:%d", res); + } } } } diff --git a/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_handler.cpp b/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_handler.cpp index 806d8e2f..96558a4d 100644 --- a/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_handler.cpp +++ b/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_handler.cpp @@ -15,6 +15,7 @@ #include "dscreen_source_handler.h" +#include "hisysevent.h" #include "if_system_ability_manager.h" #include "iservice_registry.h" @@ -61,6 +62,16 @@ int32_t DScreenSourceHandler::InitSource(const std::string ¶ms) if (ret != ERR_OK) { DHLOGE("Failed to Load systemAbility, systemAbilityId:%d, ret code:%d", DISTRIBUTED_HARDWARE_SCREEN_SOURCE_SA_ID, ret); + int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( + OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + "SA_ERROR", + OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, + "PID", getpid(), + "UID", getuid(), + "MSG", "dscreen source LoadSystemAbility call failed."); + if (res != DH_SUCCESS) { + DHLOGE("Write HiSysEvent error, res:%d", res); + } return ERR_DH_SCREEN_SA_GET_SOURCEPROXY_FAIL; } } @@ -69,6 +80,16 @@ int32_t DScreenSourceHandler::InitSource(const std::string ¶ms) [this]() { return (dScreenSourceProxy_ != nullptr); }); if (!waitStatus) { DHLOGE("screen load sa timeout."); + int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( + OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + "SA_ERROR", + OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, + "PID", getpid(), + "UID", getuid(), + "MSG", "dscreen source sa load timeout."); + if (res != DH_SUCCESS) { + DHLOGE("Write HiSysEvent error, res:%d", res); + } return ERR_DH_SCREEN_SA_LOAD_TIMEOUT; } diff --git a/interfaces/innerkits/native_cpp/test/unittest/screensinktest/BUILD.gn b/interfaces/innerkits/native_cpp/test/unittest/screensinktest/BUILD.gn index 7a36a109..29eac182 100644 --- a/interfaces/innerkits/native_cpp/test/unittest/screensinktest/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/unittest/screensinktest/BUILD.gn @@ -21,7 +21,7 @@ config("module_private_config") { visibility = [ ":*" ] include_dirs = [ "//third_party/json/include", - "//foundation/graphic/standard/interfaces/innerkits/surface", + "//foundation/graphic/graphic/interfaces/innerkits/surface", "${fwk_common_path}/utils/include", "${fwk_utils_path}/include", ] diff --git a/interfaces/innerkits/native_cpp/test/unittest/screensourcetest/BUILD.gn b/interfaces/innerkits/native_cpp/test/unittest/screensourcetest/BUILD.gn index 540b1a8e..4be676ff 100644 --- a/interfaces/innerkits/native_cpp/test/unittest/screensourcetest/BUILD.gn +++ b/interfaces/innerkits/native_cpp/test/unittest/screensourcetest/BUILD.gn @@ -21,7 +21,7 @@ config("module_private_config") { visibility = [ ":*" ] include_dirs = [ "//third_party/json/include", - "//foundation/graphic/standard/interfaces/innerkits/surface", + "//foundation/graphic/graphic/interfaces/innerkits/surface", "${fwk_common_path}/utils/include", "${fwk_utils_path}/include", ] diff --git a/services/screenclient/BUILD.gn b/services/screenclient/BUILD.gn index ab4e73c2..68dab591 100644 --- a/services/screenclient/BUILD.gn +++ b/services/screenclient/BUILD.gn @@ -50,6 +50,7 @@ ohos_shared_library("distributed_screen_client") { ] external_deps = [ + "hisysevent_native:libhisysevent", "hiviewdfx_hilog_native:libhilog", "input:libmmi-client", ] diff --git a/services/screenclient/src/screen_client_window_adapter.cpp b/services/screenclient/src/screen_client_window_adapter.cpp index 9e3eb78c..eba5a749 100644 --- a/services/screenclient/src/screen_client_window_adapter.cpp +++ b/services/screenclient/src/screen_client_window_adapter.cpp @@ -15,6 +15,7 @@ #include "screen_client_window_adapter.h" +#include "hisysevent.h" #include "rs_surface_node.h" #include "window_option.h" #include "wm_common.h" @@ -63,6 +64,16 @@ sptr ScreenClientWindowAdapter::CreateWindow(std::shared_ptr window = Rosen::Window::Create(windowName, option); if (window == nullptr || window->GetSurfaceNode() == nullptr) { DHLOGE("Create screen client window failed."); + int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( + OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + "WINDOW_ERROR", + OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, + "PID", getpid(), + "UID", getuid(), + "MSG", "create window failed."); + if (res != DH_SUCCESS) { + DHLOGE("Write HiSysEvent error, res:%d", res); + } return nullptr; } auto surface = window->GetSurfaceNode()->GetSurface(); @@ -111,6 +122,16 @@ int32_t ScreenClientWindowAdapter::ShowWindow(int32_t windowId) } if (OHOS::Rosen::WMError::WM_OK != window->Show()) { DHLOGE("Show window failed."); + int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( + OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + "WINDOW_ERROR", + OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, + "PID", getpid(), + "UID", getuid(), + "MSG", "show window failed."); + if (res != DH_SUCCESS) { + DHLOGE("Write HiSysEvent error, res:%d", res); + } return ERR_DH_SCREEN_SCREENCLIENT_SHOW_WINDOW_ERROR; } DHLOGD("Show window (windowId = %d) success.", windowId); diff --git a/services/screenservice/sourceservice/BUILD.gn b/services/screenservice/sourceservice/BUILD.gn index a821fa96..6da772f6 100644 --- a/services/screenservice/sourceservice/BUILD.gn +++ b/services/screenservice/sourceservice/BUILD.gn @@ -74,6 +74,7 @@ ohos_shared_library("distributed_screen_source") { ] external_deps = [ + "hisysevent_native:libhisysevent", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "safwk:system_ability_fwk", diff --git a/services/screenservice/sourceservice/dscreenmgr/src/screen_manager_adapter.cpp b/services/screenservice/sourceservice/dscreenmgr/src/screen_manager_adapter.cpp index 6e6cb06a..d013edd8 100644 --- a/services/screenservice/sourceservice/dscreenmgr/src/screen_manager_adapter.cpp +++ b/services/screenservice/sourceservice/dscreenmgr/src/screen_manager_adapter.cpp @@ -19,6 +19,7 @@ #include "display_manager.h" #include "dm_common.h" +#include "hisysevent.h" #include "screen.h" #include "dscreen_constants.h" @@ -46,6 +47,16 @@ uint64_t ScreenMgrAdapter::CreateVirtualScreen(const std::string &devId, const s Rosen::DMError err = Rosen::ScreenManager::GetInstance().DestroyVirtualScreen(iter->second); if (err != Rosen::DMError::DM_OK) { DHLOGE("remove virtual screen failed, screenId:%ulld", iter->second); + int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( + OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + "VIRTUALSCREEN_ERROR", + OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, + "PID", getpid(), + "UID", getuid(), + "MSG", "destroy virtual screen failed."); + if (res != DH_SUCCESS) { + DHLOGE("Write HiSysEvent error, res:%d", res); + } return SCREEN_ID_INVALID; } screenIdMap_.erase(screenName); @@ -62,6 +73,18 @@ uint64_t ScreenMgrAdapter::CreateVirtualScreen(const std::string &devId, const s }; uint64_t screenId = Rosen::ScreenManager::GetInstance().CreateVirtualScreen(option); + if (screenId == SCREEN_ID_INVALID) { + int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( + OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + "VIRTUALSCREEN_ERROR", + OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, + "PID", getpid(), + "UID", getuid(), + "MSG", "create virtual screen failed."); + if (res != DH_SUCCESS) { + DHLOGE("Write HiSysEvent error, res:%d", res); + } + } screenIdMap_.emplace(screenName, screenId); return screenId; } @@ -112,6 +135,16 @@ int32_t ScreenMgrAdapter::RemoveVirtualScreen(uint64_t screenId) Rosen::DMError err = Rosen::ScreenManager::GetInstance().DestroyVirtualScreen(screenId); if (err != Rosen::DMError::DM_OK) { DHLOGE("remove virtual screen failed, screenId:%ulld", screenId); + int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( + OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + "VIRTUALSCREEN_ERROR", + OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, + "PID", getpid(), + "UID", getuid(), + "MSG", "destroy virtual screen failed."); + if (res != DH_SUCCESS) { + DHLOGE("Write HiSysEvent error, res:%d", res); + } return ERR_DH_SCREEN_SA_REMOVE_VIRTUALSCREEN_FAIL; } return DH_SUCCESS; diff --git a/services/screentransport/screensinkprocessor/decoder/src/image_sink_decoder.cpp b/services/screentransport/screensinkprocessor/decoder/src/image_sink_decoder.cpp index 6f5d6543..78417cd6 100644 --- a/services/screentransport/screensinkprocessor/decoder/src/image_sink_decoder.cpp +++ b/services/screentransport/screensinkprocessor/decoder/src/image_sink_decoder.cpp @@ -18,6 +18,8 @@ #include #include +#include "hisysevent.h" + #include "dscreen_constants.h" #include "dscreen_errcode.h" #include "dscreen_log.h" @@ -78,6 +80,16 @@ int32_t ImageSinkDecoder::StartDecoder() ret = videoDecoder_->Start(); if (ret != Media::MSERR_OK) { DHLOGE("%s: Start decoder failed.", LOG_TAG); + int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( + OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + "VIDEO_DECODER_ERROR", + OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, + "PID", getpid(), + "UID", getuid(), + "MSG", "video decoder start failed."); + if (res != DH_SUCCESS) { + DHLOGE("Write HiSysEvent error, res:%d", res); + } return ERR_DH_SCREEN_CODEC_START_FAILED; } StartInputThread(); @@ -102,6 +114,16 @@ int32_t ImageSinkDecoder::StopDecoder() ret = videoDecoder_->Stop(); if (ret != Media::MSERR_OK) { DHLOGE("%s: Stop decoder failed.", LOG_TAG); + int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( + OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + "VIDEO_DECODER_ERROR", + OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, + "PID", getpid(), + "UID", getuid(), + "MSG", "video decoder stop failed."); + if (res != DH_SUCCESS) { + DHLOGE("Write HiSysEvent error, res:%d", res); + } return ERR_DH_SCREEN_CODEC_STOP_FAILED; } StopInputThread(); diff --git a/services/screentransport/screensinktrans/BUILD.gn b/services/screentransport/screensinktrans/BUILD.gn index 7f22e34f..ec24bd54 100644 --- a/services/screentransport/screensinktrans/BUILD.gn +++ b/services/screentransport/screensinktrans/BUILD.gn @@ -60,6 +60,7 @@ ohos_shared_library("distributed_screen_sinktrans") { ] external_deps = [ + "hisysevent_native:libhisysevent", "dsoftbus_standard:softbus_client", "hiviewdfx_hilog_native:libhilog", "multimedia_media_standard:media_client", diff --git a/services/screentransport/screensourceprocessor/encoder/src/image_source_encoder.cpp b/services/screentransport/screensourceprocessor/encoder/src/image_source_encoder.cpp index bb8f216d..1a21da7c 100644 --- a/services/screentransport/screensourceprocessor/encoder/src/image_source_encoder.cpp +++ b/services/screentransport/screensourceprocessor/encoder/src/image_source_encoder.cpp @@ -18,6 +18,8 @@ #include #include +#include "hisysevent.h" + #include "dscreen_constants.h" #include "dscreen_errcode.h" #include "dscreen_log.h" @@ -84,6 +86,16 @@ int32_t ImageSourceEncoder::StartEncoder() ret = videoEncoder_->Start(); if (ret != Media::MSERR_OK) { DHLOGE("%s: Start encoder failed.", LOG_TAG); + int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( + OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + "VIDEO_ENCODER_ERROR", + OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, + "PID", getpid(), + "UID", getuid(), + "MSG", "video encoder start failed."); + if (res != DH_SUCCESS) { + DHLOGE("Write HiSysEvent error, res:%d", res); + } return ERR_DH_SCREEN_CODEC_START_FAILED; } @@ -106,6 +118,16 @@ int32_t ImageSourceEncoder::StopEncoder() ret = videoEncoder_->Stop(); if (ret != Media::MSERR_OK) { DHLOGE("%s: Stop encoder failed.", LOG_TAG); + int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( + OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + "VIDEO_ENCODER_ERROR", + OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, + "PID", getpid(), + "UID", getuid(), + "MSG", "video encoder stop failed."); + if (res != DH_SUCCESS) { + DHLOGE("Write HiSysEvent error, res:%d", res); + } return ERR_DH_SCREEN_CODEC_STOP_FAILED; } diff --git a/services/screentransport/screensourcetrans/BUILD.gn b/services/screentransport/screensourcetrans/BUILD.gn index fa3f89a7..1e74dcb3 100644 --- a/services/screentransport/screensourcetrans/BUILD.gn +++ b/services/screentransport/screensourcetrans/BUILD.gn @@ -59,6 +59,7 @@ ohos_shared_library("distributed_screen_sourcetrans") { ] external_deps = [ + "hisysevent_native:libhisysevent", "dsoftbus_standard:softbus_client", "hiviewdfx_hilog_native:libhilog", "multimedia_media_standard:media_client", diff --git a/services/softbusadapter/src/softbus_adapter.cpp b/services/softbusadapter/src/softbus_adapter.cpp index 29a1378c..a346d5fc 100644 --- a/services/softbusadapter/src/softbus_adapter.cpp +++ b/services/softbusadapter/src/softbus_adapter.cpp @@ -16,7 +16,9 @@ #include "softbus_adapter.h" #include +#include +#include "hisysevent.h" #include "softbus_bus_center.h" #include "softbus_common.h" @@ -109,6 +111,18 @@ int32_t SoftbusAdapter::CreateSoftbusSessionServer(const std::string &pkgname, c int32_t ret = CreateSessionServer(pkgname.c_str(), sessionName.c_str(), &sessListener_); if (ret != DH_SUCCESS) { DHLOGE("%s: CreateSessionServer failed.", LOG_TAG); + int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( + OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + "SOFTBUS_SESSIONSERVER_ERROR", + OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, + "PID", getpid(), + "UID", getuid(), + "PKGNAME", pkgname.c_str(), + "SESSIONNAME", sessionName.c_str(), + "MSG", "create session server failed."); + if (res != DH_SUCCESS) { + DHLOGE("Write HiSysEvent error, res:%d", res); + } return ret; } } else { @@ -136,6 +150,18 @@ int32_t SoftbusAdapter::RemoveSoftbusSessionServer(const std::string &pkgname, c int32_t ret = RemoveSessionServer(pkgname.c_str(), sessionName.c_str()); if (ret != DH_SUCCESS) { DHLOGE("%s: RemoveSessionServer failed.", LOG_TAG); + int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( + OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + "SOFTBUS_SESSIONSERVER_ERROR", + OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, + "PID", getpid(), + "UID", getuid(), + "PKGNAME", pkgname.c_str(), + "SESSIONNAME", sessionName.c_str(), + "MSG", "remove session server failed."); + if (res != DH_SUCCESS) { + DHLOGE("Write HiSysEvent error, res:%d", res); + } return ret; } @@ -177,6 +203,19 @@ int32_t SoftbusAdapter::OpenSoftbusSession(const std::string &mySessionName, con int32_t sessionId = OpenSession(mySessionName.c_str(), peerSessionName.c_str(), peerDevId.c_str(), "0", &attr); if (sessionId < 0) { DHLOGE("%s: OpenSession failed sessionId:%d.", LOG_TAG, sessionId); + int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( + OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + "SOFTBUS_SESSION_ERROR", + OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, + "PID", getpid(), + "UID", getuid(), + "MYSESSIONNAME", mySessionName.c_str(), + "PEERSESSIONNAME", peerSessionName.c_str(), + "PEERDEVID", peerDevId.c_str(), + "MSG", "open session failed."); + if (res != DH_SUCCESS) { + DHLOGE("Write HiSysEvent error, res:%d", res); + } return ERR_DH_SCREEN_ADAPTER_OPEN_SESSION_FAIL; } -- Gitee From 6a3b6f3d118161056a932f669054ed68efa232de Mon Sep 17 00:00:00 2001 From: im-off-this-week Date: Thu, 12 May 2022 20:32:19 +0800 Subject: [PATCH 2/4] modify gn format Signed-off-by: im-off-this-week --- services/screentransport/screensinktrans/BUILD.gn | 2 +- services/screentransport/screensourcetrans/BUILD.gn | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/screentransport/screensinktrans/BUILD.gn b/services/screentransport/screensinktrans/BUILD.gn index ec24bd54..4afcdbc6 100644 --- a/services/screentransport/screensinktrans/BUILD.gn +++ b/services/screentransport/screensinktrans/BUILD.gn @@ -60,8 +60,8 @@ ohos_shared_library("distributed_screen_sinktrans") { ] external_deps = [ - "hisysevent_native:libhisysevent", "dsoftbus_standard:softbus_client", + "hisysevent_native:libhisysevent", "hiviewdfx_hilog_native:libhilog", "multimedia_media_standard:media_client", ] diff --git a/services/screentransport/screensourcetrans/BUILD.gn b/services/screentransport/screensourcetrans/BUILD.gn index 1e74dcb3..b5860b99 100644 --- a/services/screentransport/screensourcetrans/BUILD.gn +++ b/services/screentransport/screensourcetrans/BUILD.gn @@ -59,8 +59,8 @@ ohos_shared_library("distributed_screen_sourcetrans") { ] external_deps = [ - "hisysevent_native:libhisysevent", "dsoftbus_standard:softbus_client", + "hisysevent_native:libhisysevent", "hiviewdfx_hilog_native:libhilog", "multimedia_media_standard:media_client", ] -- Gitee From 1b7a3fc46eb94dfb98da4e906c2718f50adc8194 Mon Sep 17 00:00:00 2001 From: im-off-this-week Date: Fri, 13 May 2022 11:00:58 +0800 Subject: [PATCH 3/4] modify dscreen to distscreen Signed-off-by: im-off-this-week --- hisysevent.yaml | 2 +- .../screen_sink/src/callback/dscreen_sink_load_callback.cpp | 2 +- .../native_cpp/screen_sink/src/dscreen_sink_handler.cpp | 4 ++-- .../src/callback/dscreen_source_load_callback.cpp | 2 +- .../native_cpp/screen_source/src/dscreen_source_handler.cpp | 4 ++-- services/screenclient/src/screen_client_window_adapter.cpp | 4 ++-- .../sourceservice/dscreenmgr/src/screen_manager_adapter.cpp | 6 +++--- .../screensinkprocessor/decoder/src/image_sink_decoder.cpp | 4 ++-- .../encoder/src/image_source_encoder.cpp | 4 ++-- services/softbusadapter/src/softbus_adapter.cpp | 6 +++--- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/hisysevent.yaml b/hisysevent.yaml index 4652dfb9..bf0bf5d2 100644 --- a/hisysevent.yaml +++ b/hisysevent.yaml @@ -37,7 +37,7 @@ # Example of some hiviewdfx events definition # ##################################################### -domain: DSCREEN +domain: DISTSCREEN SA_ERROR: __BASE: {type: FAULT, level: CRITICAL, desc: dscreen sa error occured} diff --git a/interfaces/innerkits/native_cpp/screen_sink/src/callback/dscreen_sink_load_callback.cpp b/interfaces/innerkits/native_cpp/screen_sink/src/callback/dscreen_sink_load_callback.cpp index 620a6723..99fd4785 100644 --- a/interfaces/innerkits/native_cpp/screen_sink/src/callback/dscreen_sink_load_callback.cpp +++ b/interfaces/innerkits/native_cpp/screen_sink/src/callback/dscreen_sink_load_callback.cpp @@ -44,7 +44,7 @@ void DScreenSinkLoadCallback::OnLoadSystemAbilityFail(int32_t systemAbilityId) { DHLOGE("load screen SA failed, systemAbilityId:%d", systemAbilityId); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, "SA_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), diff --git a/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp b/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp index 56100b05..527b2207 100644 --- a/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp +++ b/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp @@ -58,7 +58,7 @@ int32_t DScreenSinkHandler::InitSink(const std::string ¶ms) DHLOGE("Failed to Load systemAbility, systemAbilityId:%d, ret code:%d", DISTRIBUTED_HARDWARE_SCREEN_SINK_SA_ID, ret); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, "SA_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), @@ -76,7 +76,7 @@ int32_t DScreenSinkHandler::InitSink(const std::string ¶ms) if (!waitStatus) { DHLOGE("screen load sa timeout"); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, "SA_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), diff --git a/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_load_callback.cpp b/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_load_callback.cpp index 168b15cd..75e5b9c8 100644 --- a/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_load_callback.cpp +++ b/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_load_callback.cpp @@ -43,7 +43,7 @@ void DScreenSourceLoadCallback::OnLoadSystemAbilityFail(int32_t systemAbilityId) { DHLOGE("load screen SA failed, systemAbilityId:%d", systemAbilityId); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, "SA_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), diff --git a/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_handler.cpp b/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_handler.cpp index 96558a4d..eb45d339 100644 --- a/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_handler.cpp +++ b/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_handler.cpp @@ -63,7 +63,7 @@ int32_t DScreenSourceHandler::InitSource(const std::string ¶ms) DHLOGE("Failed to Load systemAbility, systemAbilityId:%d, ret code:%d", DISTRIBUTED_HARDWARE_SCREEN_SOURCE_SA_ID, ret); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, "SA_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), @@ -81,7 +81,7 @@ int32_t DScreenSourceHandler::InitSource(const std::string ¶ms) if (!waitStatus) { DHLOGE("screen load sa timeout."); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, "SA_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), diff --git a/services/screenclient/src/screen_client_window_adapter.cpp b/services/screenclient/src/screen_client_window_adapter.cpp index eba5a749..5a6ca72c 100644 --- a/services/screenclient/src/screen_client_window_adapter.cpp +++ b/services/screenclient/src/screen_client_window_adapter.cpp @@ -65,7 +65,7 @@ sptr ScreenClientWindowAdapter::CreateWindow(std::shared_ptrGetSurfaceNode() == nullptr) { DHLOGE("Create screen client window failed."); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, "WINDOW_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), @@ -123,7 +123,7 @@ int32_t ScreenClientWindowAdapter::ShowWindow(int32_t windowId) if (OHOS::Rosen::WMError::WM_OK != window->Show()) { DHLOGE("Show window failed."); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, "WINDOW_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), diff --git a/services/screenservice/sourceservice/dscreenmgr/src/screen_manager_adapter.cpp b/services/screenservice/sourceservice/dscreenmgr/src/screen_manager_adapter.cpp index d013edd8..35c58474 100644 --- a/services/screenservice/sourceservice/dscreenmgr/src/screen_manager_adapter.cpp +++ b/services/screenservice/sourceservice/dscreenmgr/src/screen_manager_adapter.cpp @@ -48,7 +48,7 @@ uint64_t ScreenMgrAdapter::CreateVirtualScreen(const std::string &devId, const s if (err != Rosen::DMError::DM_OK) { DHLOGE("remove virtual screen failed, screenId:%ulld", iter->second); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, "VIRTUALSCREEN_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), @@ -75,7 +75,7 @@ uint64_t ScreenMgrAdapter::CreateVirtualScreen(const std::string &devId, const s uint64_t screenId = Rosen::ScreenManager::GetInstance().CreateVirtualScreen(option); if (screenId == SCREEN_ID_INVALID) { int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, "VIRTUALSCREEN_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), @@ -136,7 +136,7 @@ int32_t ScreenMgrAdapter::RemoveVirtualScreen(uint64_t screenId) if (err != Rosen::DMError::DM_OK) { DHLOGE("remove virtual screen failed, screenId:%ulld", screenId); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, "VIRTUALSCREEN_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), diff --git a/services/screentransport/screensinkprocessor/decoder/src/image_sink_decoder.cpp b/services/screentransport/screensinkprocessor/decoder/src/image_sink_decoder.cpp index 78417cd6..48b69af4 100644 --- a/services/screentransport/screensinkprocessor/decoder/src/image_sink_decoder.cpp +++ b/services/screentransport/screensinkprocessor/decoder/src/image_sink_decoder.cpp @@ -81,7 +81,7 @@ int32_t ImageSinkDecoder::StartDecoder() if (ret != Media::MSERR_OK) { DHLOGE("%s: Start decoder failed.", LOG_TAG); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, "VIDEO_DECODER_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), @@ -115,7 +115,7 @@ int32_t ImageSinkDecoder::StopDecoder() if (ret != Media::MSERR_OK) { DHLOGE("%s: Stop decoder failed.", LOG_TAG); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, "VIDEO_DECODER_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), diff --git a/services/screentransport/screensourceprocessor/encoder/src/image_source_encoder.cpp b/services/screentransport/screensourceprocessor/encoder/src/image_source_encoder.cpp index 1a21da7c..a92de9f0 100644 --- a/services/screentransport/screensourceprocessor/encoder/src/image_source_encoder.cpp +++ b/services/screentransport/screensourceprocessor/encoder/src/image_source_encoder.cpp @@ -87,7 +87,7 @@ int32_t ImageSourceEncoder::StartEncoder() if (ret != Media::MSERR_OK) { DHLOGE("%s: Start encoder failed.", LOG_TAG); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, "VIDEO_ENCODER_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), @@ -119,7 +119,7 @@ int32_t ImageSourceEncoder::StopEncoder() if (ret != Media::MSERR_OK) { DHLOGE("%s: Stop encoder failed.", LOG_TAG); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, "VIDEO_ENCODER_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), diff --git a/services/softbusadapter/src/softbus_adapter.cpp b/services/softbusadapter/src/softbus_adapter.cpp index a346d5fc..0628810b 100644 --- a/services/softbusadapter/src/softbus_adapter.cpp +++ b/services/softbusadapter/src/softbus_adapter.cpp @@ -112,7 +112,7 @@ int32_t SoftbusAdapter::CreateSoftbusSessionServer(const std::string &pkgname, c if (ret != DH_SUCCESS) { DHLOGE("%s: CreateSessionServer failed.", LOG_TAG); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, "SOFTBUS_SESSIONSERVER_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), @@ -151,7 +151,7 @@ int32_t SoftbusAdapter::RemoveSoftbusSessionServer(const std::string &pkgname, c if (ret != DH_SUCCESS) { DHLOGE("%s: RemoveSessionServer failed.", LOG_TAG); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, "SOFTBUS_SESSIONSERVER_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), @@ -204,7 +204,7 @@ int32_t SoftbusAdapter::OpenSoftbusSession(const std::string &mySessionName, con if (sessionId < 0) { DHLOGE("%s: OpenSession failed sessionId:%d.", LOG_TAG, sessionId); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, "SOFTBUS_SESSION_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), -- Gitee From 7e3617d2b08cf8df5b796e89a5c734dd9f721ae5 Mon Sep 17 00:00:00 2001 From: im-off-this-week Date: Fri, 13 May 2022 11:17:05 +0800 Subject: [PATCH 4/4] modify distributed screen domain Signed-off-by: im-off-this-week --- .../screen_sink/src/callback/dscreen_sink_load_callback.cpp | 2 +- .../native_cpp/screen_sink/src/dscreen_sink_handler.cpp | 4 ++-- .../src/callback/dscreen_source_load_callback.cpp | 2 +- .../native_cpp/screen_source/src/dscreen_source_handler.cpp | 4 ++-- services/screenclient/src/screen_client_window_adapter.cpp | 4 ++-- .../sourceservice/dscreenmgr/src/screen_manager_adapter.cpp | 6 +++--- .../screensinkprocessor/decoder/src/image_sink_decoder.cpp | 4 ++-- .../encoder/src/image_source_encoder.cpp | 4 ++-- services/softbusadapter/src/softbus_adapter.cpp | 6 +++--- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/interfaces/innerkits/native_cpp/screen_sink/src/callback/dscreen_sink_load_callback.cpp b/interfaces/innerkits/native_cpp/screen_sink/src/callback/dscreen_sink_load_callback.cpp index 99fd4785..ef6d9455 100644 --- a/interfaces/innerkits/native_cpp/screen_sink/src/callback/dscreen_sink_load_callback.cpp +++ b/interfaces/innerkits/native_cpp/screen_sink/src/callback/dscreen_sink_load_callback.cpp @@ -44,7 +44,7 @@ void DScreenSinkLoadCallback::OnLoadSystemAbilityFail(int32_t systemAbilityId) { DHLOGE("load screen SA failed, systemAbilityId:%d", systemAbilityId); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTRIBUTED_SCREEN, "SA_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), diff --git a/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp b/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp index 527b2207..dd0446b0 100644 --- a/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp +++ b/interfaces/innerkits/native_cpp/screen_sink/src/dscreen_sink_handler.cpp @@ -58,7 +58,7 @@ int32_t DScreenSinkHandler::InitSink(const std::string ¶ms) DHLOGE("Failed to Load systemAbility, systemAbilityId:%d, ret code:%d", DISTRIBUTED_HARDWARE_SCREEN_SINK_SA_ID, ret); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTRIBUTED_SCREEN, "SA_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), @@ -76,7 +76,7 @@ int32_t DScreenSinkHandler::InitSink(const std::string ¶ms) if (!waitStatus) { DHLOGE("screen load sa timeout"); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTRIBUTED_SCREEN, "SA_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), diff --git a/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_load_callback.cpp b/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_load_callback.cpp index 75e5b9c8..ce4c32b8 100644 --- a/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_load_callback.cpp +++ b/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_load_callback.cpp @@ -43,7 +43,7 @@ void DScreenSourceLoadCallback::OnLoadSystemAbilityFail(int32_t systemAbilityId) { DHLOGE("load screen SA failed, systemAbilityId:%d", systemAbilityId); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTRIBUTED_SCREEN, "SA_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), diff --git a/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_handler.cpp b/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_handler.cpp index eb45d339..dded9556 100644 --- a/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_handler.cpp +++ b/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_handler.cpp @@ -63,7 +63,7 @@ int32_t DScreenSourceHandler::InitSource(const std::string ¶ms) DHLOGE("Failed to Load systemAbility, systemAbilityId:%d, ret code:%d", DISTRIBUTED_HARDWARE_SCREEN_SOURCE_SA_ID, ret); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTRIBUTED_SCREEN, "SA_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), @@ -81,7 +81,7 @@ int32_t DScreenSourceHandler::InitSource(const std::string ¶ms) if (!waitStatus) { DHLOGE("screen load sa timeout."); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTRIBUTED_SCREEN, "SA_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), diff --git a/services/screenclient/src/screen_client_window_adapter.cpp b/services/screenclient/src/screen_client_window_adapter.cpp index 5a6ca72c..d7c0098b 100644 --- a/services/screenclient/src/screen_client_window_adapter.cpp +++ b/services/screenclient/src/screen_client_window_adapter.cpp @@ -65,7 +65,7 @@ sptr ScreenClientWindowAdapter::CreateWindow(std::shared_ptrGetSurfaceNode() == nullptr) { DHLOGE("Create screen client window failed."); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTRIBUTED_SCREEN, "WINDOW_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), @@ -123,7 +123,7 @@ int32_t ScreenClientWindowAdapter::ShowWindow(int32_t windowId) if (OHOS::Rosen::WMError::WM_OK != window->Show()) { DHLOGE("Show window failed."); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTRIBUTED_SCREEN, "WINDOW_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), diff --git a/services/screenservice/sourceservice/dscreenmgr/src/screen_manager_adapter.cpp b/services/screenservice/sourceservice/dscreenmgr/src/screen_manager_adapter.cpp index 35c58474..b3f4c0a3 100644 --- a/services/screenservice/sourceservice/dscreenmgr/src/screen_manager_adapter.cpp +++ b/services/screenservice/sourceservice/dscreenmgr/src/screen_manager_adapter.cpp @@ -48,7 +48,7 @@ uint64_t ScreenMgrAdapter::CreateVirtualScreen(const std::string &devId, const s if (err != Rosen::DMError::DM_OK) { DHLOGE("remove virtual screen failed, screenId:%ulld", iter->second); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTRIBUTED_SCREEN, "VIRTUALSCREEN_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), @@ -75,7 +75,7 @@ uint64_t ScreenMgrAdapter::CreateVirtualScreen(const std::string &devId, const s uint64_t screenId = Rosen::ScreenManager::GetInstance().CreateVirtualScreen(option); if (screenId == SCREEN_ID_INVALID) { int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTRIBUTED_SCREEN, "VIRTUALSCREEN_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), @@ -136,7 +136,7 @@ int32_t ScreenMgrAdapter::RemoveVirtualScreen(uint64_t screenId) if (err != Rosen::DMError::DM_OK) { DHLOGE("remove virtual screen failed, screenId:%ulld", screenId); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTRIBUTED_SCREEN, "VIRTUALSCREEN_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), diff --git a/services/screentransport/screensinkprocessor/decoder/src/image_sink_decoder.cpp b/services/screentransport/screensinkprocessor/decoder/src/image_sink_decoder.cpp index 48b69af4..ebd31d7a 100644 --- a/services/screentransport/screensinkprocessor/decoder/src/image_sink_decoder.cpp +++ b/services/screentransport/screensinkprocessor/decoder/src/image_sink_decoder.cpp @@ -81,7 +81,7 @@ int32_t ImageSinkDecoder::StartDecoder() if (ret != Media::MSERR_OK) { DHLOGE("%s: Start decoder failed.", LOG_TAG); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTRIBUTED_SCREEN, "VIDEO_DECODER_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), @@ -115,7 +115,7 @@ int32_t ImageSinkDecoder::StopDecoder() if (ret != Media::MSERR_OK) { DHLOGE("%s: Stop decoder failed.", LOG_TAG); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTRIBUTED_SCREEN, "VIDEO_DECODER_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), diff --git a/services/screentransport/screensourceprocessor/encoder/src/image_source_encoder.cpp b/services/screentransport/screensourceprocessor/encoder/src/image_source_encoder.cpp index a92de9f0..ca2621b4 100644 --- a/services/screentransport/screensourceprocessor/encoder/src/image_source_encoder.cpp +++ b/services/screentransport/screensourceprocessor/encoder/src/image_source_encoder.cpp @@ -87,7 +87,7 @@ int32_t ImageSourceEncoder::StartEncoder() if (ret != Media::MSERR_OK) { DHLOGE("%s: Start encoder failed.", LOG_TAG); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTRIBUTED_SCREEN, "VIDEO_ENCODER_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), @@ -119,7 +119,7 @@ int32_t ImageSourceEncoder::StopEncoder() if (ret != Media::MSERR_OK) { DHLOGE("%s: Stop encoder failed.", LOG_TAG); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTRIBUTED_SCREEN, "VIDEO_ENCODER_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), diff --git a/services/softbusadapter/src/softbus_adapter.cpp b/services/softbusadapter/src/softbus_adapter.cpp index 0628810b..2d7e1f63 100644 --- a/services/softbusadapter/src/softbus_adapter.cpp +++ b/services/softbusadapter/src/softbus_adapter.cpp @@ -112,7 +112,7 @@ int32_t SoftbusAdapter::CreateSoftbusSessionServer(const std::string &pkgname, c if (ret != DH_SUCCESS) { DHLOGE("%s: CreateSessionServer failed.", LOG_TAG); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTRIBUTED_SCREEN, "SOFTBUS_SESSIONSERVER_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), @@ -151,7 +151,7 @@ int32_t SoftbusAdapter::RemoveSoftbusSessionServer(const std::string &pkgname, c if (ret != DH_SUCCESS) { DHLOGE("%s: RemoveSessionServer failed.", LOG_TAG); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTRIBUTED_SCREEN, "SOFTBUS_SESSIONSERVER_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), @@ -204,7 +204,7 @@ int32_t SoftbusAdapter::OpenSoftbusSession(const std::string &mySessionName, con if (sessionId < 0) { DHLOGE("%s: OpenSession failed sessionId:%d.", LOG_TAG, sessionId); int32_t res = OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DISTSCREEN, + OHOS::HiviewDFX::HiSysEvent::Domain::DISTRIBUTED_SCREEN, "SOFTBUS_SESSION_ERROR", OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, "PID", getpid(), -- Gitee