CVS commit: src/common/lib/libc/gmon

2021-08-14 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Aug 14 17:38:44 UTC 2021

Modified Files:
src/common/lib/libc/gmon: mcount.c

Log Message:
don't include "opt_multiprocessor.h" inside an ifdef to work "make depend" 
properly.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/common/lib/libc/gmon/mcount.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libc/gmon/mcount.c
diff -u src/common/lib/libc/gmon/mcount.c:1.14 src/common/lib/libc/gmon/mcount.c:1.15
--- src/common/lib/libc/gmon/mcount.c:1.14	Tue Aug 27 22:48:53 2019
+++ src/common/lib/libc/gmon/mcount.c	Sat Aug 14 17:38:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mcount.c,v 1.14 2019/08/27 22:48:53 kamil Exp $	*/
+/*	$NetBSD: mcount.c,v 1.15 2021/08/14 17:38:44 ryo Exp $	*/
 
 /*
  * Copyright (c) 2003, 2004 Wasabi Systems, Inc.
@@ -64,19 +64,19 @@
  * SUCH DAMAGE.
  */
 
-/* If building a standalone libkern, don't include mcount. */
-#if (!defined(_KERNEL) || defined(GPROF)) && !defined(_STANDALONE)
-
 #ifdef _KERNEL_OPT
 #include "opt_multiprocessor.h"
 #endif
 
+/* If building a standalone libkern, don't include mcount. */
+#if (!defined(_KERNEL) || defined(GPROF)) && !defined(_STANDALONE)
+
 #include 
 #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.14 2019/08/27 22:48:53 kamil Exp $");
+__RCSID("$NetBSD: mcount.c,v 1.15 2021/08/14 17:38:44 ryo Exp $");
 #endif
 #endif
 



CVS commit: src/common/lib/libc/gmon

2016-02-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Feb 28 02:56:40 UTC 2016

Modified Files:
src/common/lib/libc/gmon: mcount.c

Log Message:
fix infinite recursion through thr_getspecific


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/common/lib/libc/gmon/mcount.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libc/gmon/mcount.c
diff -u src/common/lib/libc/gmon/mcount.c:1.12 src/common/lib/libc/gmon/mcount.c:1.13
--- src/common/lib/libc/gmon/mcount.c:1.12	Sun Jan 10 20:57:12 2016
+++ src/common/lib/libc/gmon/mcount.c	Sat Feb 27 21:56:39 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: mcount.c,v 1.12 2016/01/11 01:57:12 christos Exp $	*/
+/*	$NetBSD: mcount.c,v 1.13 2016/02/28 02:56:39 christos Exp $	*/
 
 /*
  * Copyright (c) 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
 #if 0
 static char sccsid[] = "@(#)mcount.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: mcount.c,v 1.12 2016/01/11 01:57:12 christos Exp $");
+__RCSID("$NetBSD: mcount.c,v 1.13 2016/02/28 02:56:39 christos Exp $");
 #endif
 #endif
 
@@ -145,12 +145,17 @@ _MCOUNT_DECL(u_long frompc, u_long selfp
 
 #if defined(_REENTRANT) && !defined(_KERNEL)
 	if (__isthreaded) {
+		/* prevent re-entry via thr_getspecific */
+		if (_gmonparam.state != GMON_PROF_ON)
+			return;
+		_gmonparam.state = GMON_PROF_BUSY;
 		p = thr_getspecific(_gmonkey);
 		if (p == NULL) {
 			/* Prevent recursive calls while allocating */
 			thr_setspecific(_gmonkey, &_gmondummy);
 			p = _m_gmon_alloc();
 		}
+		_gmonparam.state = GMON_PROF_ON;
 	} else
 #endif
 		p = &_gmonparam;



CVS commit: src/common/lib/libc/gmon

2016-01-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 11 01:57:12 UTC 2016

Modified Files:
src/common/lib/libc/gmon: mcount.c

Log Message:
Put back the rump-disabling of mcount for librump. Otherwise the world
breaks because the mcount assembly code is written to call __mcount via
the PLT.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/common/lib/libc/gmon/mcount.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libc/gmon/mcount.c
diff -u src/common/lib/libc/gmon/mcount.c:1.11 src/common/lib/libc/gmon/mcount.c:1.12
--- src/common/lib/libc/gmon/mcount.c:1.11	Sun Jan 10 04:04:32 2016
+++ src/common/lib/libc/gmon/mcount.c	Sun Jan 10 20:57:12 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: mcount.c,v 1.11 2016/01/10 09:04:32 ryo Exp $	*/
+/*	$NetBSD: mcount.c,v 1.12 2016/01/11 01:57:12 christos Exp $	*/
 
 /*
  * Copyright (c) 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
 #if 0
 static char sccsid[] = "@(#)mcount.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: mcount.c,v 1.11 2016/01/10 09:04:32 ryo Exp $");
+__RCSID("$NetBSD: mcount.c,v 1.12 2016/01/11 01:57:12 christos Exp $");
 #endif
 #endif
 
@@ -106,6 +106,16 @@ _MCOUNT_DECL(u_long, u_long)
 __used;
 #endif
 
+/* XXX: make these interfaces */
+#ifdef _RUMPKERNEL
+#undef MCOUNT_ENTER
+#define MCOUNT_ENTER
+#undef MCOUNT_EXIT
+#define MCOUNT_EXIT
+#undef MCOUNT
+#define MCOUNT
+#endif
+
 /*
  * mcount is called on entry to each function compiled with the profiling
  * switch set.  _mcount(), which is declared in a machine-dependent way



CVS commit: src/common/lib/libc/gmon

2012-03-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 17 21:40:22 UTC 2012

Modified Files:
src/common/lib/libc/gmon: mcount.c

Log Message:
shut up lint


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/common/lib/libc/gmon/mcount.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libc/gmon/mcount.c
diff -u src/common/lib/libc/gmon/mcount.c:1.8 src/common/lib/libc/gmon/mcount.c:1.9
--- src/common/lib/libc/gmon/mcount.c:1.8	Mon Jan  5 18:06:57 2009
+++ src/common/lib/libc/gmon/mcount.c	Sat Mar 17 21:40:21 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mcount.c,v 1.8 2009/01/05 18:06:57 pooka Exp $	*/
+/*	$NetBSD: mcount.c,v 1.9 2012/03/17 21:40:21 martin Exp $	*/
 
 /*
  * Copyright (c) 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
 #if 0
 static char sccsid[] = @(#)mcount.c	8.1 (Berkeley) 6/4/93;
 #else
-__RCSID($NetBSD: mcount.c,v 1.8 2009/01/05 18:06:57 pooka Exp $);
+__RCSID($NetBSD: mcount.c,v 1.9 2012/03/17 21:40:21 martin Exp $);
 #endif
 #endif
 
@@ -93,11 +93,13 @@ extern struct gmonparam _gmondummy;
 struct gmonparam *_m_gmon_alloc(void);
 #endif
 
+#ifndef __LINT__
 _MCOUNT_DECL __P((u_long, u_long))
 #ifdef _KERNEL
 __attribute__((__no_instrument_function__))
 #endif
 __used;
+#endif
 
 /* XXX: make these interfaces */
 #ifdef _RUMPKERNEL
@@ -124,6 +126,7 @@ _MCOUNT_DECL __P((u_long, u_long))
  * both frompcindex and frompc.  Any reasonable, modern compiler will
  * perform this optimization.
  */
+#ifndef __LINT__
 _MCOUNT_DECL(frompc, selfpc)	/* _mcount; may be static, inline, etc */
 	u_long frompc, selfpc;
 {
@@ -258,6 +261,7 @@ overflow:
 #endif
 	return;
 }
+#endif
 
 #ifdef MCOUNT
 /*