From 447647908c308915e58e4ca2810fc63bdb0eeab5 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Fri, 27 Oct 2006 14:17:50 +0000 Subject: [PATCH] Don't call mexitcount or provide a stub mexitcount to call when profiling is configured but high resolution profiling is not configured. Only functions in *.[Ss] called the stub, so efficiency was not significantly affected. --- sys/amd64/amd64/prof_machdep.c | 13 ------------- sys/amd64/include/asmacros.h | 4 ++++ sys/i386/include/asmacros.h | 4 ++++ sys/i386/isa/prof_machdep.c | 11 ----------- 4 files changed, 8 insertions(+), 24 deletions(-) diff --git a/sys/amd64/amd64/prof_machdep.c b/sys/amd64/amd64/prof_machdep.c index d78365f18c6b..4c57f34a8f4e 100644 --- a/sys/amd64/amd64/prof_machdep.c +++ b/sys/amd64/amd64/prof_machdep.c @@ -375,17 +375,4 @@ stopguprof(gp) } #endif } - -#else /* !GUPROF */ -#ifdef __GNUCLIKE_ASM -__asm(" \n\ - .text \n\ - .p2align 4,0x90 \n\ - .globl " __XSTRING(HIDENAME(mexitcount)) " \n\ -" __XSTRING(HIDENAME(mexitcount)) ": \n\ - ret \n\ -"); -#else /* !__GNUCLIKE_ASM */ -#error this file needs to be ported to your compiler -#endif /* __GNUCLIKE_ASM */ #endif /* GUPROF */ diff --git a/sys/amd64/include/asmacros.h b/sys/amd64/include/asmacros.h index 9c0f6559cdf4..81fed275ed3e 100644 --- a/sys/amd64/include/asmacros.h +++ b/sys/amd64/include/asmacros.h @@ -108,8 +108,12 @@ #define FAKE_MCOUNT(caller) pushq caller ; call __mcount ; popq %rcx #define MCOUNT call __mcount #define MCOUNT_LABEL(name) GEN_ENTRY(name) ; nop ; ALIGN_TEXT +#ifdef GUPROF #define MEXITCOUNT call HIDENAME(mexitcount) #define ret MEXITCOUNT ; NON_GPROF_RET +#else +#define MEXITCOUNT +#endif #else /* !GPROF */ /* diff --git a/sys/i386/include/asmacros.h b/sys/i386/include/asmacros.h index b9f027e031fe..a95eff0e548a 100644 --- a/sys/i386/include/asmacros.h +++ b/sys/i386/include/asmacros.h @@ -108,8 +108,12 @@ #define FAKE_MCOUNT(caller) pushl caller ; call __mcount ; popl %ecx #define MCOUNT call __mcount #define MCOUNT_LABEL(name) GEN_ENTRY(name) ; nop ; ALIGN_TEXT +#ifdef GUPROF #define MEXITCOUNT call HIDENAME(mexitcount) #define ret MEXITCOUNT ; NON_GPROF_RET +#else +#define MEXITCOUNT +#endif #else /* !GPROF */ /* diff --git a/sys/i386/isa/prof_machdep.c b/sys/i386/isa/prof_machdep.c index b286d7b1065a..0f399a3dde28 100644 --- a/sys/i386/isa/prof_machdep.c +++ b/sys/i386/isa/prof_machdep.c @@ -349,15 +349,4 @@ stopguprof(gp) } #endif } - -#else /* !GUPROF */ -#ifdef __GNUCLIKE_ASM -__asm(" \n\ - .text \n\ - .p2align 4,0x90 \n\ - .globl " __XSTRING(HIDENAME(mexitcount)) " \n\ -" __XSTRING(HIDENAME(mexitcount)) ": \n\ - ret \n\ -"); -#endif /* __GNUCLIKE_ASM */ #endif /* GUPROF */