disable GUPROF for archs other than i386 and amd64

Andreas Tobler andreast-list at fgznet.ch
Sun Jan 8 20:11:15 UTC 2012


Hi,

I'm working on profiling support for powerpc64 and I struggled over the 
mprofiler-epilogue option not being known on the ppc gcc.
Disabling this option for ppc uncovered the next thing, MCOUNT_OVERHEAD, 
MEXITCOUNT_OVERHEAD and MEXITCOUNT_OVERHEAD_GETLABEL are also not 
defined. Not only on ppc but everywhere except on i386 and amd64.

So for the time being, would it be ok if I disable GUPROF on archs other 
than i386 and amd64?

The patch below would be a candidate.

Thoughts?

TIA,
Andreas


Index: conf/kern.pre.mk
===================================================================
--- conf/kern.pre.mk	(revision 229741)
+++ conf/kern.pre.mk	(working copy)
@@ -103,13 +103,16 @@

  .if defined(PROFLEVEL) && ${PROFLEVEL} >= 1
  CFLAGS+=	-DGPROF -falign-functions=16
+PROF=	-pg
  .if ${PROFLEVEL} >= 2
  CFLAGS+=	-DGPROF4 -DGUPROF
-PROF=	-pg -mprofiler-epilogue
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
+PROF+=	-mprofiler-epilogue
  .else
-PROF=	-pg
+.error "GUPROF not supported on ${MACHINE_CPUARCH}."
  .endif
  .endif
+.endif
  DEFINED_PROF=	${PROF}

  # Put configuration-specific C flags last (except for ${PROF}) so that 
they


More information about the freebsd-current mailing list