1 #
   2 # Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.
   8 #
   9 # This code is distributed in the hope that it will be useful, but WITHOUT
  10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12 # version 2 for more details (a copy is included in the LICENSE file that
  13 # accompanied this code).
  14 #
  15 # You should have received a copy of the GNU General Public License version
  16 # 2 along with this work; if not, write to the Free Software Foundation,
  17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 #
  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 $(LOG_INFO) "**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_COMMON_SRCDIR = $(GAMMADIR)/src/os/posix/dtrace
  59 DTRACE = dtrace
  60 DTRACE.o = $(DTRACE).o
  61 DTRACE_JHELPER = dtrace_jhelper
  62 DTRACE_JHELPER.o = $(DTRACE_JHELPER).o
  63 
  64 # to remove '-g' option which causes link problems
  65 # also '-z nodefs' is used as workaround
  66 GENOFFS_CFLAGS = $(shell echo $(CFLAGS) | sed -e 's/ -g / /g' -e 's/ -g0 / /g';)
  67 
  68 ifdef LP64
  69 DTRACE_OPTS = -64 -D_LP64
  70 endif
  71 
  72 # making libjvm_db
  73 
  74 # Use mapfile with libjvm_db.so
  75 LIBJVM_DB_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_db
  76 LFLAGS_JVM_DB += $(MAPFLAG:FILENAME=$(LIBJVM_DB_MAPFILE))
  77 
  78 # Use mapfile with libjvm_dtrace.so
  79 LIBJVM_DTRACE_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_dtrace
  80 LFLAGS_JVM_DTRACE += $(MAPFLAG:FILENAME=$(LIBJVM_DTRACE_MAPFILE))
  81 
  82 ifdef USE_GCC
  83 LFLAGS_JVM_DB += -D_REENTRANT $(PICFLAG)
  84 LFLAGS_JVM_DTRACE += -D_REENTRANT $(PICFLAG)
  85 else
  86 LFLAGS_JVM_DB += -mt $(PICFLAG) -xnolib
  87 LFLAGS_JVM_DTRACE += -mt $(PICFLAG) -xnolib -ldl
  88 endif
  89 
  90 ISA = $(subst i386,i486,$(shell isainfo -n))
  91 
  92 # Making 64/libjvm_db.so: 64-bit version of libjvm_db.so which handles 32-bit libjvm.so
  93 ifneq ("${ISA}","${BUILDARCH}")
  94 
  95 XLIBJVM_DIR = 64
  96 XLIBJVM_DB = $(XLIBJVM_DIR)/$(LIBJVM_DB)
  97 XLIBJVM_DTRACE = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE)
  98 
  99 XLIBJVM_DB_DEBUGINFO       = $(XLIBJVM_DIR)/$(LIBJVM_DB_DEBUGINFO)
 100 XLIBJVM_DB_DIZ             = $(XLIBJVM_DIR)/$(LIBJVM_DB_DIZ)
 101 XLIBJVM_DTRACE_DEBUGINFO   = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DEBUGINFO)
 102 XLIBJVM_DTRACE_DIZ         = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DIZ)
 103 
 104 $(XLIBJVM_DB): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE)
 105         @echo $(LOG_INFO) Making $@
 106         $(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \
 107         $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. -I$(GENERATED) \
 108                 $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
 109 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 110 # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
 111 # Clear the SHF_ALLOC flag (if set) from empty section headers.
 112 # An empty section header has sh_addr == 0 and sh_size == 0.
 113 # This problem has only been seen on Solaris X64, but we call this tool
 114 # on all Solaris builds just in case.
 115         $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
 116         $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DB_DEBUGINFO)
 117 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
 118 # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
 119 #         $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB) ;
 120 # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
 121 # in the link name:
 122         ( cd $(XLIBJVM_DIR) && $(ADD_GNU_DEBUGLINK) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB) )
 123   ifeq ($(STRIP_POLICY),all_strip)
 124         $(QUIETLY) $(STRIP) $@
 125   else
 126     ifeq ($(STRIP_POLICY),min_strip)
 127         $(QUIETLY) $(STRIP) -x $@
 128     # implied else here is no stripping at all
 129     endif
 130   endif
 131   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 132 # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
 133 # in the archived name:
 134         ( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) )
 135         $(RM) $(XLIBJVM_DB_DEBUGINFO)
 136   endif
 137 endif
 138 
 139 $(XLIBJVM_DTRACE): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
 140         @echo $(LOG_INFO) Making $@
 141         $(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \
 142         $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \
 143                 $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
 144 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 145 # Clear the SHF_ALLOC flag (if set) from empty section headers.
 146         $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
 147         $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DTRACE_DEBUGINFO)
 148 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
 149 #         $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE) ;
 150 # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
 151 # in the link name:
 152         ( cd $(XLIBJVM_DIR) && $(ADD_GNU_DEBUGLINK) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE) )
 153   ifeq ($(STRIP_POLICY),all_strip)
 154         $(QUIETLY) $(STRIP) $@
 155   else
 156     ifeq ($(STRIP_POLICY),min_strip)
 157         $(QUIETLY) $(STRIP) -x $@
 158     # implied else here is no stripping at all
 159     endif
 160   endif
 161   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 162 # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
 163 # in the archived name:
 164         ( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO))
 165         $(RM) $(XLIBJVM_DTRACE_DEBUGINFO)
 166   endif
 167 endif
 168 
 169 endif # ifneq ("${ISA}","${BUILDARCH}")
 170 
 171 ifdef USE_GCC
 172 LFLAGS_GENOFFS += -D_REENTRANT
 173 else
 174 LFLAGS_GENOFFS += -mt -xnolib -norunpath
 175 endif
 176 
 177 lib$(GENOFFS).so: $(DTRACE_SRCDIR)/$(GENOFFS).cpp $(DTRACE_SRCDIR)/$(GENOFFS).h \
 178                   $(LIBJVM.o)
 179         $(QUIETLY) $(CXX) $(CXXFLAGS) $(GENOFFS_CFLAGS) $(SHARED_FLAG) $(PICFLAG) \
 180                  $(LFLAGS_GENOFFS) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS).cpp -lc
 181 
 182 $(GENOFFS): $(DTRACE_SRCDIR)/$(GENOFFS)Main.c lib$(GENOFFS).so
 183         $(QUIETLY) $(LINK.CXX) -z nodefs -o $@ $(DTRACE_SRCDIR)/$(GENOFFS)Main.c \
 184                 ./lib$(GENOFFS).so
 185 
 186 CONDITIONALLY_UPDATE_JVMOFFS_TARGET = \
 187         cmp -s $@ $@.tmp; \
 188         case $$? in \
 189         0) rm -f $@.tmp;; \
 190         *) rm -f $@ && mv $@.tmp $@ && echo Updated $@;; \
 191         esac
 192 
 193 # $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs.
 194 $(JVMOFFS).h: $(GENOFFS)
 195         $(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -header > $@.tmp
 196         $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
 197 
 198 $(JVMOFFS)Index.h: $(GENOFFS)
 199         $(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -index > $@.tmp
 200         $(QUIETLY)  $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
 201 
 202 $(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h
 203         $(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -table > $@.tmp
 204         $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
 205 
 206 $(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp 
 207         $(QUIETLY) $(CXX) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp
 208 
 209 $(LIBJVM_DB): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE)
 210         @echo $(LOG_INFO) Making $@
 211         $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \
 212                 $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
 213 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 214 # Clear the SHF_ALLOC flag (if set) from empty section headers.
 215         $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
 216         $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DB_DEBUGINFO)
 217 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
 218 #       $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $@
 219         $(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DB_DEBUGINFO) $@
 220   ifeq ($(STRIP_POLICY),all_strip)
 221         $(QUIETLY) $(STRIP) $@
 222   else
 223     ifeq ($(STRIP_POLICY),min_strip)
 224         $(QUIETLY) $(STRIP) -x $@
 225     # implied else here is no stripping at all
 226     endif
 227   endif
 228   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 229         $(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO)
 230         $(RM) $(LIBJVM_DB_DEBUGINFO)
 231   endif
 232 endif
 233 
 234 $(LIBJVM_DTRACE): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
 235         @echo $(LOG_INFO) Making $@
 236         $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I.  \
 237                 $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
 238 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 239 # Clear the SHF_ALLOC flag (if set) from empty section headers.
 240         $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
 241         $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DTRACE_DEBUGINFO)
 242 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
 243 #       $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@
 244         $(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DTRACE_DEBUGINFO) $@
 245   ifeq ($(STRIP_POLICY),all_strip)
 246         $(QUIETLY) $(STRIP) $@
 247   else
 248     ifeq ($(STRIP_POLICY),min_strip)
 249         $(QUIETLY) $(STRIP) -x $@
 250     # implied else here is no stripping at all
 251     endif
 252   endif
 253   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 254         $(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) 
 255         $(RM) $(LIBJVM_DTRACE_DEBUGINFO)
 256   endif
 257 endif
 258 
 259 $(DTRACE).d: $(DTRACE_COMMON_SRCDIR)/hotspot.d $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d \
 260              $(DTRACE_COMMON_SRCDIR)/hs_private.d
 261         $(QUIETLY) cat $^ > $@
 262 
 263 $(DTRACE_JHELPER).d: $(DTRACE_SRCDIR)/jhelper.d
 264         $(QUIETLY) cat $^ > $@
 265 
 266 DTraced_Files = ciEnv.o \
 267                 classLoadingService.o \
 268                 compileBroker.o \
 269                 hashtable.o \
 270                 instanceKlass.o \
 271                 java.o \
 272                 jni.o \
 273                 jvm.o \
 274                 memoryManager.o \
 275                 nmethod.o \
 276                 objectMonitor.o \
 277                 runtimeService.o \
 278                 sharedRuntime.o \
 279                 synchronizer.o \
 280                 thread.o \
 281                 unsafe.o \
 282                 vmThread.o \
 283                 vmCMSOperations.o \
 284                 vmPSOperations.o \
 285                 vmGCOperations.o \
 286 
 287 # Dtrace is available, so we build $(DTRACE.o)  
 288 $(DTRACE.o): $(DTRACE).d $(DTraced_Files)
 289         @echo $(LOG_INFO) Compiling $(DTRACE).d
 290 
 291         $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -G -xlazyload -o $@ -s $(DTRACE).d \
 292      $(DTraced_Files) ||\
 293   STATUS=$$?;\
 294   if [ x"$$STATUS" = x"1" ]; then \
 295       if [ x`uname -r` = x"5.10" -a \
 296            x`uname -p` = x"sparc" ]; then\
 297     echo "*****************************************************************";\
 298     echo "* If you are building server compiler, and the error message is ";\
 299     echo "* \"incorrect ELF machine type...\", you have run into solaris bug ";\
 300     echo "* 6213962, \"dtrace -G doesn't work on sparcv8+ object files\".";\
 301     echo "* Either patch/upgrade your system (>= S10u1_15), or set the ";\
 302     echo "* environment variable HOTSPOT_DISABLE_DTRACE_PROBES to disable ";\
 303     echo "* dtrace probes for this build.";\
 304     echo "*****************************************************************";\
 305       elif [ x`uname -r` = x"5.10" ]; then\
 306     echo "*****************************************************************";\
 307     echo "* If you are seeing 'syntax error near \"umpiconninfo_t\"' on Solaris";\
 308     echo "* 10, try doing 'cd /usr/lib/dtrace && gzip mpi.d' as root, ";\
 309     echo "* or set the environment variable HOTSPOT_DISABLE_DTRACE_PROBES";\
 310     echo "* to disable dtrace probes for this build.";\
 311     echo "*****************************************************************";\
 312       else \
 313     echo "*****************************************************************";\
 314     echo "* If you cannot fix dtrace build issues, try to ";\
 315     echo "* set the environment variable HOTSPOT_DISABLE_DTRACE_PROBES";\
 316     echo "* to disable dtrace probes for this build.";\
 317     echo "*****************************************************************";\
 318       fi; \
 319   fi;\
 320   exit $$STATUS
 321   # Since some DTraced_Files are in LIBJVM.o and they are touched by this
 322   # command, and libgenerateJvmOffsets.so depends on LIBJVM.o, 'make' will
 323   # think it needs to rebuild libgenerateJvmOffsets.so and thus JvmOffsets*
 324   # files, but it doesn't, so we touch the necessary files to prevent later
 325   # recompilation. Note: we only touch the necessary files if they already
 326   # exist in order to close a race where an empty file can be created
 327   # before the real build rule is executed.
 328   # But, we can't touch the *.h files:  This rule depends
 329   # on them, and that would cause an infinite cycle of rebuilding.
 330   # Neither the *.h or *.ccp files need to be touched, since they have
 331   # rules which do not update them when the generator file has not
 332   # changed their contents.
 333         $(QUIETLY) if [ -f lib$(GENOFFS).so ]; then touch lib$(GENOFFS).so; fi
 334         $(QUIETLY) if [ -f $(GENOFFS) ]; then touch $(GENOFFS); fi
 335         $(QUIETLY) if [ -f $(JVMOFFS.o) ]; then touch $(JVMOFFS.o); fi
 336 
 337 
 338 $(DtraceOutDir):
 339         mkdir $(DtraceOutDir)
 340 
 341 $(DtraceOutDir)/hotspot.h: $(DTRACE_COMMON_SRCDIR)/hotspot.d | $(DtraceOutDir)
 342         $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hotspot.d
 343 
 344 $(DtraceOutDir)/hotspot_jni.h: $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d | $(DtraceOutDir)
 345         $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d
 346 
 347 $(DtraceOutDir)/hs_private.h: $(DTRACE_COMMON_SRCDIR)/hs_private.d | $(DtraceOutDir)
 348         $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hs_private.d
 349 
 350 dtrace_gen_headers: $(DtraceOutDir)/hotspot.h $(DtraceOutDir)/hotspot_jni.h $(DtraceOutDir)/hs_private.h
 351 
 352 # The jhelper.d and hotspot probes are separated into two different SUNW_dof sections.
 353 # Now the jhelper.d is built without the -Xlazyload flag.
 354 $(DTRACE_JHELPER.o) : $(DTRACE_JHELPER).d $(JVMOFFS).h $(JVMOFFS)Index.h
 355         @echo $(LOG_INFO) Compiling $(DTRACE_JHELPER).d
 356         $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -G -o $@ -s $(DTRACE_JHELPER).d
 357 
 358 .PHONY: dtraceCheck
 359 
 360 SYSTEM_DTRACE_H = /usr/include/dtrace.h
 361 SYSTEM_DTRACE_PROG = /usr/sbin/dtrace
 362 PATCH_DTRACE_PROG = /opt/SUNWdtrd/sbin/dtrace
 363 systemDtraceFound := $(wildcard ${SYSTEM_DTRACE_PROG})
 364 patchDtraceFound := $(wildcard ${PATCH_DTRACE_PROG})
 365 systemDtraceHdrFound := $(wildcard $(SYSTEM_DTRACE_H))
 366 
 367 ifneq ("$(systemDtraceHdrFound)", "") 
 368 CFLAGS += -DHAVE_DTRACE_H
 369 endif
 370 
 371 ifneq ("$(patchDtraceFound)", "")
 372 DTRACE_PROG=$(PATCH_DTRACE_PROG)
 373 DTRACE_INCL=-I/opt/SUNWdtrd/include
 374 else
 375 ifneq ("$(systemDtraceFound)", "")
 376 DTRACE_PROG=$(SYSTEM_DTRACE_PROG)
 377 else
 378 
 379 endif # ifneq ("$(systemDtraceFound)", "")
 380 endif # ifneq ("$(patchDtraceFound)", "")
 381 
 382 ifneq ("${DTRACE_PROG}", "")
 383 ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "")
 384 
 385 DTRACE_OBJS = $(DTRACE.o) $(JVMOFFS.o) $(DTRACE_JHELPER.o)
 386 CFLAGS += $(DTRACE_INCL) -DDTRACE_ENABLED
 387 MAPFILE_DTRACE_OPT = $(MAPFILE_DTRACE)
 388 
 389 dtraceCheck:
 390 
 391 else # manually disabled
 392 
 393 dtraceCheck:
 394         $(QUIETLY) echo $(LOG_INFO) "**NOTICE** Dtrace support disabled via environment variable"
 395 
 396 endif # ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "")
 397 
 398 else # No dtrace program found
 399 
 400 dtraceCheck:
 401         $(QUIETLY) echo $(LOG_INFO) "**NOTICE** Dtrace support disabled: not supported by system"
 402 
 403 endif # ifneq ("${dtraceFound}", "")
 404 
 405 endif # ifdef USE_GCC
 406 
 407 else # CORE build
 408 
 409 dtraceCheck:
 410         $(QUIETLY) echo $(LOG_INFO) "**NOTICE** Dtrace support disabled for CORE builds"
 411 
 412 endif # ifneq ("${TYPE}", "CORE")