From 6d151a7122405b82c3eec0bab3c09f1172f2a179 Mon Sep 17 00:00:00 2001 From: wuzhihuitmac Date: Fri, 5 Aug 2022 10:16:51 +0000 Subject: [PATCH] Delete high frequency log Print Signed-off-by: wuzhihuitmac Change-Id: I9719c4480f94e80e70c31eb690da4405d05305d2 --- interfaces/plugin/src/sensor_js.cpp | 8 ++++++-- interfaces/plugin/src/sensor_napi_utils.cpp | 1 - .../sensor/hdi_connection/adapter/src/hdi_connection.cpp | 2 -- services/sensor/src/client_info.cpp | 4 ---- services/sensor/src/flush_info_record.cpp | 2 -- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/interfaces/plugin/src/sensor_js.cpp b/interfaces/plugin/src/sensor_js.cpp index 6ee6d37c..c3ac9aef 100644 --- a/interfaces/plugin/src/sensor_js.cpp +++ b/interfaces/plugin/src/sensor_js.cpp @@ -90,7 +90,9 @@ static bool CheckSystemSubscribe(int32_t sensorTypeId) { std::lock_guard subscribeLock(mutex_); auto iter = g_subscribeCallbacks.find(sensorTypeId); - CHKCF((iter != g_subscribeCallbacks.end()), "No client subscribe"); + if (iter == g_subscribeCallbacks.end()) { + return false; + } return true; } @@ -98,7 +100,9 @@ static void EmitSubscribeCallback(SensorEvent *event) { CHKPV(event); int32_t sensorTypeId = event->sensorTypeId; - CHKCV(CheckSystemSubscribe(sensorTypeId), "No client subscribe"); + if (!CheckSystemSubscribe(sensorTypeId)) { + return; + } std::lock_guard subscribeLock(mutex_); auto callback = g_subscribeCallbacks[sensorTypeId]; CHKCV(copySensorData(callback, event), "Copy sensor data failed"); diff --git a/interfaces/plugin/src/sensor_napi_utils.cpp b/interfaces/plugin/src/sensor_napi_utils.cpp index 3da910bb..ba575d2c 100644 --- a/interfaces/plugin/src/sensor_napi_utils.cpp +++ b/interfaces/plugin/src/sensor_napi_utils.cpp @@ -483,7 +483,6 @@ void EmitAsyncCallbackWork(sptr asyncCallbackInfo) void freeWork(uv_work_t *work) { - CALL_LOG_ENTER; CHKPV(work); delete work; work = nullptr; diff --git a/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp b/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp index 4cdf2604..04b743fd 100644 --- a/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp +++ b/services/sensor/hdi_connection/adapter/src/hdi_connection.cpp @@ -203,7 +203,6 @@ int32_t HdiConnection::RunCommand(int32_t sensorId, int32_t cmd, int32_t params) ZReportDataCb HdiConnection::getReportDataCb() { - CALL_LOG_ENTER; if (reportDataCb_ == nullptr) { SEN_HILOGE("reportDataCb_ cannot be null"); } @@ -212,7 +211,6 @@ ZReportDataCb HdiConnection::getReportDataCb() sptr HdiConnection::getReportDataCallback() { - CALL_LOG_ENTER; if (reportDataCallback_ == nullptr) { SEN_HILOGE("reportDataCallback_ cannot be null"); } diff --git a/services/sensor/src/client_info.cpp b/services/sensor/src/client_info.cpp index e795dda1..ebc4f2bd 100644 --- a/services/sensor/src/client_info.cpp +++ b/services/sensor/src/client_info.cpp @@ -63,7 +63,6 @@ bool ClientInfo::GetSensorState(uint32_t sensorId) SensorBasicInfo ClientInfo::GetBestSensorInfo(uint32_t sensorId) { - CALL_LOG_ENTER; int64_t minSamplingPeriodNs = LLONG_MAX; int64_t minReportDelayNs = LLONG_MAX; SensorBasicInfo sensorInfo; @@ -353,7 +352,6 @@ bool ClientInfo::DestroySensorChannel(int32_t pid) SensorBasicInfo ClientInfo::GetCurPidSensorInfo(uint32_t sensorId, int32_t pid) { - SEN_HILOGD("begin, sensorId : %{public}u", sensorId); int64_t minSamplingPeriodNs = LLONG_MAX; int64_t minReportDelayNs = LLONG_MAX; SensorBasicInfo sensorInfo; @@ -467,7 +465,6 @@ void ClientInfo::StoreEvent(const SensorEvent &event) } for (size_t i = 0; i < sensors.size(); i++) { if ((int32_t)(sensors[i].GetSensorId()) == storedEvent.sensorTypeId) { - SEN_HILOGD("sensorFlags : %{public}u", sensors[i].GetFlags()); foundSensor = true; break; } @@ -657,7 +654,6 @@ std::vector ClientInfo::GetCmdList(uint32_t sensorId, int32_t uid) void ClientInfo::UpdateDataQueue(int32_t sensorId, SensorEvent &event) { - CALL_LOG_ENTER; if (sensorId == HEART_RATE_SENSOR_ID) { return; } diff --git a/services/sensor/src/flush_info_record.cpp b/services/sensor/src/flush_info_record.cpp index fd51ed70..63e716bd 100644 --- a/services/sensor/src/flush_info_record.cpp +++ b/services/sensor/src/flush_info_record.cpp @@ -33,7 +33,6 @@ enum { std::unordered_map> FlushInfoRecord::GetFlushInfo() { - CALL_LOG_ENTER; std::lock_guard flushLock(flushInfoMutex_); return flushInfo_; } @@ -81,7 +80,6 @@ bool FlushInfoRecord::IsFlushChannelValid(const std::vector &flushInfoList, const sptr &channel) { - CALL_LOG_ENTER; for (size_t i = 0; i < flushInfoList.size(); i++) { if (flushInfoList[i].flushChannel == channel) { return i; -- Gitee