aboutsummaryrefslogtreecommitdiff
path: root/sys/i386/include/profile.h
Commit message (Collapse)AuthorAgeFilesLines
* Ifdefed use of a GNU feature.Bruce Evans1998-02-031-1/+3
| | | | Notes: svn path=/head/; revision=33047
* Add support for low resolution SMP kernel profiling.Tor Egge1997-12-151-4/+7
| | | | | | | | | | | | | | | - A nonprofiling version of s_lock (called s_lock_np) is used by mcount. - When profiling is active, more registers are clobbered in seemingly simple assembly routines. This means that some callers needed to save/restore extra registers. - The stack pointer must have space for a 'fake' return address in idle, to avoid stack underflow. Notes: svn path=/head/; revision=31723
* Another round of lock pushdown.Steve Passe1997-08-301-1/+5
| | | | | | | | | | | | Add a simplelock to deal with disable_intr()/enable_intr() as used in UP kernel. UP kernel expects that this is enough to guarantee exclusive access to regions of code bracketed by these 2 functions. Add a simplelock to bracket clock accesses in clock.c: clock_lock. Help from: Bruce Evans <bde@zeta.org.au> Notes: svn path=/head/; revision=28921
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notPeter Wemm1997-02-221-1/+1
| | | | | | | ready for it yet. Notes: svn path=/head/; revision=22975
* Moved definition of FUNCTION_ALIGNMENT to a machine-dependent place.Bruce Evans1997-02-131-1/+9
| | | | | | | | | | | | | | Changed it from 4 to 16 for i386's. It can be anything for i386's, but compiler options limit it to a power of 2, and assembler and linker deficiencies limit it to a small power of 2 (<= 16). We use 16 in the kernel to get smaller tables (see Makefile.i386 and <machine/asmacros.h>). We still use the default of 4 in user mode. Use HISTCOUNTER instead of (*kcount) in the definition of KCOUNT() for consistency with other macros. Notes: svn path=/head/; revision=22639
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Improved non-statistical (GUPROF) profiling:Bruce Evans1996-10-171-5/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - use a more accurate and more efficient method of compensating for overheads. The old method counted too much time against leaf functions. - normally use the Pentium timestamp counter if available. On Pentiums, the times are now accurate to within a couple of cpu clock cycles per function call in the (unlikely) event that there are no cache misses in or caused by the profiling code. - optionally use an arbitrary Pentium event counter if available. - optionally regress to using the i8254 counter. - scaled the i8254 counter by a factor of 128. Now the i8254 counters overflow slightly faster than the TSC counters for a 150MHz Pentium :-) (after about 16 seconds). This is to avoid fractional overheads. files.i386: permon.c temporarily has to be classified as a profiling-routine because a couple of functions in it may be called from profiling code. options.i386: - I586_CTR_GUPROF is currently unused (oops). - I586_PMC_GUPROF should be something like 0x70000 to enable (but not use unless prof_machdep.c is changed) support for Pentium event counters. 7 is a control mode and the counter number 0 is somewhere in the 0000 bits (see perfmon.h for the encoding). profile.h: - added declarations. - cleaned up separation of user mode declarations. prof_machdep.c: Mostly clock-select changes. The default clock can be changed by editing kmem. There should be a sysctl for this. subr_prof.c: - added copyright. - calibrate overheads for the new method. - documented new method. - fixed races and and machine dependencies in start/stop code. mcount.c: Use the new overhead compensation method. gmon.h: - changed GPROF4 counter type from unsigned to int. Oops, this should be machine-dependent and/or int32_t. - reorganized overhead counters. Submitted by: Pentium event counter changes mostly by wollman Notes: svn path=/head/; revision=19000
* Cleaned up interrupt masking by declaring the state variable in aBruce Evans1996-08-281-10/+15
| | | | | | | | | | machine-dependent macro and passing it to all machine-dependent macros. Eliminated the state variable for the GUPROF case. Notes: svn path=/head/; revision=17879
* Fixed user-mode mcount which I broke in the previous revision.Bruce Evans1996-01-011-13/+33
| | | | | | | | | | | Do it the old way for now. Moved recent additions around a lot to minimise ifdefs. Added prototypes. Notes: svn path=/head/; revision=13157
* Implemented non-statistical kernel profiling. This is based onBruce Evans1995-12-291-15/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=13107
* Added MCOUNT_ENTER and MCOUNT_EXIT macros to profile.hPaul Richards1994-09-151-1/+4
| | | | | | | | | | | | | | | | Removed inb function since it's more correctly in pio.h Copied write_eflags and read_eflags over from npx.c (Some changes to the macros suggested by Bruce were not made at this time since his suggestions probably apply to all the macros and these inlined/macro definitions need a lot of cleaning up at some point in the future.) Reviewed by: Bruce Notes: svn path=/head/; revision=2801
* Made idempotent.Paul Richards1994-08-211-1/+6
| | | | | | | | Reviewed by: Submitted by: Notes: svn path=/head/; revision=2166
* Added $Id$David Greenman1994-08-021-0/+1
| | | | Notes: svn path=/head/; revision=1817
* BSD 4.4 Lite Kernel SourcesRodney W. Grimes1994-05-251-0/+56
Notes: svn path=/head/; revision=1543