SF: fix threads name
Some of SF's threads are using a too long name which cause
pthread_setname_np to fail.
Fixes: 183128214
Test: systrace
Change-Id: I473342857bfa0642f99c8910020114ae37559cbb
diff --git a/libs/renderengine/threaded/RenderEngineThreaded.h b/libs/renderengine/threaded/RenderEngineThreaded.h
index df0551d..7694328 100644
--- a/libs/renderengine/threaded/RenderEngineThreaded.h
+++ b/libs/renderengine/threaded/RenderEngineThreaded.h
@@ -73,7 +73,7 @@
/* ------------------------------------------------------------------------
* Threading
*/
- const char* const mThreadName = "RenderEngineThread";
+ const char* const mThreadName = "RenderEngine";
// Protects the creation and destruction of mThread.
mutable std::mutex mThreadMutex;
std::thread mThread GUARDED_BY(mThreadMutex);
diff --git a/services/surfaceflinger/RegionSamplingThread.cpp b/services/surfaceflinger/RegionSamplingThread.cpp
index e06bc88..d0032ac 100644
--- a/services/surfaceflinger/RegionSamplingThread.cpp
+++ b/services/surfaceflinger/RegionSamplingThread.cpp
@@ -176,7 +176,7 @@
mScheduler(scheduler),
mTunables(tunables),
mIdleTimer(
- "RegionSamplingIdleTimer",
+ "RegSampIdle",
std::chrono::duration_cast<std::chrono::milliseconds>(
mTunables.mSamplingTimerTimeout),
[] {}, [this] { checkForStaleLuma(); }),
@@ -184,7 +184,7 @@
tunables.mSamplingDuration)),
lastSampleTime(0ns) {
mThread = std::thread([this]() { threadMain(); });
- pthread_setname_np(mThread.native_handle(), "RegionSamplingThread");
+ pthread_setname_np(mThread.native_handle(), "RegionSampling");
mIdleTimer.start();
}