From c08d58eade3dd3f2524d051f265744fa0c44ca72 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Fri, 13 Dec 1996 12:46:28 +0000 Subject: [PATCH] Moved nonstandard compiler profiling options out of config. Just print the profiling level in config and decide what to do in makefiles. Makefile.i386: Align functions to 16-byte boundaries if profiling is enabled. This will allow a fourfold reduction in the size of the profiling buffers. --- sys/conf/Makefile.i386 | 9 ++++++++- sys/conf/Makefile.powerpc | 9 ++++++++- sys/i386/conf/Makefile.i386 | 9 ++++++++- usr.sbin/config/mkmakefile.c | 10 ++++------ 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/sys/conf/Makefile.i386 b/sys/conf/Makefile.i386 index 8bccdc0ce4e..0ea2c52a722 100644 --- a/sys/conf/Makefile.i386 +++ b/sys/conf/Makefile.i386 @@ -1,7 +1,7 @@ # Makefile.i386 -- with config changes. # Copyright 1990 W. Jolitz # from: @(#)Makefile.i386 7.1 5/10/91 -# $Id: Makefile.i386,v 1.89 1996/10/08 22:08:44 bde Exp $ +# $Id: Makefile.i386,v 1.90 1996/11/06 14:56:11 bde Exp $ # # Makefile for FreeBSD # @@ -37,6 +37,13 @@ INCLUDES+= -I/usr/include COPTS= ${INCLUDES} ${IDENT} -DKERNEL CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} LOAD_ADDRESS?= F0100000 +.if defined(PROF) +PROF+= -malign-functions=4 +.if ${PROFLEVEL} >= 2 +IDENT+= -DGPROF4 -DGUPROF +PROF+= -mprofiler-epilogue +.endif +.endif NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< diff --git a/sys/conf/Makefile.powerpc b/sys/conf/Makefile.powerpc index 8bccdc0ce4e..0ea2c52a722 100644 --- a/sys/conf/Makefile.powerpc +++ b/sys/conf/Makefile.powerpc @@ -1,7 +1,7 @@ # Makefile.i386 -- with config changes. # Copyright 1990 W. Jolitz # from: @(#)Makefile.i386 7.1 5/10/91 -# $Id: Makefile.i386,v 1.89 1996/10/08 22:08:44 bde Exp $ +# $Id: Makefile.i386,v 1.90 1996/11/06 14:56:11 bde Exp $ # # Makefile for FreeBSD # @@ -37,6 +37,13 @@ INCLUDES+= -I/usr/include COPTS= ${INCLUDES} ${IDENT} -DKERNEL CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} LOAD_ADDRESS?= F0100000 +.if defined(PROF) +PROF+= -malign-functions=4 +.if ${PROFLEVEL} >= 2 +IDENT+= -DGPROF4 -DGUPROF +PROF+= -mprofiler-epilogue +.endif +.endif NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< diff --git a/sys/i386/conf/Makefile.i386 b/sys/i386/conf/Makefile.i386 index 8bccdc0ce4e..0ea2c52a722 100644 --- a/sys/i386/conf/Makefile.i386 +++ b/sys/i386/conf/Makefile.i386 @@ -1,7 +1,7 @@ # Makefile.i386 -- with config changes. # Copyright 1990 W. Jolitz # from: @(#)Makefile.i386 7.1 5/10/91 -# $Id: Makefile.i386,v 1.89 1996/10/08 22:08:44 bde Exp $ +# $Id: Makefile.i386,v 1.90 1996/11/06 14:56:11 bde Exp $ # # Makefile for FreeBSD # @@ -37,6 +37,13 @@ INCLUDES+= -I/usr/include COPTS= ${INCLUDES} ${IDENT} -DKERNEL CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} LOAD_ADDRESS?= F0100000 +.if defined(PROF) +PROF+= -malign-functions=4 +.if ${PROFLEVEL} >= 2 +IDENT+= -DGPROF4 -DGUPROF +PROF+= -mprofiler-epilogue +.endif +.endif NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c index 0f057f47274..7becfc8b8f0 100644 --- a/usr.sbin/config/mkmakefile.c +++ b/usr.sbin/config/mkmakefile.c @@ -157,10 +157,8 @@ makefile() } fprintf(ofp, "KERN_IDENT=%s\n", raise(ident)); fprintf(ofp, "IDENT="); - if (profiling >= 1) + if (profiling) fprintf(ofp, " -DGPROF"); - if (profiling >= 2) - fprintf(ofp, " -DGPROF4 -DGUPROF"); if (cputype == 0) { printf("cpu type must be specified\n"); @@ -204,10 +202,10 @@ makefile() fprintf(ofp, "%s=%s\n", op->op_name, op->op_value); if (debugging) fprintf(ofp, "DEBUG=-g\n"); - if (profiling >= 1) + if (profiling) { fprintf(ofp, "PROF=-pg\n"); - if (profiling >= 2) - fprintf(ofp, "PROF+=-mprofiler-epilogue\n"); + fprintf(ofp, "PROFLEVEL=%d\n", profiling); + } while (fgets(line, BUFSIZ, ifp) != 0) { if (*line != '%') { fprintf(ofp, "%s", line);