diff options
author | deraadt <> | 2025-07-16 16:22:58 +0000 |
---|---|---|
committer | deraadt <> | 2025-07-16 16:22:58 +0000 |
commit | d0abd50be4d4a89450e29d5873ce0fe0fe0031aa (patch) | |
tree | 8f23b62a0632cfaef7b3c189d685e76faa26b23f /src/lib/libc | |
parent | 96473feb9c21e0af1943103867e890e5ae8f3e7d (diff) | |
download | openbsd-d0abd50be4d4a89450e29d5873ce0fe0fe0031aa.tar.gz openbsd-d0abd50be4d4a89450e29d5873ce0fe0fe0031aa.tar.bz2 openbsd-d0abd50be4d4a89450e29d5873ce0fe0fe0031aa.zip |
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
Diffstat (limited to 'src/lib/libc')
-rw-r--r-- | src/lib/libc/include/thread_private.h | 6 |
1 files changed, 5 insertions, 1 deletions
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 @@ | |||
1 | /* $OpenBSD: thread_private.h,v 1.38 2025/07/12 23:59:44 dlg Exp $ */ | 1 | /* $OpenBSD: thread_private.h,v 1.39 2025/07/16 16:22:58 deraadt Exp $ */ |
2 | 2 | ||
3 | /* PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman <marc@snafu.org> */ | 3 | /* PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman <marc@snafu.org> */ |
4 | 4 | ||
5 | #ifndef _THREAD_PRIVATE_H_ | 5 | #ifndef _THREAD_PRIVATE_H_ |
6 | #define _THREAD_PRIVATE_H_ | 6 | #define _THREAD_PRIVATE_H_ |
7 | 7 | ||
8 | #include <sys/types.h> | ||
9 | #include <sys/gmon.h> | ||
10 | |||
8 | extern int __isthreaded; | 11 | extern int __isthreaded; |
9 | 12 | ||
10 | #define _MALLOC_MUTEXES 32 | 13 | #define _MALLOC_MUTEXES 32 |
@@ -434,6 +437,7 @@ struct pthread { | |||
434 | 437 | ||
435 | /* cancel received in a delayed cancel block? */ | 438 | /* cancel received in a delayed cancel block? */ |
436 | int delayed_cancel; | 439 | int delayed_cancel; |
440 | struct gmonparam *gmonparam; | ||
437 | }; | 441 | }; |
438 | /* flags in pthread->flags */ | 442 | /* flags in pthread->flags */ |
439 | #define THREAD_DONE 0x001 | 443 | #define THREAD_DONE 0x001 |