summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1998-09-07 23:32:00 +0000
committerjdp <jdp@FreeBSD.org>1998-09-07 23:32:00 +0000
commit5b11e2a2f4237604a3b79eae0bd8f58cd296fca5 (patch)
tree3406d2b2dff7ee0b157826eb5429d6e93491b1a8 /sys
parent06aec80098f1b2500b86064347079545f0d01eaf (diff)
downloadFreeBSD-src-5b11e2a2f4237604a3b79eae0bd8f58cd296fca5.zip
FreeBSD-src-5b11e2a2f4237604a3b79eae0bd8f58cd296fca5.tar.gz
Make profiling work for ELF. gprof now autodetects the format of
the executable file, so it will work for both a.out and ELF format files. I have split the object format specific code into separate source files. It's cleaner than it was before, but it's still pretty crufty. Don't cheat on your make world for this update. A lot of things have to be rebuilt for it to work, including the compiler and all of the profiled libraries.
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/include/profile.h6
-rw-r--r--sys/i386/include/profile.h6
2 files changed, 10 insertions, 2 deletions
diff --git a/sys/amd64/include/profile.h b/sys/amd64/include/profile.h
index 02c43ca..e034e61 100644
--- a/sys/amd64/include/profile.h
+++ b/sys/amd64/include/profile.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)profile.h 8.1 (Berkeley) 6/11/93
- * $Id: profile.h,v 1.16 1998/07/10 09:26:41 bde Exp $
+ * $Id: profile.h,v 1.17 1998/07/14 05:09:43 bde Exp $
*/
#ifndef _MACHINE_PROFILE_H_
@@ -135,8 +135,12 @@ void stopguprof __P((struct gmonparam *p));
__BEGIN_DECLS
#ifdef __GNUC__
+#ifdef __ELF__
+void mcount __P((void)) __asm(".mcount");
+#else
void mcount __P((void)) __asm("mcount");
#endif
+#endif
static void _mcount __P((uintfptr_t frompc, uintfptr_t selfpc));
__END_DECLS
diff --git a/sys/i386/include/profile.h b/sys/i386/include/profile.h
index 02c43ca..e034e61 100644
--- a/sys/i386/include/profile.h
+++ b/sys/i386/include/profile.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)profile.h 8.1 (Berkeley) 6/11/93
- * $Id: profile.h,v 1.16 1998/07/10 09:26:41 bde Exp $
+ * $Id: profile.h,v 1.17 1998/07/14 05:09:43 bde Exp $
*/
#ifndef _MACHINE_PROFILE_H_
@@ -135,8 +135,12 @@ void stopguprof __P((struct gmonparam *p));
__BEGIN_DECLS
#ifdef __GNUC__
+#ifdef __ELF__
+void mcount __P((void)) __asm(".mcount");
+#else
void mcount __P((void)) __asm("mcount");
#endif
+#endif
static void _mcount __P((uintfptr_t frompc, uintfptr_t selfpc));
__END_DECLS
OpenPOWER on IntegriCloud