Quick fix for high resolution kernel profiling on i386's. Use
-finstrument-functions instead of -mprofiler-epilogue. The former works essentially the same as the latter but has a higher overhead (about 22 more bytes per function for passing unused args to the profiling functions). Removed all traces of the IDENT Makefile variable, which had been reduced to just a place for holding profiling's contribution to CFLAGS (the IDENT that gives the kernel identity was renamed to KERN_IDENT).
This commit is contained in:
parent
5c5e3622e6
commit
3c9d896571
@ -94,6 +94,8 @@ __mcount: \n\
|
|||||||
.p2align 4,0x90 \n\
|
.p2align 4,0x90 \n\
|
||||||
.globl " __XSTRING(HIDENAME(mcount)) " \n\
|
.globl " __XSTRING(HIDENAME(mcount)) " \n\
|
||||||
" __XSTRING(HIDENAME(mcount)) ": \n\
|
" __XSTRING(HIDENAME(mcount)) ": \n\
|
||||||
|
.globl __cyg_profile_func_enter \n\
|
||||||
|
__cyg_profile_func_enter: \n\
|
||||||
cmpl $GMON_PROF_OFF," __XSTRING(CNAME(_gmonparam)) "+GM_STATE \n\
|
cmpl $GMON_PROF_OFF," __XSTRING(CNAME(_gmonparam)) "+GM_STATE \n\
|
||||||
je .mcount_exit \n\
|
je .mcount_exit \n\
|
||||||
# \n\
|
# \n\
|
||||||
@ -147,6 +149,8 @@ GMON_PROF_HIRES = 4 \n\
|
|||||||
.p2align 4,0x90 \n\
|
.p2align 4,0x90 \n\
|
||||||
.globl " __XSTRING(HIDENAME(mexitcount)) " \n\
|
.globl " __XSTRING(HIDENAME(mexitcount)) " \n\
|
||||||
" __XSTRING(HIDENAME(mexitcount)) ": \n\
|
" __XSTRING(HIDENAME(mexitcount)) ": \n\
|
||||||
|
.globl __cyg_profile_func_exit \n\
|
||||||
|
__cyg_profile_func_exit: \n\
|
||||||
cmpl $GMON_PROF_HIRES," __XSTRING(CNAME(_gmonparam)) "+GM_STATE \n\
|
cmpl $GMON_PROF_HIRES," __XSTRING(CNAME(_gmonparam)) "+GM_STATE \n\
|
||||||
jne .mexitcount_exit \n\
|
jne .mexitcount_exit \n\
|
||||||
pushl %edx \n\
|
pushl %edx \n\
|
||||||
|
@ -224,7 +224,7 @@ hints.o: hints.c
|
|||||||
${NORMAL_C}
|
${NORMAL_C}
|
||||||
|
|
||||||
vers.c: $S/conf/newvers.sh $S/sys/param.h ${SYSTEM_DEP}
|
vers.c: $S/conf/newvers.sh $S/sys/param.h ${SYSTEM_DEP}
|
||||||
sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT}
|
sh $S/conf/newvers.sh ${KERN_IDENT}
|
||||||
|
|
||||||
# XXX strictly, everything depends on Makefile because changes to ${PROF}
|
# XXX strictly, everything depends on Makefile because changes to ${PROF}
|
||||||
# only appear there, but we don't handle that.
|
# only appear there, but we don't handle that.
|
||||||
|
@ -38,7 +38,7 @@ INCLUDES+= -I$S/../include
|
|||||||
INCLUDES+= -I/usr/include
|
INCLUDES+= -I/usr/include
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
COPTS= ${INCLUDES} ${IDENT} -D_KERNEL -include opt_global.h
|
COPTS= ${INCLUDES} -D_KERNEL -include opt_global.h
|
||||||
CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} -fno-common
|
CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} -fno-common
|
||||||
|
|
||||||
# XXX LOCORE means "don't declare C stuff" not "for locore.s".
|
# XXX LOCORE means "don't declare C stuff" not "for locore.s".
|
||||||
@ -50,18 +50,16 @@ ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS}
|
|||||||
CFLAGS+= ${FMT}
|
CFLAGS+= ${FMT}
|
||||||
|
|
||||||
.if defined(PROFLEVEL) && ${PROFLEVEL} >= 1
|
.if defined(PROFLEVEL) && ${PROFLEVEL} >= 1
|
||||||
IDENT= -DGPROF
|
CFLAGS+= -DGPROF -falign-functions=16
|
||||||
|
.if ${PROFLEVEL} >= 2
|
||||||
|
CFLAGS+= -DGPROF4 -DGUPROF
|
||||||
|
# XXX -Wno-inline is to break some warnings.
|
||||||
|
PROF= -finstrument-functions -Wno-inline
|
||||||
|
.else
|
||||||
PROF= -pg
|
PROF= -pg
|
||||||
.endif
|
.endif
|
||||||
|
.endif
|
||||||
DEFINED_PROF= ${PROF}
|
DEFINED_PROF= ${PROF}
|
||||||
.if defined(PROF)
|
|
||||||
CFLAGS+= -falign-functions=16
|
|
||||||
.if ${PROFLEVEL} >= 2
|
|
||||||
IDENT+= -DGPROF4 -DGUPROF
|
|
||||||
PROF+= -mprofiler-epilogue
|
|
||||||
.endif
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.if defined(NO_WERROR)
|
.if defined(NO_WERROR)
|
||||||
WERROR=
|
WERROR=
|
||||||
|
@ -94,6 +94,8 @@ __mcount: \n\
|
|||||||
.p2align 4,0x90 \n\
|
.p2align 4,0x90 \n\
|
||||||
.globl " __XSTRING(HIDENAME(mcount)) " \n\
|
.globl " __XSTRING(HIDENAME(mcount)) " \n\
|
||||||
" __XSTRING(HIDENAME(mcount)) ": \n\
|
" __XSTRING(HIDENAME(mcount)) ": \n\
|
||||||
|
.globl __cyg_profile_func_enter \n\
|
||||||
|
__cyg_profile_func_enter: \n\
|
||||||
cmpl $GMON_PROF_OFF," __XSTRING(CNAME(_gmonparam)) "+GM_STATE \n\
|
cmpl $GMON_PROF_OFF," __XSTRING(CNAME(_gmonparam)) "+GM_STATE \n\
|
||||||
je .mcount_exit \n\
|
je .mcount_exit \n\
|
||||||
# \n\
|
# \n\
|
||||||
@ -147,6 +149,8 @@ GMON_PROF_HIRES = 4 \n\
|
|||||||
.p2align 4,0x90 \n\
|
.p2align 4,0x90 \n\
|
||||||
.globl " __XSTRING(HIDENAME(mexitcount)) " \n\
|
.globl " __XSTRING(HIDENAME(mexitcount)) " \n\
|
||||||
" __XSTRING(HIDENAME(mexitcount)) ": \n\
|
" __XSTRING(HIDENAME(mexitcount)) ": \n\
|
||||||
|
.globl __cyg_profile_func_exit \n\
|
||||||
|
__cyg_profile_func_exit: \n\
|
||||||
cmpl $GMON_PROF_HIRES," __XSTRING(CNAME(_gmonparam)) "+GM_STATE \n\
|
cmpl $GMON_PROF_HIRES," __XSTRING(CNAME(_gmonparam)) "+GM_STATE \n\
|
||||||
jne .mexitcount_exit \n\
|
jne .mexitcount_exit \n\
|
||||||
pushl %edx \n\
|
pushl %edx \n\
|
||||||
|
Loading…
x
Reference in New Issue
Block a user