From 6ef246ee7e7e6f1e9b46d1cf6e8212647c988ea9 Mon Sep 17 00:00:00 2001 From: hellohyh001 Date: Tue, 7 Nov 2023 07:21:08 +0000 Subject: [PATCH] update Signed-off-by: hellohyh001 --- .../hdi_connection/adapter/src/compatible_connection.cpp | 3 +++ services/miscdevice_service/src/vibrator_thread.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/services/miscdevice_service/hdi_connection/adapter/src/compatible_connection.cpp b/services/miscdevice_service/hdi_connection/adapter/src/compatible_connection.cpp index 2dc8854..401bc24 100644 --- a/services/miscdevice_service/hdi_connection/adapter/src/compatible_connection.cpp +++ b/services/miscdevice_service/hdi_connection/adapter/src/compatible_connection.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -26,6 +27,7 @@ namespace Sensors { using namespace OHOS::HiviewDFX; namespace { constexpr HiLogLabel LABEL = { LOG_CORE, MISC_LOG_DOMAIN, "CompatibleConnection" }; +const std::string VIBRATE_MOCK_THREAD_NAME = "OS_VibMock"; std::unordered_map g_vibratorEffect = { {"haptic.clock.timer", 2000}, {"haptic.default.effect", 804}, @@ -154,6 +156,7 @@ int32_t CompatibleConnection::DestroyHdiConnection() void CompatibleConnection::VibrateProcess() { CALL_LOG_ENTER; + prctl(PR_SET_NAME, VIBRATE_MOCK_THREAD_NAME.c_str()); clock_t vibrateStartTime = clock(); while (clock() - vibrateStartTime < duration_) { if (isStop_) { diff --git a/services/miscdevice_service/src/vibrator_thread.cpp b/services/miscdevice_service/src/vibrator_thread.cpp index 0f88e1b..2192506 100644 --- a/services/miscdevice_service/src/vibrator_thread.cpp +++ b/services/miscdevice_service/src/vibrator_thread.cpp @@ -15,16 +15,21 @@ #include "vibrator_thread.h" +#include + #include "sensors_errors.h" namespace OHOS { namespace Sensors { namespace { constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { LOG_CORE, MISC_LOG_DOMAIN, "VibratorThread" }; +const std::string VIBRATE_CONTROL_THREAD_NAME = "OS_VibControl"; } // namespace bool VibratorThread::Run() { + CALL_LOG_ENTER; + prctl(PR_SET_NAME, VIBRATE_CONTROL_THREAD_NAME.c_str()); VibrateInfo info = GetCurrentVibrateInfo(); std::unique_lock vibrateLck(vibrateMutex_); if (info.mode == "time") { -- Gitee