New profiling subsystem committed to -current
by from OpenBSD Journal on (#6XH4P)
A new profiling subsystem is now in OpenBSD-current, from the hands of none other than Theo de Raadt (deraadt@) himself.
A longish sequence of commitsintroducedthechangesincrementally,with asummary as follows:
List: openbsd-cvsSubject: CVS: cvs.openbsd.org: srcFrom: Theo de Raadt <deraadt () cvs ! openbsd ! org>Date: 2025-05-24 6:49:17CVSROOT:/cvsModule name:srcChanges by:deraadt@cvs.openbsd.org2025/05/24 00:49:17Modified files:include : unistd.h sys/sys : exec.h exec_elf.h gmon.h proc.h systm.h sys/kern : exec_elf.c init_sysent.c kern_exec.c kern_exit.c kern_fork.c kern_pledge.c subr_prof.c syscalls.master Log message:In the old gprof profiling subsystem, the simplistic profil() syscalltold the kernel about the sample buffer, and then the normal exit-time_mcleanup() would finalize the buffer, open()'ed a file and write outthe details. This file opening has become increasingly impossiblebecause of our privsep / privdrop, chroot, setresuid uid-dropping,pledge, unveil, and other efforts. So people stopped using gprof.Programs which needed profiling needed substantial mitigation removalchanges to put them under test.