make/solaris/makefiles/dtrace.make

Print this page
rev 5733 : 8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
Reviewed-by:


  19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 # or visit www.oracle.com if you need additional information or have any
  21 # questions.
  22 #  
  23 #
  24 
  25 # Rules to build jvm_db/dtrace, used by vm.make
  26 
  27 # We build libjvm_dtrace/libjvm_db/dtrace for COMPILER1 and COMPILER2
  28 # but not for CORE configuration.
  29 
  30 ifneq ("${TYPE}", "CORE")
  31 
  32 ifdef USE_GCC
  33 
  34 dtraceCheck:
  35         $(QUIETLY) echo "**NOTICE** Dtrace support disabled for gcc builds"
  36 
  37 else
  38 


  39 JVM_DB = libjvm_db
  40 LIBJVM_DB = libjvm_db.so
  41 
  42 LIBJVM_DB_DEBUGINFO   = libjvm_db.debuginfo
  43 LIBJVM_DB_DIZ         = libjvm_db.diz
  44 
  45 JVM_DTRACE = jvm_dtrace
  46 LIBJVM_DTRACE = libjvm_dtrace.so
  47 
  48 LIBJVM_DTRACE_DEBUGINFO   = libjvm_dtrace.debuginfo
  49 LIBJVM_DTRACE_DIZ         = libjvm_dtrace.diz
  50 
  51 JVMOFFS = JvmOffsets
  52 JVMOFFS.o = $(JVMOFFS).o
  53 GENOFFS = generate$(JVMOFFS)
  54 
  55 DTRACE_SRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/dtrace
  56 DTRACE = dtrace
  57 DTRACE.o = $(DTRACE).o
  58 


 309     echo "*****************************************************************";\
 310       fi; \
 311   fi;\
 312   exit $$STATUS
 313   # Since some DTraced_Files are in LIBJVM.o and they are touched by this
 314   # command, and libgenerateJvmOffsets.so depends on LIBJVM.o, 'make' will
 315   # think it needs to rebuild libgenerateJvmOffsets.so and thus JvmOffsets*
 316   # files, but it doesn't, so we touch the necessary files to prevent later
 317   # recompilation. Note: we only touch the necessary files if they already
 318   # exist in order to close a race where an empty file can be created
 319   # before the real build rule is executed.
 320   # But, we can't touch the *.h files:  This rule depends
 321   # on them, and that would cause an infinite cycle of rebuilding.
 322   # Neither the *.h or *.ccp files need to be touched, since they have
 323   # rules which do not update them when the generator file has not
 324   # changed their contents.
 325         $(QUIETLY) if [ -f lib$(GENOFFS).so ]; then touch lib$(GENOFFS).so; fi
 326         $(QUIETLY) if [ -f $(GENOFFS) ]; then touch $(GENOFFS); fi
 327         $(QUIETLY) if [ -f $(JVMOFFS.o) ]; then touch $(JVMOFFS.o); fi
 328 
















 329 .PHONY: dtraceCheck
 330 
 331 SYSTEM_DTRACE_H = /usr/include/dtrace.h
 332 SYSTEM_DTRACE_PROG = /usr/sbin/dtrace
 333 PATCH_DTRACE_PROG = /opt/SUNWdtrd/sbin/dtrace
 334 systemDtraceFound := $(wildcard ${SYSTEM_DTRACE_PROG})
 335 patchDtraceFound := $(wildcard ${PATCH_DTRACE_PROG})
 336 systemDtraceHdrFound := $(wildcard $(SYSTEM_DTRACE_H))
 337 
 338 ifneq ("$(systemDtraceHdrFound)", "") 
 339 CFLAGS += -DHAVE_DTRACE_H
 340 endif
 341 
 342 ifneq ("$(patchDtraceFound)", "")
 343 DTRACE_PROG=$(PATCH_DTRACE_PROG)
 344 DTRACE_INCL=-I/opt/SUNWdtrd/include
 345 else
 346 ifneq ("$(systemDtraceFound)", "")
 347 DTRACE_PROG=$(SYSTEM_DTRACE_PROG)
 348 else




  19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 # or visit www.oracle.com if you need additional information or have any
  21 # questions.
  22 #  
  23 #
  24 
  25 # Rules to build jvm_db/dtrace, used by vm.make
  26 
  27 # We build libjvm_dtrace/libjvm_db/dtrace for COMPILER1 and COMPILER2
  28 # but not for CORE configuration.
  29 
  30 ifneq ("${TYPE}", "CORE")
  31 
  32 ifdef USE_GCC
  33 
  34 dtraceCheck:
  35         $(QUIETLY) echo "**NOTICE** Dtrace support disabled for gcc builds"
  36 
  37 else
  38 
  39 DtraceOutDir = $(GENERATED)/dtracefiles
  40 
  41 JVM_DB = libjvm_db
  42 LIBJVM_DB = libjvm_db.so
  43 
  44 LIBJVM_DB_DEBUGINFO   = libjvm_db.debuginfo
  45 LIBJVM_DB_DIZ         = libjvm_db.diz
  46 
  47 JVM_DTRACE = jvm_dtrace
  48 LIBJVM_DTRACE = libjvm_dtrace.so
  49 
  50 LIBJVM_DTRACE_DEBUGINFO   = libjvm_dtrace.debuginfo
  51 LIBJVM_DTRACE_DIZ         = libjvm_dtrace.diz
  52 
  53 JVMOFFS = JvmOffsets
  54 JVMOFFS.o = $(JVMOFFS).o
  55 GENOFFS = generate$(JVMOFFS)
  56 
  57 DTRACE_SRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/dtrace
  58 DTRACE = dtrace
  59 DTRACE.o = $(DTRACE).o
  60 


 311     echo "*****************************************************************";\
 312       fi; \
 313   fi;\
 314   exit $$STATUS
 315   # Since some DTraced_Files are in LIBJVM.o and they are touched by this
 316   # command, and libgenerateJvmOffsets.so depends on LIBJVM.o, 'make' will
 317   # think it needs to rebuild libgenerateJvmOffsets.so and thus JvmOffsets*
 318   # files, but it doesn't, so we touch the necessary files to prevent later
 319   # recompilation. Note: we only touch the necessary files if they already
 320   # exist in order to close a race where an empty file can be created
 321   # before the real build rule is executed.
 322   # But, we can't touch the *.h files:  This rule depends
 323   # on them, and that would cause an infinite cycle of rebuilding.
 324   # Neither the *.h or *.ccp files need to be touched, since they have
 325   # rules which do not update them when the generator file has not
 326   # changed their contents.
 327         $(QUIETLY) if [ -f lib$(GENOFFS).so ]; then touch lib$(GENOFFS).so; fi
 328         $(QUIETLY) if [ -f $(GENOFFS) ]; then touch $(GENOFFS); fi
 329         $(QUIETLY) if [ -f $(JVMOFFS.o) ]; then touch $(JVMOFFS.o); fi
 330 
 331 
 332 $(DtraceOutDir):
 333         mkdir $(DtraceOutDir)
 334 
 335 $(DtraceOutDir)/hotspot.h: $(DTRACE_SRCDIR)/hotspot.d | $(DtraceOutDir)
 336         $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hotspot.d
 337 
 338 $(DtraceOutDir)/hotspot_jni.h: $(DTRACE_SRCDIR)/hotspot_jni.d | $(DtraceOutDir)
 339         $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hotspot_jni.d
 340 
 341 $(DtraceOutDir)/hs_private.h: $(DTRACE_SRCDIR)/hs_private.d | $(DtraceOutDir)
 342         $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hs_private.d
 343 
 344 dtrace_gen_headers: $(DtraceOutDir)/hotspot.h $(DtraceOutDir)/hotspot_jni.h $(DtraceOutDir)/hs_private.h
 345 
 346 
 347 .PHONY: dtraceCheck
 348 
 349 SYSTEM_DTRACE_H = /usr/include/dtrace.h
 350 SYSTEM_DTRACE_PROG = /usr/sbin/dtrace
 351 PATCH_DTRACE_PROG = /opt/SUNWdtrd/sbin/dtrace
 352 systemDtraceFound := $(wildcard ${SYSTEM_DTRACE_PROG})
 353 patchDtraceFound := $(wildcard ${PATCH_DTRACE_PROG})
 354 systemDtraceHdrFound := $(wildcard $(SYSTEM_DTRACE_H))
 355 
 356 ifneq ("$(systemDtraceHdrFound)", "") 
 357 CFLAGS += -DHAVE_DTRACE_H
 358 endif
 359 
 360 ifneq ("$(patchDtraceFound)", "")
 361 DTRACE_PROG=$(PATCH_DTRACE_PROG)
 362 DTRACE_INCL=-I/opt/SUNWdtrd/include
 363 else
 364 ifneq ("$(systemDtraceFound)", "")
 365 DTRACE_PROG=$(SYSTEM_DTRACE_PROG)
 366 else