diff --git a/frameworks/native/sensor/src/my_file_descriptor_listener.cpp b/frameworks/native/sensor/src/my_file_descriptor_listener.cpp index a562164c05af4f51c649b3575a03e8b4e875fe10..2b1db8cafe2f9d1e9ac24a327c968e461f70a267 100644 --- a/frameworks/native/sensor/src/my_file_descriptor_listener.cpp +++ b/frameworks/native/sensor/src/my_file_descriptor_listener.cpp @@ -14,6 +14,7 @@ */ #include "my_file_descriptor_listener.h" +#include "sensors_errors.h" #include "sensors_log_domain.h" namespace OHOS { @@ -38,7 +39,7 @@ MyFileDescriptorListener::MyFileDescriptorListener() MyFileDescriptorListener::~MyFileDescriptorListener() { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; if (receiveDataBuff_ != nullptr) { delete[] receiveDataBuff_; receiveDataBuff_ = nullptr; @@ -47,7 +48,7 @@ MyFileDescriptorListener::~MyFileDescriptorListener() void MyFileDescriptorListener::OnReadable(int32_t fileDescriptor) { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; if (fileDescriptor < 0) { HiLog::Error(LABEL, "%{public}s fileDescriptor: %{public}d", __func__, fileDescriptor); return; diff --git a/services/sensor/src/client_info.cpp b/services/sensor/src/client_info.cpp index e3e11c87d7ff4b7898f25d1cfd6d644e27a26a66..1ad29e92312ecc1a3b1391f4430cdcf7288fbd5d 100644 --- a/services/sensor/src/client_info.cpp +++ b/services/sensor/src/client_info.cpp @@ -42,7 +42,7 @@ constexpr uint32_t HEART_RATE_SENSOR_ID = 83886336; SensorState ClientInfo::GetSensorState(uint32_t sensorId) { - HiLog::Debug(LABEL, "%{public}s begin, sensorId : %{public}u", __func__, sensorId); + CALL_LOG_ENTER; if (sensorId == INVALID_SENSOR_ID) { HiLog::Error(LABEL, "%{public}s sensorId is invalid", __func__); return SENSOR_DISABLED; @@ -65,7 +65,7 @@ SensorState ClientInfo::GetSensorState(uint32_t sensorId) SensorBasicInfo ClientInfo::GetBestSensorInfo(uint32_t sensorId) { - HiLog::Debug(LABEL, "%{public}s begin, sensorId : %{public}u", __func__, sensorId); + CALL_LOG_ENTER; int64_t minSamplingPeriodNs = LLONG_MAX; int64_t minReportDelayNs = LLONG_MAX; SensorBasicInfo sensorInfo; @@ -96,7 +96,7 @@ SensorBasicInfo ClientInfo::GetBestSensorInfo(uint32_t sensorId) bool ClientInfo::OnlyCurPidSensorEnabled(uint32_t sensorId, int32_t pid) { - HiLog::Debug(LABEL, "%{public}s begin, sensorId : %{public}u, pid : %{public}d", __func__, sensorId, pid); + CALL_LOG_ENTER; if ((sensorId == INVALID_SENSOR_ID) || (pid <= INVALID_PID)) { HiLog::Error(LABEL, "%{public}s sensorId or pid is invalid", __func__); return false; @@ -118,13 +118,12 @@ bool ClientInfo::OnlyCurPidSensorEnabled(uint32_t sensorId, int32_t pid) } ret = true; } - HiLog::Debug(LABEL, "%{public}s end", __func__); return ret; } bool ClientInfo::UpdateAppThreadInfo(int32_t pid, int32_t uid, AccessTokenID callerToken) { - HiLog::Debug(LABEL, "%{public}s begin, pid : %{public}d, uid : %{public}d", __func__, pid, uid); + CALL_LOG_ENTER; if ((uid == INVALID_UID) || (pid <= INVALID_PID)) { HiLog::Error(LABEL, "%{public}s uid or pid is invalid", __func__); return false; @@ -141,13 +140,12 @@ bool ClientInfo::UpdateAppThreadInfo(int32_t pid, int32_t uid, AccessTokenID cal return ret.second; } appThreadInfoMap_[pid] = appThreadInfo; - HiLog::Debug(LABEL, "%{public}s end", __func__); return true; } void ClientInfo::DestroyAppThreadInfo(int32_t pid) { - HiLog::Debug(LABEL, "%{public}s begin, pid : %{public}d", __func__, pid); + CALL_LOG_ENTER; if (pid == INVALID_PID) { HiLog::Error(LABEL, "%{public}s pid is invalid", __func__); return; @@ -163,7 +161,7 @@ void ClientInfo::DestroyAppThreadInfo(int32_t pid) std::vector> ClientInfo::GetSensorChannelByUid(int32_t uid) { - HiLog::Debug(LABEL, "%{public}s begin, uid : %{public}d", __func__, uid); + CALL_LOG_ENTER; if (uid == INVALID_UID) { HiLog::Error(LABEL, "%{public}s uid is invalid", __func__); return {}; @@ -181,13 +179,12 @@ std::vector> ClientInfo::GetSensorChannelByUid(int3 } sensorChannel.push_back(channelIt->second); } - HiLog::Debug(LABEL, "%{public}s end", __func__); return sensorChannel; } sptr ClientInfo::GetSensorChannelByPid(int32_t pid) { - HiLog::Debug(LABEL, "%{public}s begin, pid : %{public}d", __func__, pid); + CALL_LOG_ENTER; if (pid == INVALID_PID) { HiLog::Error(LABEL, "%{public}s pid is invalid", __func__); return nullptr; @@ -198,7 +195,6 @@ sptr ClientInfo::GetSensorChannelByPid(int32_t pid) HiLog::Error(LABEL, "%{public}s there is no channel belong to the pid", __func__); return nullptr; } - HiLog::Debug(LABEL, "%{public}s end", __func__); return channelIt->second; } @@ -229,7 +225,7 @@ std::vector> ClientInfo::GetSensorChannel(uint32_t bool ClientInfo::UpdateSensorInfo(uint32_t sensorId, int32_t pid, const SensorBasicInfo &sensorInfo) { - HiLog::Debug(LABEL, "%{public}s begin, sensorId : %{public}u, pid : %{public}d", __func__, sensorId, pid); + CALL_LOG_ENTER; if ((sensorId == INVALID_SENSOR_ID) || (pid <= INVALID_PID) || (sensorInfo.GetSensorState() != SENSOR_ENABLED)) { HiLog::Error(LABEL, "%{public}s params are invalid", __func__); return false; @@ -267,7 +263,7 @@ void ClientInfo::RemoveSubscriber(uint32_t sensorId, uint32_t pid) bool ClientInfo::UpdateSensorChannel(int32_t pid, const sptr &channel) { - HiLog::Debug(LABEL, "%{public}s begin, pid : %{public}d", __func__, pid); + CALL_LOG_ENTER; if (pid <= INVALID_PID || channel == nullptr) { HiLog::Error(LABEL, "%{public}s pid or channel is invalid or channel cannot be null", __func__); return false; @@ -284,13 +280,12 @@ bool ClientInfo::UpdateSensorChannel(int32_t pid, const sptrsecond.GetSamplingPeriodNs()); sensorInfo.SetMaxReportDelayNs(pidIt->second.GetMaxReportDelayNs()); - HiLog::Debug(LABEL, "%{public}s end", __func__); return sensorInfo; } @@ -494,7 +487,7 @@ void ClientInfo::StoreEvent(const struct SensorEvent &event) bool ClientInfo::SaveClientPid(const sptr &sensorClient, int32_t pid) { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; if (sensorClient == nullptr) { HiLog::Error(LABEL, "%{public}s sensorClient cannot be null", __func__); return false; @@ -503,17 +496,15 @@ bool ClientInfo::SaveClientPid(const sptr &sensorClient, int32_t auto it = clientPidMap_.find(sensorClient); if (it == clientPidMap_.end()) { clientPidMap_.insert(std::make_pair(sensorClient, pid)); - HiLog::Debug(LABEL, "%{public}s end", __func__); return true; } clientPidMap_.insert(std::make_pair(sensorClient, pid)); - HiLog::Debug(LABEL, "%{public}s end", __func__); return true; } int32_t ClientInfo::FindClientPid(const sptr &sensorClient) { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; if (sensorClient == nullptr) { HiLog::Error(LABEL, "%{public}s sensorClient cannot be null", __func__); return INVALID_PID; @@ -524,13 +515,12 @@ int32_t ClientInfo::FindClientPid(const sptr &sensorClient) HiLog::Error(LABEL, "%{public}s cannot find client pid", __func__); return INVALID_PID; } - HiLog::Debug(LABEL, "%{public}s end, pid : %{public}d", __func__, it->second); return it->second; } void ClientInfo::DestroyClientPid(const sptr &sensorClient) { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; if (sensorClient == nullptr) { HiLog::Error(LABEL, "%{public}s sensorClient cannot be null", __func__); return; @@ -541,7 +531,6 @@ void ClientInfo::DestroyClientPid(const sptr &sensorClient) HiLog::Error(LABEL, "%{public}s cannot find client pid", __func__); return; } - HiLog::Debug(LABEL, "%{public}s end, pid : %{public}d", __func__, it->second); clientPidMap_.erase(it); } @@ -553,7 +542,7 @@ void ClientInfo::ClearEvent() std::vector ClientInfo::GetSensorIdByPid(int32_t pid) { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; std::vector sensorIdVec; std::lock_guard clientLock(clientMutex_); for (const auto &itClientMap : clientMap_) { @@ -567,7 +556,7 @@ std::vector ClientInfo::GetSensorIdByPid(int32_t pid) AppThreadInfo ClientInfo::GetAppInfoByChannel(const sptr &channel) { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; AppThreadInfo appThreadInfo; { std::lock_guard channelLock(channelMutex_); @@ -590,7 +579,7 @@ AppThreadInfo ClientInfo::GetAppInfoByChannel(const sptr void ClientInfo::GetSensorChannelInfo(std::vector &channelInfo) { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; std::lock_guard clientLock(clientMutex_); for (const auto &sensorIt : clientMap_) { for (const auto &pidIt : sensorIt.second) { @@ -670,7 +659,7 @@ std::vector ClientInfo::GetCmdList(uint32_t sensorId, int32_t uid) void ClientInfo::UpdateDataQueue(int32_t sensorId, struct SensorEvent &event) { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + 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 9f3499189d26e655d4cc37ccd9fe291f0162c840..3e714118bf455d6aa51a9bed27766e9975246633 100644 --- a/services/sensor/src/flush_info_record.cpp +++ b/services/sensor/src/flush_info_record.cpp @@ -34,7 +34,7 @@ enum { std::unordered_map> FlushInfoRecord::GetFlushInfo() { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; std::lock_guard flushLock(flushInfoMutex_); return flushInfo_; } @@ -87,7 +87,7 @@ bool FlushInfoRecord::IsFlushChannelValid(const std::vector &flushInfoList, const sptr &channel) { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; for (size_t i = 0; i < flushInfoList.size(); i++) { if (flushInfoList[i].flushChannel == channel) { return i; diff --git a/services/sensor/src/sensor_data_processer.cpp b/services/sensor/src/sensor_data_processer.cpp index cc1d7788579a44f03a8125ed70ff0d896e204397..dd02a4c820ad9f25ff57c350e8e49c5b4f304045 100644 --- a/services/sensor/src/sensor_data_processer.cpp +++ b/services/sensor/src/sensor_data_processer.cpp @@ -307,7 +307,6 @@ int32_t SensorDataProcesser::CacheSensorEvent(const struct SensorEvent &event, s void SensorDataProcesser::EventFilter(struct CircularEventBuf &eventsBuf) { - HiLog::Debug(LABEL, "%{public}s begin", __func__); uint32_t realSensorId = 0; uint32_t sensorId = static_cast(eventsBuf.circularBuf[eventsBuf.readPosition].sensorTypeId); std::vector> channelList; @@ -399,7 +398,7 @@ int32_t SensorDataProcesser::SendEvents(sptr &channel, s int32_t SensorDataProcesser::DataThread(sptr dataProcesser, sptr dataCallback) { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; do { if (dataProcesser->ProcessEvents(dataCallback) == INVALID_POINTER) { HiLog::Error(LABEL, "%{public}s callback cannot be null", __func__); diff --git a/services/sensor/src/sensor_manager.cpp b/services/sensor/src/sensor_manager.cpp index 39aa400ec16eac461a3bea13004d2d5ad625d975..04a14890056d677e11fa90e6d299d30849cd3f66 100644 --- a/services/sensor/src/sensor_manager.cpp +++ b/services/sensor/src/sensor_manager.cpp @@ -53,8 +53,7 @@ uint32_t SensorManager::GetSensorFlag(uint32_t sensorId) bool SensorManager::SetBestSensorParams(uint32_t sensorId, int64_t samplingPeriodNs, int64_t maxReportDelayNs) { - HiLog::Debug(LABEL, "%{public}s begin, sensorId : %{public}u, samplingPeriodNs : %{public}d", __func__, sensorId, - int32_t { samplingPeriodNs }); + CALL_LOG_ENTER; if (sensorId == INVALID_SENSOR_ID) { HiLog::Error(LABEL, "%{public}s sensorId is invalid", __func__); return false; @@ -74,13 +73,12 @@ bool SensorManager::SetBestSensorParams(uint32_t sensorId, int64_t samplingPerio HiLog::Error(LABEL, "%{public}s SetBatch failed", __func__); return false; } - HiLog::Debug(LABEL, "%{public}s end", __func__); return true; } bool SensorManager::ResetBestSensorParams(uint32_t sensorId) { - HiLog::Debug(LABEL, "%{public}s begin, sensorId : %{public}u", __func__, sensorId); + CALL_LOG_ENTER; if (sensorId == INVALID_SENSOR_ID) { HiLog::Error(LABEL, "%{public}s sensorId is invalid", __func__); return false; @@ -92,13 +90,12 @@ bool SensorManager::ResetBestSensorParams(uint32_t sensorId) HiLog::Error(LABEL, "%{public}s SetBatch failed", __func__); return false; } - HiLog::Debug(LABEL, "%{public}s end", __func__); return true; } SensorBasicInfo SensorManager::GetSensorInfo(uint32_t sensorId, int64_t samplingPeriodNs, int64_t maxReportDelayNs) { - HiLog::Debug(LABEL, "%{public}s begin, sensorId : %{public}u", __func__, sensorId); + CALL_LOG_ENTER; SensorBasicInfo sensorInfo; std::lock_guard sensorMapLock(sensorMapMutex_); auto it = sensorMap_.find(sensorId); @@ -125,7 +122,6 @@ SensorBasicInfo SensorManager::GetSensorInfo(uint32_t sensorId, int64_t sampling sensorInfo.SetSamplingPeriodNs(curSamplingPeriodNs); sensorInfo.SetMaxReportDelayNs(curReportDelayNs); sensorInfo.SetSensorState(SENSOR_ENABLED); - HiLog::Debug(LABEL, "%{public}s end", __func__); return sensorInfo; } @@ -143,18 +139,17 @@ ErrCode SensorManager::SaveSubscriber(uint32_t sensorId, uint32_t pid, int64_t s void SensorManager::StartDataReportThread() { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; if (!dataThread_.joinable()) { HiLog::Warn(LABEL, "%{public}s dataThread_ started", __func__); std::thread senocdDataThread(SensorDataProcesser::DataThread, sensorDataProcesser_, reportDataCallback_); dataThread_ = std::move(senocdDataThread); } - HiLog::Debug(LABEL, "%{public}s end", __func__); } bool SensorManager::IsOtherClientUsingSensor(uint32_t sensorId, int32_t clientPid) { - HiLog::Debug(LABEL, "%{public}s begin, sensorId : %{public}u", __func__, sensorId); + CALL_LOG_ENTER; if (clientInfo_.OnlyCurPidSensorEnabled(sensorId, clientPid)) { HiLog::Warn(LABEL, "%{public}s Only current client using this sensor", __func__); return false; @@ -169,7 +164,7 @@ bool SensorManager::IsOtherClientUsingSensor(uint32_t sensorId, int32_t clientPi ErrCode SensorManager::AfterDisableSensor(uint32_t sensorId) { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; clientInfo_.ClearSensorInfo(sensorId); if (sensorId == PROXIMITY_SENSOR_ID) { struct SensorEvent event; @@ -180,13 +175,12 @@ ErrCode SensorManager::AfterDisableSensor(uint32_t sensorId) clientInfo_.StoreEvent(event); } } - HiLog::Debug(LABEL, "%{public}s end", __func__); return ERR_OK; } void SensorManager::GetPackageNameFromUid(int32_t uid, std::string &packageName) { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; } } // namespace Sensors } // namespace OHOS diff --git a/services/sensor/src/sensor_service.cpp b/services/sensor/src/sensor_service.cpp index 81f2eeaa8f4521220eba4bd5ba48a2c92f45ed93..774ae79cbf284b3e53759e141e87da0facb40c39 100644 --- a/services/sensor/src/sensor_service.cpp +++ b/services/sensor/src/sensor_service.cpp @@ -60,7 +60,7 @@ void SensorService::OnDump() void SensorService::OnStart() { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; if (state_ == SensorServiceState::STATE_RUNNING) { HiLog::Warn(LABEL, "%{public}s SensorService has already started", __func__); return; @@ -144,7 +144,7 @@ bool SensorService::InitSensorPolicy() void SensorService::OnStop() { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; if (state_ == SensorServiceState::STATE_STOPPED) { HiLog::Warn(LABEL, "%{public}s already stopped", __func__); return; @@ -236,8 +236,7 @@ ErrCode SensorService::SaveSubscriber(uint32_t sensorId, int64_t samplingPeriodN ErrCode SensorService::EnableSensor(uint32_t sensorId, int64_t samplingPeriodNs, int64_t maxReportDelayNs) { - HiLog::Debug(LABEL, "%{public}s begin, sensorId : %{public}u, samplingPeriodNs : %{public}" - PRId64, __func__, sensorId, samplingPeriodNs); + CALL_LOG_ENTER; if ((sensorId == INVALID_SENSOR_ID) || ((samplingPeriodNs != 0L) && ((maxReportDelayNs / samplingPeriodNs) > MAX_EVENT_COUNT))) { HiLog::Error(LABEL, "%{public}s sensorId is 0 or maxReportDelayNs exceeded the maximum value", __func__); @@ -280,7 +279,7 @@ ErrCode SensorService::EnableSensor(uint32_t sensorId, int64_t samplingPeriodNs, ErrCode SensorService::DisableSensor(uint32_t sensorId) { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; if (sensorId == INVALID_SENSOR_ID) { HiLog::Error(LABEL, "%{public}s sensorId is invalid", __func__); return ERR_NO_INIT; @@ -321,7 +320,7 @@ int32_t SensorService::GetSensorState(uint32_t sensorId) ErrCode SensorService::RunCommand(uint32_t sensorId, uint32_t cmdType, uint32_t params) { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; if (sensorId == INVALID_SENSOR_ID || ((cmdType != FLUSH) && (cmdType != SET_MODE))) { HiLog::Error(LABEL, "%{public}s sensorId or cmd is invalid", __func__); return ERR_NO_INIT; @@ -386,7 +385,7 @@ ErrCode SensorService::TransferDataChannel(const sptr &s ErrCode SensorService::DestroySensorChannel(sptr sensorClient) { - HiLog::Info(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; const int32_t clientPid = this->GetCallingPid(); if (clientPid < 0) { HiLog::Error(LABEL, "%{public}s clientPid is invalid, clientPid : %{public}d", __func__, clientPid); @@ -400,13 +399,12 @@ ErrCode SensorService::DestroySensorChannel(sptr sensorClient) } clientInfo_.DestroyCmd(this->GetCallingUid()); UnregisterClientDeathRecipient(sensorClient); - HiLog::Info(LABEL, "%{public}s end", __func__); return ERR_OK; } void SensorService::ProcessDeathObserver(const wptr &object) { - HiLog::Info(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; sptr client = object.promote(); if (client == nullptr) { HiLog::Error(LABEL, "%{public}s client cannot be null", __func__); @@ -421,12 +419,11 @@ void SensorService::ProcessDeathObserver(const wptr &object) clientInfo_.DestroySensorChannel(pid); clientInfo_.DestroyClientPid(client); clientInfo_.DestroyCmd(this->GetCallingUid()); - HiLog::Info(LABEL, "%{public}s end", __func__); } void SensorService::RegisterClientDeathRecipient(sptr sensorClient, int32_t pid) { - HiLog::Info(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; sptr client = iface_cast(sensorClient); clientDeathObserver_ = new (std::nothrow) DeathRecipientTemplate(*const_cast(this)); if (clientDeathObserver_ == nullptr) { @@ -435,12 +432,11 @@ void SensorService::RegisterClientDeathRecipient(sptr sensorClien } client->AsObject()->AddDeathRecipient(clientDeathObserver_); clientInfo_.SaveClientPid(sensorClient, pid); - HiLog::Info(LABEL, "%{public}s end", __func__); } void SensorService::UnregisterClientDeathRecipient(sptr sensorClient) { - HiLog::Info(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; sptr client = iface_cast(sensorClient); clientDeathObserver_ = new (std::nothrow) DeathRecipientTemplate(*const_cast(this)); if (clientDeathObserver_ == nullptr) { @@ -449,12 +445,11 @@ void SensorService::UnregisterClientDeathRecipient(sptr sensorCli } client->AsObject()->RemoveDeathRecipient(clientDeathObserver_); clientInfo_.DestroyClientPid(sensorClient); - HiLog::Info(LABEL, "%{public}s end", __func__); } int32_t SensorService::Dump(int32_t fd, const std::vector &args) { - HiLog::Info(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; SensorDump &sensorDump = SensorDump::GetInstance(); if ((args.empty()) || (args[0].size() != MAX_DMUP_PARAM)) { HiLog::Error(LABEL, "%{public}s param cannot be empty or the length is not 2", __func__); @@ -473,7 +468,6 @@ int32_t SensorService::Dump(int32_t fd, const std::vector &args) sensorDump.DumpHelp(fd); return DUMP_PARAM_ERR; } - HiLog::Info(LABEL, "%{public}s end", __func__); return ERR_OK; } } // namespace Sensors diff --git a/services/sensor/src/sensor_suspend_policy.cpp b/services/sensor/src/sensor_suspend_policy.cpp index 0553b8d16f441765781dcf78c86b92d127961eb1..a1c8dec1a56d293b9205df634e753ca5894cb758 100755 --- a/services/sensor/src/sensor_suspend_policy.cpp +++ b/services/sensor/src/sensor_suspend_policy.cpp @@ -44,7 +44,7 @@ bool SensorSuspendPolicy::CheckFreezingSensor(uint32_t sensorId) ErrCode SensorSuspendPolicy::DisableSensor(uint32_t sensorId, int32_t pid) { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; if (sensorId == INVALID_SENSOR_ID) { HiLog::Error(LABEL, "%{public}s sensorId is invalid", __func__); return ERR_NO_INIT; @@ -62,7 +62,7 @@ ErrCode SensorSuspendPolicy::DisableSensor(uint32_t sensorId, int32_t pid) void SensorSuspendPolicy::DoSuspend(const std::shared_ptr &info) { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; std::lock_guard suspendLock(suspendMutex_); auto &list = info->GetAppIPCInfoList(); for (const auto &appInfo : list) { @@ -80,7 +80,6 @@ void SensorSuspendPolicy::DoSuspend(const std::shared_ptr MAX_EVENT_COUNT))) { HiLog::Error(LABEL, "%{public}s sensorId is 0 or maxReportDelayNs exceed the maximum value", __func__); @@ -152,7 +150,7 @@ std::vector SensorSuspendPolicy::GetSensorIdByPid(int32_t pid) void SensorSuspendPolicy::DoActive(const std::shared_ptr &info) { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; int64_t samplePeriod = DEFAULT_SAMPLEING_RATE; int64_t maxReportDelay = DEFAULT_REPORT_DELAY; std::vector sensorIdList; @@ -178,7 +176,6 @@ void SensorSuspendPolicy::DoActive(const std::shared_ptr eventLock(eventMutex_); auto eventIt = eventMap_.find(eventId); if (eventIt == eventMap_.end()) { @@ -87,7 +87,6 @@ void DmdReport::ReportException(int32_t eventId, const std::string &interfaceNam HiviewDFX::HiSysEvent::Write(HiviewDFX::HiSysEvent::Domain::SENSORS, GetEventName(eventId), HiviewDFX::HiSysEvent::EventType::FAULT, interfaceName, error); eventMap_[eventId] = curTime; - HiLog::Debug(LABEL, "%{public}s end", __func__); return; } HiLog::Warn(LABEL, "%{public}s eventId is reported every half an hour", __func__); diff --git a/utils/src/sensor_basic_data_channel.cpp b/utils/src/sensor_basic_data_channel.cpp index 3ae2fc3302afcdbb8b9d6a8c49dd1d6df43a4f9d..13730d9f4a3ef278c70bf29b218745105d80fab2 100755 --- a/utils/src/sensor_basic_data_channel.cpp +++ b/utils/src/sensor_basic_data_channel.cpp @@ -87,7 +87,7 @@ int32_t SensorBasicDataChannel::CreateSensorBasicChannel(size_t sendSize, size_t int32_t SensorBasicDataChannel::CreateSensorBasicChannel(MessageParcel &data) { - HiLog::Debug(LABEL, "%{public}s begin", __func__); + CALL_LOG_ENTER; if ((sendFd_ != INVALID_FD) || (receiveFd_ != INVALID_FD)) { HiLog::Debug(LABEL, "%{public}s already create socketpair", __func__); return ERR_OK;