添加hisysevent

Signed-off-by: chen0088 <chenmenghuan3@huawei.com>
This commit is contained in:
chen0088
2022-05-24 17:13:02 +08:00
parent fc8d1beecc
commit 24a6e8e1e0
6 changed files with 19 additions and 23 deletions
@@ -15,8 +15,6 @@
#include "dcamera_sink_load_callback.h"
#include <unistd.h>
#include "hisysevent.h"
#include "dcamera_sink_handler.h"
#include "distributed_hardware_log.h"
@@ -15,8 +15,6 @@
#include "dcamera_source_load_callback.h"
#include <unistd.h>
#include "hisysevent.h"
#include "dcamera_source_handler.h"
#include "distributed_hardware_log.h"
@@ -15,8 +15,6 @@
#include "dcamera_source_dev.h"
#include <unistd.h>
#include "anonymous_string.h"
#include "hisysevent.h"
#include "distributed_camera_constants.h"
@@ -211,24 +211,30 @@ int32_t DCameraSoftbusAdapter::OpenSoftbusSession(std::string mySessName, std::s
int32_t sessionId = OpenSession(mySessName.c_str(), peerSessName.c_str(), peerDevId.c_str(), "0", &attr);
if (sessionId < 0) {
DHLOGE("DCameraSoftbusAdapter OpenSoftbusSession failed %d", sessionId);
int32_t retVal = OHOS::HiviewDFX::HiSysEvent::Write(
OHOS::HiviewDFX::HiSysEvent::Domain::DISTRIBUTED_CAMERA,
"SOFTBUS_SESSION_ERROR",
OHOS::HiviewDFX::HiSysEvent::EventType::FAULT,
"PID", getpid(),
"UID", getuid(),
"MYSESSIONNAME", mySessName.c_str(),
"PEERSESSIONNAME", peerSessName.c_str(),
"PEERDEVID", peerDevId.c_str(),
"MSG", "open softbus session failed.");
if (retVal != DCAMERA_OK) {
DHLOGE("Write HiSysEvent error, retVal:%d", retVal);
}
ReportSoftbusSessionFail(mySessName, peerSessName, peerDevId);
return DCAMERA_BAD_OPERATE;
}
return DCAMERA_OK;
}
void DCameraSoftbusAdapter::ReportSoftbusSessionFail(std::string mySessName,
std::string peerSessName, std::string peerDevId)
{
int32_t retVal = OHOS::HiviewDFX::HiSysEvent::Write(
OHOS::HiviewDFX::HiSysEvent::Domain::DISTRIBUTED_CAMERA,
"SOFTBUS_SESSION_ERROR",
OHOS::HiviewDFX::HiSysEvent::EventType::FAULT,
"PID", getpid(),
"UID", getuid(),
"MYSESSIONNAME", mySessName.c_str(),
"PEERSESSIONNAME", peerSessName.c_str(),
"PEERDEVID", peerDevId.c_str(),
"MSG", "open softbus session failed.");
if (retVal != DCAMERA_OK) {
DHLOGE("Write HiSysEvent error, retVal:%d", retVal);
}
}
int32_t DCameraSoftbusAdapter::CloseSoftbusSession(int32_t sessionId)
{
DHLOGI("close softbus sessionId: %d", sessionId);
@@ -15,8 +15,6 @@
#include "decode_data_process.h"
#include <unistd.h>
#include "hisysevent.h"
#include "distributed_hardware_log.h"
#include "graphic_common_c.h"
@@ -15,8 +15,6 @@
#include "decode_data_process.h"
#include <unistd.h>
#include "hisysevent.h"
#include "distributed_hardware_log.h"
#include "graphic_common_c.h"