From 5506a044dc35162b58584a83a4099b4268ceba2a Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Wed, 16 Jul 2025 16:22:58 +0000 Subject: This thread-aware profiling support diff comes from Yuichiro NAITO. At runtime, profiling data is stored per-thread. Upon termination, the per-thread profiling data pools are merged into a into a single record, which is then written out (using the new kernel-assisted system). I think the original gmon merging parts may have come from or been inspired by someone at NetBSD. This has been delayed because there were concerns about adding a TLS object which would require other library cranks, so this rides all the major cranks today. ok kettenis tb claudio sthen etc etc etc --- src/lib/libc/include/thread_private.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/libc/include/thread_private.h b/src/lib/libc/include/thread_private.h index 61cc83db60..7e7c716e2a 100644 --- a/src/lib/libc/include/thread_private.h +++ b/src/lib/libc/include/thread_private.h @@ -1,10 +1,13 @@ -/* $OpenBSD: thread_private.h,v 1.38 2025/07/12 23:59:44 dlg Exp $ */ +/* $OpenBSD: thread_private.h,v 1.39 2025/07/16 16:22:58 deraadt Exp $ */ /* PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman */ #ifndef _THREAD_PRIVATE_H_ #define _THREAD_PRIVATE_H_ +#include +#include + extern int __isthreaded; #define _MALLOC_MUTEXES 32 @@ -434,6 +437,7 @@ struct pthread { /* cancel received in a delayed cancel block? */ int delayed_cancel; + struct gmonparam *gmonparam; }; /* flags in pthread->flags */ #define THREAD_DONE 0x001 -- cgit v1.2.3-55-g6feb