CVSROOT: /cvs Module name: src Changes by: chel...@cvs.openbsd.org 2023/04/24 19:32:36
Modified files: sys/kern : subr_prof.c Log message: prof_state_toggle: keep a count of CPUs with profiling enabled On MULTIPROCESSOR systems, the following sequence of kgmon(8) invocations leaves the statclock() frequency at stathz when there is still a CPU on the system where the gmon state is GMON_PROF_ON: # kgmon -c 0 -b # kgmon -c 1 -b # kgmon -c 0 -h The problem is that we aren't counting CPUs with profiling enabled. Add "gmon_cpu_count" to keep a count. Call startprofclock() for the first CPU to enable profiling and stopprofclock() for the last CPU to disable profiling.