musl: third_party/perfetto: Support old Musl with missing pthread_getname_np
Following base/sampling_heap_profiler/sampling_heap_profiler.cc, Linux can use prctl for this directly.
This commit is contained in:
@ -31,7 +31,7 @@
|
||||
#include <algorithm>
|
||||
#endif
|
||||
|
||||
#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
|
||||
#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX)
|
||||
#include <sys/prctl.h>
|
||||
#endif
|
||||
|
||||
@ -59,7 +59,7 @@ inline bool MaybeSetThreadName(const std::string& name) {
|
||||
|
||||
inline bool GetThreadName(std::string& out_result) {
|
||||
char buf[16] = {};
|
||||
#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
|
||||
#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX)
|
||||
if (prctl(PR_GET_NAME, buf) != 0)
|
||||
return false;
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user