From 586cc683d875b37dce82c825feb9ccc7d884b35e Mon Sep 17 00:00:00 2001 From: bde Date: Fri, 29 Dec 1995 15:30:05 +0000 Subject: 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. --- usr.sbin/kgmon/kgmon.8 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'usr.sbin/kgmon/kgmon.8') diff --git a/usr.sbin/kgmon/kgmon.8 b/usr.sbin/kgmon/kgmon.8 index 114fea8..4a91582 100644 --- a/usr.sbin/kgmon/kgmon.8 +++ b/usr.sbin/kgmon/kgmon.8 @@ -39,7 +39,7 @@ .Nd generate a dump of the operating system's profile buffers .Sh SYNOPSIS .Nm kgmon -.Op Fl bhpr +.Op Fl Bbhpr .Op Fl M core .Op Fl N system .Sh DESCRIPTION @@ -62,8 +62,10 @@ file suitable for later analysis by .Pp The options are as follows: .Bl -tag -width Ds +.It Fl B +Resume the collection of high resolution profile data. .It Fl b -Resume the collection of profile data. +Resume the collection of low resolution profile data. .It Fl h Stop the collection of profile data. .It Fl p @@ -86,6 +88,8 @@ default ``/kernel''. .El .Pp If neither +.Fl B +nor .Fl b nor .Fl h @@ -96,6 +100,9 @@ flag is specified and profile data is being collected, profiling will be momentarily suspended, the operating system profile buffers will be dumped, and profiling will be immediately resumed. +.Pp +The profile buffers should be reset when the resolution +of the profile data is changed. .Sh FILES .Bl -tag -width /dev/kmemx -compact .It Pa /kernel -- cgit v1.1