summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2004-05-26 07:43:41 +0000
committerbde <bde@FreeBSD.org>2004-05-26 07:43:41 +0000
commitf3d67a1356f86fc772d88ffcc2c7b92d00bb9bca (patch)
treedacd447a3953e0b1b65df3469f508e94314afc18
parent1f5642e8bb05c1d3715f0cad1ce60a826a2e60eb (diff)
downloadFreeBSD-src-f3d67a1356f86fc772d88ffcc2c7b92d00bb9bca.zip
FreeBSD-src-f3d67a1356f86fc772d88ffcc2c7b92d00bb9bca.tar.gz
MFamd64:
Fixed profiling of trap, syscall and interrupt handlers and some ordinary functions, essentially by backing out half of rev.1.106 of i386/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. vm86bios.s is included as before, but it is now between the labels for interrupt handlers again, which seems to be wrong since half of it is for a non-interrupt handler.
-rw-r--r--sys/conf/files.i3864
-rw-r--r--sys/i386/i386/apic_vector.s2
-rw-r--r--sys/i386/i386/exception.s36
-rw-r--r--sys/i386/isa/atpic_vector.s2
4 files changed, 34 insertions, 10 deletions
diff --git a/sys/conf/files.i386 b/sys/conf/files.i386
index 8a15f4d..4f6edc8 100644
--- a/sys/conf/files.i386
+++ b/sys/conf/files.i386
@@ -198,7 +198,7 @@ i386/bios/smapi.c optional smapi
i386/bios/smapi_bios.S optional smapi
i386/bios/smbios.c optional smbios
i386/bios/vpd.c optional vpd
-i386/i386/apic_vector.s optional apic
+#i386/i386/apic_vector.s optional apic
i386/i386/atomic.c standard \
compile-with "${CC} -c ${CFLAGS} ${DEFINED_PROF:S/^$/-fomit-frame-pointer/} ${.IMPSRC}"
i386/i386/autoconf.c standard
@@ -267,7 +267,7 @@ i386/ibcs2/ibcs2_xenix.c optional ibcs2
i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2
i386/ibcs2/imgact_coff.c optional ibcs2
i386/isa/atpic.c standard
-i386/isa/atpic_vector.s standard
+#i386/isa/atpic_vector.s standard
i386/isa/clock.c standard
i386/isa/elcr.c standard
i386/isa/elink.c optional ep
diff --git a/sys/i386/i386/apic_vector.s b/sys/i386/i386/apic_vector.s
index a4c5452..da5b2eb 100644
--- a/sys/i386/i386/apic_vector.s
+++ b/sys/i386/i386/apic_vector.s
@@ -107,7 +107,6 @@ IDTVEC(spuriousint)
iret
-MCOUNT_LABEL(bintr2)
ISR_VEC(1, apic_isr1)
ISR_VEC(2, apic_isr2)
ISR_VEC(3, apic_isr3)
@@ -115,7 +114,6 @@ MCOUNT_LABEL(bintr2)
ISR_VEC(5, apic_isr5)
ISR_VEC(6, apic_isr6)
ISR_VEC(7, apic_isr7)
-MCOUNT_LABEL(eintr2)
#ifdef SMP
/*
diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s
index 2f88158..02168d9 100644
--- a/sys/i386/i386/exception.s
+++ b/sys/i386/i386/exception.s
@@ -30,6 +30,7 @@
* $FreeBSD$
*/
+#include "opt_apic.h"
#include "opt_npx.h"
#include <machine/asmacros.h>
@@ -217,12 +218,40 @@ ENTRY(fork_trampoline)
/*
- * Include vm86 call routines, which want to call doreti.
+ * 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.
*/
-#include "i386/i386/vm86bios.s"
.data
- ALIGN_DATA
+ .p2align 4
+ .text
+ SUPERALIGN_TEXT
+MCOUNT_LABEL(bintr)
+
+#include <i386/isa/atpic_vector.s>
+
+#ifdef DEV_APIC
+ .data
+ .p2align 4
+ .text
+ SUPERALIGN_TEXT
+
+#include <i386/i386/apic_vector.s>
+#endif
+
+ .data
+ .p2align 4
+ .text
+ SUPERALIGN_TEXT
+#include <i386/i386/vm86bios.s>
+
+ .text
+MCOUNT_LABEL(eintr)
/*
* void doreti(struct trapframe)
@@ -231,7 +260,6 @@ ENTRY(fork_trampoline)
*/
.text
SUPERALIGN_TEXT
- .globl doreti
.type doreti,@function
doreti:
FAKE_MCOUNT($bintr) /* init "from" bintr -> doreti */
diff --git a/sys/i386/isa/atpic_vector.s b/sys/i386/isa/atpic_vector.s
index c1fe463..52aaded 100644
--- a/sys/i386/isa/atpic_vector.s
+++ b/sys/i386/isa/atpic_vector.s
@@ -67,7 +67,6 @@ IDTVEC(vec_name) ; \
MEXITCOUNT ; \
jmp doreti
-MCOUNT_LABEL(bintr)
INTR(0, atpic_intr0)
INTR(1, atpic_intr1)
INTR(2, atpic_intr2)
@@ -84,4 +83,3 @@ MCOUNT_LABEL(bintr)
INTR(13, atpic_intr13)
INTR(14, atpic_intr14)
INTR(15, atpic_intr15)
-MCOUNT_LABEL(eintr)
OpenPOWER on IntegriCloud