Subject: lib/4976: System calls are not profiled
To: None <gnats-bugs@gnats.netbsd.org>
From: None <Anders.Hjalmarsson@economics.gu.se>
List: netbsd-bugs
Date: 02/12/1998 03:21:39
>Number:         4976
>Category:       lib
>Synopsis:       System calls are not profiled
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 11 18:20:01 1998
>Last-Modified:
>Originator:     Anders Hjalmarsson
>Organization:
>Release:        NetBSD-current 19980211
>Environment:
System: NetBSD econahja.econ.gu.se 1.3B NetBSD 1.3B (ECONAHJA) #85: Thu Jan 29 12:38:40 CET 1998 econahja@econahja.econ.gu.se:/usr/src/sys/arch/i386/compile/ECONAHJA i386


>Description:
	The system calls in libc do not call mcount because they are
	compiled using -DPROF but machine/asm.h uses #ifdef GPROF (this
	seems to be true for all architectures, I grepped
	 /usr/src/sys/arch/*/include/asm.h)
>How-To-Repeat:
	Compile a program with -pg and look at the gprof output, the system
	calls have no counts, only time.
>Fix:
Diff from: $NetBSD: Makefile.inc,v 1.79 1998/02/02 05:20:24 perry Exp $

--- Makefile.inc.old	Wed Feb 11 21:59:52 1998
+++ Makefile.inc	Thu Feb 12 02:25:22 1998
@@ -75,7 +75,7 @@
     ${DESTDIR}/usr/include/sys/syscall.h
 	@echo creating ${.TARGET}
 	@printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' | \
-	    ${CPP} -DPROF ${CPPFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o
+	    ${CPP} -DGPROF ${CPPFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o
 	@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
 	@rm -f ${.TARGET}.o
 
@@ -98,7 +98,7 @@
     ${DESTDIR}/usr/include/sys/syscall.h
 	@echo creating ${.TARGET}
 	@printf '#include "SYS.h"\nRSYSCALL_NOERROR(${.PREFIX})\n' | \
-	    ${CPP} -DPROF ${CPPFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o
+	    ${CPP} -DGPROF ${CPPFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o
 	@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
 	@rm -f ${.TARGET}.o
 
@@ -122,7 +122,7 @@
 	@echo creating ${.TARGET}
 	@printf '#include "SYS.h"\n \
 	    PSEUDO_NOERROR(${.PREFIX},${.PREFIX:S/_//})\n' | \
-	    ${CPP} -DPROF ${CPPFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o
+	    ${CPP} -DGPROF ${CPPFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o
 	@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
 	@rm -f ${.TARGET}.o
 
>Audit-Trail:
>Unformatted: