Differential D38165 Diff 118368 www/qt5-webengine/files/patch-src_3rdparty_chromium_base_sampling__heap__profiler_sampling__heap__profiler.cc
Changeset View
Changeset View
Standalone View
Standalone View
www/qt5-webengine/files/patch-src_3rdparty_chromium_base_sampling__heap__profiler_sampling__heap__profiler.cc
--- src/3rdparty/chromium/base/sampling_heap_profiler/sampling_heap_profiler.cc.orig 2019-11-27 21:12:25 UTC | --- src/3rdparty/chromium/base/sampling_heap_profiler/sampling_heap_profiler.cc.orig 2021-12-15 16:12:54 UTC | ||||
+++ src/3rdparty/chromium/base/sampling_heap_profiler/sampling_heap_profiler.cc | +++ src/3rdparty/chromium/base/sampling_heap_profiler/sampling_heap_profiler.cc | ||||
@@ -29,6 +29,10 @@ | @@ -30,6 +30,10 @@ | ||||
#include <sys/prctl.h> | #include <sys/prctl.h> | ||||
#endif | #endif | ||||
+#if defined(OS_BSD) | +#if defined(OS_BSD) | ||||
+#include <pthread_np.h> | +#include <pthread_np.h> | ||||
+#endif | +#endif | ||||
+ | + | ||||
#if defined(OS_ANDROID) && BUILDFLAG(CAN_UNWIND_WITH_CFI_TABLE) && \ | #if defined(OS_ANDROID) && BUILDFLAG(CAN_UNWIND_WITH_CFI_TABLE) && \ | ||||
defined(OFFICIAL_BUILD) | defined(OFFICIAL_BUILD) | ||||
#include "base/trace_event/cfi_backtrace_android.h" | #include "base/trace_event/cfi_backtrace_android.h" // no-presubmit-check | ||||
@@ -64,6 +68,10 @@ const char* GetAndLeakThreadName() { | @@ -65,6 +69,10 @@ const char* GetAndLeakThreadName() { | ||||
#elif defined(OS_MACOSX) | #elif defined(OS_APPLE) | ||||
int err = pthread_getname_np(pthread_self(), name, kBufferLen); | int err = pthread_getname_np(pthread_self(), name, kBufferLen); | ||||
if (err == 0 && *name != '\0') | if (err == 0 && *name != '\0') | ||||
+ return strdup(name); | + return strdup(name); | ||||
+#elif defined(OS_BSD) && __FreeBSD__ >= 12 | +#elif defined(OS_BSD) && __FreeBSD__ >= 12 | ||||
+ pthread_get_name_np(pthread_self(), name, kBufferLen); | + pthread_get_name_np(pthread_self(), name, kBufferLen); | ||||
+ if (*name != '\0') | + if (*name != '\0') | ||||
return strdup(name); | return strdup(name); | ||||
#endif // defined(OS_LINUX) || defined(OS_ANDROID) | #endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) | ||||