Fixed profiling of trap, syscall and interrupt handlers and some

ordinary functions, essentially by backing out half of rev.1.115 of
amd64/exception.S.  The handlers must be between certain labels for
the purposes of profiling, and this was broken by scattering them in
separately compiled .S files, especially for ordinary functions that
ended up between the labels.  Merge the files by #including them as
before, except with different pathnames and better comments and
organization.  Changes to the scattered files are minimal -- just
move the labels to the file that does the #includes.

This also partly fixes profiling of IPIs -- all IPI handlers are now
correctly classified as interrupt handlers, but many are still missing
mcount calls.
This commit is contained in:
Bruce Evans 2004-05-24 12:08:56 +00:00
parent 40905e9049
commit 003d5d66b1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=129653
4 changed files with 43 additions and 9 deletions

View File

@ -129,7 +129,6 @@ IDTVEC(spuriousint)
iretq
MCOUNT_LABEL(bintr2)
ISR_VEC(1, apic_isr1)
ISR_VEC(2, apic_isr2)
ISR_VEC(3, apic_isr3)
@ -137,7 +136,6 @@ MCOUNT_LABEL(bintr2)
ISR_VEC(5, apic_isr5)
ISR_VEC(6, apic_isr6)
ISR_VEC(7, apic_isr7)
MCOUNT_LABEL(eintr2)
#ifdef SMP
/*

View File

@ -30,6 +30,9 @@
* $FreeBSD$
*/
#include "opt_atpic.h"
#include "opt_ia32.h"
#include <machine/asmacros.h>
#include <machine/psl.h>
#include <machine/trap.h>
@ -294,8 +297,44 @@ ENTRY(fork_trampoline)
MEXITCOUNT
jmp doreti /* Handle any ASTs */
/*
* To efficiently implement classification of trap and interrupt handlers
* for profiling, there must be only trap handlers between the labels btrap
* and bintr, and only interrupt handlers between the labels bintr and
* eintr. This is implemented (partly) by including files that contain
* some of the handlers. Before including the files, set up a normal asm
* environment so that the included files doen't need to know that they are
* included.
*/
#ifdef IA32
.data
ALIGN_DATA
.align 4
.text
SUPERALIGN_TEXT
#include <amd64/ia32/ia32_exception.S>
#endif
.data
.align 4
.text
SUPERALIGN_TEXT
MCOUNT_LABEL(bintr)
#include <amd64/amd64/apic_vector.S>
#ifdef DEV_ATPIC
.data
.align 4
.text
SUPERALIGN_TEXT
#include <amd64/isa/atpic_vector.S>
#endif
.text
MCOUNT_LABEL(eintr)
/*
* void doreti(struct trapframe)
@ -304,7 +343,6 @@ ENTRY(fork_trampoline)
*/
.text
SUPERALIGN_TEXT
.globl doreti
.type doreti,@function
doreti:
FAKE_MCOUNT($bintr) /* init "from" bintr -> doreti */

View File

@ -72,7 +72,6 @@ IDTVEC(vec_name) ; \
MEXITCOUNT ; \
jmp doreti
MCOUNT_LABEL(bintr)
INTR(0, atpic_intr0)
INTR(1, atpic_intr1)
INTR(2, atpic_intr2)
@ -89,4 +88,3 @@ MCOUNT_LABEL(bintr)
INTR(13, atpic_intr13)
INTR(14, atpic_intr14)
INTR(15, atpic_intr15)
MCOUNT_LABEL(eintr)

View File

@ -41,7 +41,7 @@ amd64/acpica/acpi_wakeup.c optional acpi
amd64/acpica/madt.c optional acpi
amd64/amd64/amd64-gdbstub.c optional ddb
amd64/amd64/amd64_mem.c standard
amd64/amd64/apic_vector.S standard
#amd64/amd64/apic_vector.S standard
amd64/amd64/atomic.c standard
amd64/amd64/autoconf.c standard
amd64/amd64/busdma_machdep.c standard
@ -80,7 +80,7 @@ amd64/amd64/uio_machdep.c standard
amd64/amd64/uma_machdep.c standard
amd64/amd64/vm_machdep.c standard
amd64/isa/atpic.c optional atpic isa
amd64/isa/atpic_vector.S optional atpic isa
#amd64/isa/atpic_vector.S optional atpic isa
amd64/isa/clock.c standard
amd64/isa/elcr.c standard
amd64/isa/isa.c standard
@ -140,7 +140,7 @@ pci/agp_via.c optional agp
#
# IA32 binary support
#
amd64/ia32/ia32_exception.S optional ia32
#amd64/ia32/ia32_exception.S optional ia32
amd64/ia32/ia32_signal.c optional ia32
amd64/ia32/ia32_sigtramp.S optional ia32
amd64/ia32/ia32_syscall.c optional ia32