From owner-freebsd-current Fri Dec 29 08:06:40 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id IAA27829 for current-outgoing; Fri, 29 Dec 1995 08:06:40 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id IAA27821 for ; Fri, 29 Dec 1995 08:06:30 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id DAA21468 for current@freefall.freebsd.org; Sat, 30 Dec 1995 03:03:14 +1100 Date: Sat, 30 Dec 1995 03:03:14 +1100 From: Bruce Evans Message-Id: <199512291603.DAA21468@godzilla.zeta.org.au> To: current@freefall.freebsd.org Subject: Re: cvs commit: src/usr.sbin/kgmon kgmon.8 kgmon.c Sender: owner-current@FreeBSD.ORG Precedence: bulk To configure the kernel for this: config -n -pp YOUR_KERNEL cd /sys/compile/YOUR_KERNEL make clean # not optional make depend make # gcc must be up to date for this Use it something like: high resolution (new) low resolution (old) --------------------- -------------------- kgmon -rB kgmon -rb run_test run_test kgmon -hp kgmon -hp gprof4 -u /kernel >gprof4.out gprof -u /kernel >gprof.out Bruce >bde 95/12/29 07:30:09 > Modified: lib/libc/gmon mcount.c > sys/i386/conf files.i386 > sys/i386/include asmacros.h profile.h > sys/kern subr_prof.c > sys/libkern mcount.c > sys/sys gmon.h > usr.bin Makefile > usr.sbin/config config.8 mkmakefile.c > usr.sbin/kgmon kgmon.8 kgmon.c > Added: sys/i386/isa prof_machdep.c > usr.bin/gprof4 Makefile > Log: > Implemented non-statistical kernel profiling. This is based on > looking at a high resolution clock for each of the following events: > function call, function return, interrupt entry, interrupt exit, > and interesting branches. The differences between the times of > these events are added at appropriate places in a ordinary histogram > (as if very fast statistical profiling sampled the pc at those > places) so that ordinary gprof can be used to analyze the times. > > gmon.h: > Histogram counters need to be 4 bytes for microsecond resolutions. > They will need to be larger for the 586 clock. > The comments were vax-centric and wrong even on vaxes. Does anyone > disagree? > > gprof4.c: > The standard gprof should support counters of all integral sizes > and the size of the counter should be in the gmon header. This > hack will do until then. (Use gprof4 -u to examine the results > of non-statistical profiling.) > > config/*: > Non-statistical profiling is configured with `config -pp'. > `config -p' still gives ordinary profiling. > > kgmon/*: > Non-statistical profiling is enabled with `kgmon -B'. `kgmon -b' > still enables ordinary profiling (and distables non-statistical > profiling) if non-statistical profiling is configured. > > Revision Changes Path > 1.4 +148 -8 src/lib/libc/gmon/mcount.c > 1.122 +2 -1 src/sys/i386/conf/files.i386 > 1.6 +64 -28 src/sys/i386/include/asmacros.h > 1.5 +39 -15 src/sys/i386/include/profile.h > 1.16 +90 -5 src/sys/kern/subr_prof.c > 1.5 +3 -179 src/sys/libkern/mcount.c > 1.8 +57 -9 src/sys/sys/gmon.h > 1.64 +2 -1 src/usr.bin/Makefile > 1.6 +5 -0 src/usr.sbin/config/config.8 > 1.14 +6 -2 src/usr.sbin/config/mkmakefile.c > 1.3 +9 -2 src/usr.sbin/kgmon/kgmon.8 > 1.6 +27 -10 src/usr.sbin/kgmon/kgmon.c