put mcount.c in the normal object list, so that "make depend" works.

use a gcc attribute to prevent it from being instrumented.
This commit is contained in:
chs 2005-10-02 15:34:17 +00:00
parent c42416ada1
commit 8b17730eac
5 changed files with 23 additions and 26 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: profile.h,v 1.21 2005/02/25 02:01:59 chs Exp $ */
/* $NetBSD: profile.h,v 1.22 2005/10/02 15:34:17 chs Exp $ */
/*
* Copyright (c) 1992, 1993
@ -49,9 +49,10 @@
#define MCOUNT \
MCOUNT_COMPAT \
extern void mcount(void) __asm__(MCOUNT_ENTRY); \
extern void mcount(void) __asm__(MCOUNT_ENTRY) \
__attribute__((__no_instrument_function__)); \
void \
mcount() \
mcount(void) \
{ \
int selfpc, frompcindex; \
/* \

View File

@ -1,4 +1,4 @@
/* $NetBSD: profile.h,v 1.13 2003/08/07 16:28:15 agc Exp $ */
/* $NetBSD: profile.h,v 1.14 2005/10/02 15:34:17 chs Exp $ */
/*
* Copyright (c) 1992, 1993
@ -41,7 +41,9 @@
#ifndef __mc68010__
#define MCOUNT \
extern void mcount __P((void)) __asm__(MCOUNT_ENTRY); void mcount() { \
extern void mcount __P((void)) __asm__(MCOUNT_ENTRY) \
__attribute__((__no_instrument_function__)); \
void mcount() { \
int selfpc, frompcindex; \
__asm__("movl %%a6@(4),%0" : "=r" (selfpc)); \
__asm__("movl %%a6@(0)@(4),%0" : "=r" (frompcindex)); \

View File

@ -1,4 +1,4 @@
/* $NetBSD: profile.h,v 1.8 2003/08/07 16:29:00 agc Exp $ */
/* $NetBSD: profile.h,v 1.9 2005/10/02 15:34:17 chs Exp $ */
/*
* Copyright (c) 1992, 1993
@ -41,7 +41,8 @@ void mcount(void);
#define _MCOUNT_DECL __inline void _mcount
#define MCOUNT \
extern void mcount(void) __asm__("mcount"); \
extern void mcount(void) __asm__("mcount") \
__attribute__((__no_instrument_function__)); \
void \
mcount(void) \
{ \

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.74 2005/08/25 08:55:42 uebayasi Exp $
# $NetBSD: Makefile,v 1.75 2005/10/02 15:34:17 chs Exp $
LIB= kern
NOPIC= # defined
@ -41,7 +41,7 @@ SRCS+= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
# Other stuff
SRCS+= __cmsg_alignbytes.c inet_addr.c intoa.c md4c.c md5c.c sha1.c pmatch.c
SRCS+= _que.c arc4random.c
SRCS+= _que.c arc4random.c mcount.c
SRCS+= strstr.c strlcpy.c strlcat.c
@ -50,18 +50,6 @@ SRCS+= xlat_mbr_fstype.c
# Files to clean up
CLEANFILES+= lib${LIB}.o lib${LIB}.po
#
# Special rules for certain objects
#
# mcount cannot be compiled with profiling
.if ${MKPROFILE} != "no"
POBJS+= mcount.po
mcount.po: mcount.o
cp mcount.o mcount.po
.endif
# XXX these stub builds should be cleaned up even further.
# if no machine specific memcpy(3), build one out of bcopy(3) based stub.

View File

@ -1,4 +1,4 @@
/* $NetBSD: mcount.c,v 1.13 2005/02/26 22:58:56 perry Exp $ */
/* $NetBSD: mcount.c,v 1.14 2005/10/02 15:34:17 chs Exp $ */
/*-
* Copyright (c) 1983, 1992, 1993
@ -30,21 +30,26 @@
*/
/* If building a standalone libkern, don't include mcount. */
#ifndef _STANDALONE
#if defined(GPROF) && !defined(_STANDALONE)
#ifdef _KERNEL_OPT
#include "opt_multiprocessor.h"
#endif
#include <sys/cdefs.h>
#if !defined(lint) && !defined(_KERNEL) && defined(LIBC_SCCS)
#if 0
static char sccsid[] = "@(#)mcount.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: mcount.c,v 1.13 2005/02/26 22:58:56 perry Exp $");
__RCSID("$NetBSD: mcount.c,v 1.14 2005/10/02 15:34:17 chs Exp $");
#endif
#endif
#include <sys/param.h>
#include <sys/gmon.h>
_MCOUNT_DECL __P((u_long, u_long)) __attribute__((__unused__)); /* see below. */
_MCOUNT_DECL __P((u_long, u_long))
__attribute__((__unused__,__no_instrument_function__)); /* see below. */
/*
* mcount is called on entry to each function compiled with the profiling
@ -192,4 +197,4 @@ overflow:
MCOUNT
#endif
#endif /* !_STANDALONE */
#endif /* GPROF && !_STANDALONE */