dtrace.make 14.8 KB
Newer Older
D
duke 已提交
1
#
2
# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
D
duke 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
19 20 21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
D
duke 已提交
22 23 24 25 26
#  
#

# Rules to build jvm_db/dtrace, used by vm.make

27 28
# We build libjvm_dtrace/libjvm_db/dtrace for COMPILER1 and COMPILER2
# but not for CORE or KERNEL configurations.
D
duke 已提交
29 30 31 32 33 34 35 36 37 38 39 40

ifneq ("${TYPE}", "CORE")
ifneq ("${TYPE}", "KERNEL")

ifdef USE_GCC

dtraceCheck:
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled for gcc builds"

else

JVM_DB = libjvm_db
41 42
LIBJVM_DB = libjvm_db.so
LIBJVM_DB_G = libjvm$(G_SUFFIX)_db.so
D
duke 已提交
43

44 45
LIBJVM_DB_DEBUGINFO   = libjvm_db.debuginfo
LIBJVM_DB_DIZ         = libjvm_db.diz
46
LIBJVM_DB_G_DEBUGINFO = libjvm$(G_SUFFIX)_db.debuginfo
47
LIBJVM_DB_G_DIZ       = libjvm$(G_SUFFIX)_db.diz
48

D
duke 已提交
49
JVM_DTRACE = jvm_dtrace
50 51
LIBJVM_DTRACE = libjvm_dtrace.so
LIBJVM_DTRACE_G = libjvm$(G_SUFFIX)_dtrace.so
D
duke 已提交
52

53 54
LIBJVM_DTRACE_DEBUGINFO   = libjvm_dtrace.debuginfo
LIBJVM_DTRACE_DIZ         = libjvm_dtrace.diz
55
LIBJVM_DTRACE_G_DEBUGINFO = libjvm$(G_SUFFIX)_dtrace.debuginfo
56
LIBJVM_DTRACE_G_DIZ       = libjvm$(G_SUFFIX)_dtrace.diz
57

D
duke 已提交
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
JVMOFFS = JvmOffsets
JVMOFFS.o = $(JVMOFFS).o
GENOFFS = generate$(JVMOFFS)

DTRACE_SRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/dtrace
DTRACE = dtrace
DTRACE.o = $(DTRACE).o

# to remove '-g' option which causes link problems
# also '-z nodefs' is used as workaround
GENOFFS_CFLAGS = $(shell echo $(CFLAGS) | sed -e 's/ -g / /g' -e 's/ -g0 / /g';)

ifdef LP64
DTRACE_OPTS = -64 -D_LP64
endif

# making libjvm_db

# Use mapfile with libjvm_db.so
LIBJVM_DB_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_db
LFLAGS_JVM_DB += $(MAPFLAG:FILENAME=$(LIBJVM_DB_MAPFILE))

# Use mapfile with libjvm_dtrace.so
LIBJVM_DTRACE_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_dtrace
LFLAGS_JVM_DTRACE += $(MAPFLAG:FILENAME=$(LIBJVM_DTRACE_MAPFILE))

ifdef USE_GCC
LFLAGS_JVM_DB += -D_REENTRANT $(PICFLAG)
LFLAGS_JVM_DTRACE += -D_REENTRANT $(PICFLAG)
else
LFLAGS_JVM_DB += -mt $(PICFLAG) -xnolib
89
LFLAGS_JVM_DTRACE += -mt $(PICFLAG) -xnolib -ldl
D
duke 已提交
90 91 92 93 94 95 96 97
endif

ISA = $(subst i386,i486,$(shell isainfo -n))

# Making 64/libjvm_db.so: 64-bit version of libjvm_db.so which handles 32-bit libjvm.so
ifneq ("${ISA}","${BUILDARCH}")

XLIBJVM_DB = 64/$(LIBJVM_DB)
98
XLIBJVM_DB_G = 64/$(LIBJVM_DB_G)
D
duke 已提交
99
XLIBJVM_DTRACE = 64/$(LIBJVM_DTRACE)
100
XLIBJVM_DTRACE_G = 64/$(LIBJVM_DTRACE_G)
D
duke 已提交
101

102 103 104 105 106 107
XLIBJVM_DB_DEBUGINFO       = 64/$(LIBJVM_DB_DEBUGINFO)
XLIBJVM_DB_DIZ             = 64/$(LIBJVM_DB_DIZ)
XLIBJVM_DB_G_DEBUGINFO     = 64/$(LIBJVM_DB_G_DEBUGINFO)
XLIBJVM_DB_G_DIZ           = 64/$(LIBJVM_DB_G_DIZ)
XLIBJVM_DTRACE_DEBUGINFO   = 64/$(LIBJVM_DTRACE_DEBUGINFO)
XLIBJVM_DTRACE_DIZ         = 64/$(LIBJVM_DTRACE_DIZ)
108
XLIBJVM_DTRACE_G_DEBUGINFO = 64/$(LIBJVM_DTRACE_G_DEBUGINFO)
109
XLIBJVM_DTRACE_G_DIZ       = 64/$(LIBJVM_DTRACE_G_DIZ)
110

111
$(XLIBJVM_DB): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE)
D
duke 已提交
112 113
	@echo Making $@
	$(QUIETLY) mkdir -p 64/ ; \
114
	$(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. -I$(GENERATED) \
D
duke 已提交
115
		$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
116
	[ -f $(XLIBJVM_DB_G) ] || { ln -s $(LIBJVM_DB) $(XLIBJVM_DB_G); }
117
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
118 119 120 121 122 123
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
# Clear the SHF_ALLOC flag (if set) from empty section headers.
# An empty section header has sh_addr == 0 and sh_size == 0.
# This problem has only been seen on Solaris X64, but we call this tool
# on all Solaris builds just in case.
	$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
124
	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DB_DEBUGINFO)
125 126 127 128
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
#	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(XLIBJVM_DB_DEBUGINFO) $@
	$(QUIETLY) $(ADD_GNU_DEBUGLINK) $(XLIBJVM_DB_DEBUGINFO) $@
129 130 131 132 133 134 135 136
  ifeq ($(STRIP_POLICY),all_strip)
	$(QUIETLY) $(STRIP) $@
  else
    ifeq ($(STRIP_POLICY),min_strip)
	$(QUIETLY) $(STRIP) -x $@
    # implied else here is no stripping at all
    endif
  endif
137 138 139 140 141 142
	[ -f $(XLIBJVM_DB_G_DEBUGINFO) ] || { ln -s $(XLIBJVM_DB_DEBUGINFO) $(XLIBJVM_DB_G_DEBUGINFO); }
  ifeq ($(ZIP_DEBUGINFO_FILES),1)
	$(ZIPEXE) -q -y $(XLIBJVM_DB_DIZ) $(XLIBJVM_DB_DEBUGINFO) $(XLIBJVM_DB_G_DEBUGINFO)
	$(RM) $(XLIBJVM_DB_DEBUGINFO) $(XLIBJVM_DB_G_DEBUGINFO)
	[ -f $(XLIBJVM_DB_G_DIZ) ] || { ln -s $(XLIBJVM_DB_DIZ) $(XLIBJVM_DB_G_DIZ); }
  endif
143
endif
144

145
$(XLIBJVM_DTRACE): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
D
duke 已提交
146 147
	@echo Making $@
	$(QUIETLY) mkdir -p 64/ ; \
148
	$(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \
D
duke 已提交
149
		$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
150
	[ -f $(XLIBJVM_DTRACE_G) ] || { ln -s $(LIBJVM_DTRACE) $(XLIBJVM_DTRACE_G); }
151
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
152 153
# Clear the SHF_ALLOC flag (if set) from empty section headers.
	$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
154
	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DTRACE_DEBUGINFO)
155 156 157
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
#	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(XLIBJVM_DTRACE_DEBUGINFO) $@
	$(QUIETLY) $(ADD_GNU_DEBUGLINK) $(XLIBJVM_DTRACE_DEBUGINFO) $@
158 159 160 161 162 163 164 165
  ifeq ($(STRIP_POLICY),all_strip)
	$(QUIETLY) $(STRIP) $@
  else
    ifeq ($(STRIP_POLICY),min_strip)
	$(QUIETLY) $(STRIP) -x $@
    # implied else here is no stripping at all
    endif
  endif
166 167 168 169 170 171
	[ -f $(XLIBJVM_DTRACE_G_DEBUGINFO) ] || { ln -s $(XLIBJVM_DTRACE_DEBUGINFO) $(XLIBJVM_DTRACE_G_DEBUGINFO); }
  ifeq ($(ZIP_DEBUGINFO_FILES),1)
	$(ZIPEXE) -q -y $(XLIBJVM_DTRACE_DIZ) $(XLIBJVM_DTRACE_DEBUGINFO) $(XLIBJVM_DTRACE_G_DEBUGINFO)
	$(RM) $(XLIBJVM_DTRACE_DEBUGINFO) $(XLIBJVM_DTRACE_G_DEBUGINFO)
	[ -f $(XLIBJVM_DTRACE_G_DIZ) ] || { ln -s $(XLIBJVM_DTRACE_DIZ) $(XLIBJVM_DTRACE_G_DIZ); }
  endif
172
endif
173

D
duke 已提交
174 175 176 177 178 179 180 181 182
endif # ifneq ("${ISA}","${BUILDARCH}")

ifdef USE_GCC
LFLAGS_GENOFFS += -D_REENTRANT
else
LFLAGS_GENOFFS += -mt -xnolib -norunpath
endif

lib$(GENOFFS).so: $(DTRACE_SRCDIR)/$(GENOFFS).cpp $(DTRACE_SRCDIR)/$(GENOFFS).h \
183
                  $(LIBJVM.o)
184
	$(QUIETLY) $(CXX) $(CXXFLAGS) $(GENOFFS_CFLAGS) $(SHARED_FLAG) $(PICFLAG) \
D
duke 已提交
185 186 187
		 $(LFLAGS_GENOFFS) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS).cpp -lc

$(GENOFFS): $(DTRACE_SRCDIR)/$(GENOFFS)Main.c lib$(GENOFFS).so
188
	$(QUIETLY) $(LINK.CXX) -z nodefs -o $@ $(DTRACE_SRCDIR)/$(GENOFFS)Main.c \
D
duke 已提交
189 190
		./lib$(GENOFFS).so

191 192 193 194 195 196 197 198
CONDITIONALLY_UPDATE_JVMOFFS_TARGET = \
	cmp -s $@ $@.tmp; \
	case $$? in \
	0) rm -f $@.tmp;; \
	*) rm -f $@ && mv $@.tmp $@ && echo Updated $@;; \
	esac

# $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs.
D
duke 已提交
199
$(JVMOFFS).h: $(GENOFFS)
200 201
	$(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -header > $@.tmp
	$(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
D
duke 已提交
202 203

$(JVMOFFS)Index.h: $(GENOFFS)
204 205
	$(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -index > $@.tmp
	$(QUIETLY)  $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
D
duke 已提交
206 207

$(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h
208 209
	$(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -table > $@.tmp
	$(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
D
duke 已提交
210 211

$(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp 
212
	$(QUIETLY) $(CXX) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp
D
duke 已提交
213

214
$(LIBJVM_DB): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE)
D
duke 已提交
215 216 217
	@echo Making $@
	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \
		$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
218
	[ -f $(LIBJVM_DB_G) ] || { ln -s $@ $(LIBJVM_DB_G); }
219
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
220 221
# Clear the SHF_ALLOC flag (if set) from empty section headers.
	$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
222
	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DB_DEBUGINFO)
223 224 225
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
#	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $@
	$(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DB_DEBUGINFO) $@
226 227 228 229 230 231 232 233 234
  ifeq ($(STRIP_POLICY),all_strip)
	$(QUIETLY) $(STRIP) $@
  else
    ifeq ($(STRIP_POLICY),min_strip)
	$(QUIETLY) $(STRIP) -x $@
    # implied else here is no stripping at all
    endif
  endif
	[ -f $(LIBJVM_DB_G_DEBUGINFO) ] || { ln -s $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO); }
235 236 237 238 239
  ifeq ($(ZIP_DEBUGINFO_FILES),1)
	$(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO)
	$(RM) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO)
	[ -f $(LIBJVM_DB_G_DIZ) ] || { ln -s $(LIBJVM_DB_DIZ) $(LIBJVM_DB_G_DIZ); }
  endif
240
endif
D
duke 已提交
241

242
$(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)
D
duke 已提交
243 244 245
	@echo Making $@
	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I.  \
		$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
246
	[ -f $(LIBJVM_DTRACE_G) ] || { ln -s $@ $(LIBJVM_DTRACE_G); }
247
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
248 249
# Clear the SHF_ALLOC flag (if set) from empty section headers.
	$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
250
	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DTRACE_DEBUGINFO)
251 252 253
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
#	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@
	$(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DTRACE_DEBUGINFO) $@
254 255 256 257 258 259 260 261 262
  ifeq ($(STRIP_POLICY),all_strip)
	$(QUIETLY) $(STRIP) $@
  else
    ifeq ($(STRIP_POLICY),min_strip)
	$(QUIETLY) $(STRIP) -x $@
    # implied else here is no stripping at all
    endif
  endif
	[ -f $(LIBJVM_DTRACE_G_DEBUGINFO) ] || { ln -s $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO); }
263 264 265 266 267
  ifeq ($(ZIP_DEBUGINFO_FILES),1)
	$(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO)
	$(RM) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO)
	[ -f $(LIBJVM_DTRACE_G_DIZ) ] || { ln -s $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_G_DIZ); }
  endif
268
endif
D
duke 已提交
269 270 271 272 273

$(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \
             $(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d
	$(QUIETLY) cat $^ > $@

274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294
DTraced_Files = ciEnv.o \
                classLoadingService.o \
                compileBroker.o \
                hashtable.o \
                instanceKlass.o \
                java.o \
                jni.o \
                jvm.o \
                memoryManager.o \
                nmethod.o \
                objectMonitor.o \
                runtimeService.o \
                sharedRuntime.o \
                synchronizer.o \
                thread.o \
                unsafe.o \
                vmThread.o \
                vmCMSOperations.o \
                vmPSOperations.o \
                vmGCOperations.o \

D
duke 已提交
295 296 297 298
# Dtrace is available, so we build $(DTRACE.o)  
$(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files)
	@echo Compiling $(DTRACE).d

299
	$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -G -xlazyload -o $@ -s $(DTRACE).d \
D
duke 已提交
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332
     $(DTraced_Files) ||\
  STATUS=$$?;\
	if [ x"$$STATUS" = x"1" -a \
       x`uname -r` = x"5.10" -a \
       x`uname -p` = x"sparc" ]; then\
    echo "*****************************************************************";\
    echo "* If you are building server compiler, and the error message is ";\
    echo "* \"incorrect ELF machine type...\", you have run into solaris bug ";\
    echo "* 6213962, \"dtrace -G doesn't work on sparcv8+ object files\".";\
    echo "* Either patch/upgrade your system (>= S10u1_15), or set the ";\
    echo "* environment variable HOTSPOT_DISABLE_DTRACE_PROBES to disable ";\
    echo "* dtrace probes for this build.";\
    echo "*****************************************************************";\
  fi;\
  exit $$STATUS
  # Since some DTraced_Files are in LIBJVM.o and they are touched by this
  # command, and libgenerateJvmOffsets.so depends on LIBJVM.o, 'make' will
  # think it needs to rebuild libgenerateJvmOffsets.so and thus JvmOffsets*
  # files, but it doesn't, so we touch the necessary files to prevent later
  # recompilation. Note: we only touch the necessary files if they already
  # exist in order to close a race where an empty file can be created
  # before the real build rule is executed.
  # But, we can't touch the *.h files:  This rule depends
  # on them, and that would cause an infinite cycle of rebuilding.
  # Neither the *.h or *.ccp files need to be touched, since they have
  # rules which do not update them when the generator file has not
  # changed their contents.
	$(QUIETLY) if [ -f lib$(GENOFFS).so ]; then touch lib$(GENOFFS).so; fi
	$(QUIETLY) if [ -f $(GENOFFS) ]; then touch $(GENOFFS); fi
	$(QUIETLY) if [ -f $(JVMOFFS.o) ]; then touch $(JVMOFFS.o); fi

.PHONY: dtraceCheck

333
SYSTEM_DTRACE_H = /usr/include/dtrace.h
D
duke 已提交
334 335 336 337
SYSTEM_DTRACE_PROG = /usr/sbin/dtrace
PATCH_DTRACE_PROG = /opt/SUNWdtrd/sbin/dtrace
systemDtraceFound := $(wildcard ${SYSTEM_DTRACE_PROG})
patchDtraceFound := $(wildcard ${PATCH_DTRACE_PROG})
338 339 340 341 342
systemDtraceHdrFound := $(wildcard $(SYSTEM_DTRACE_H))

ifneq ("$(systemDtraceHdrFound)", "") 
CFLAGS += -DHAVE_DTRACE_H
endif
D
duke 已提交
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392

ifneq ("$(patchDtraceFound)", "")
DTRACE_PROG=$(PATCH_DTRACE_PROG)
DTRACE_INCL=-I/opt/SUNWdtrd/include
else
ifneq ("$(systemDtraceFound)", "")
DTRACE_PROG=$(SYSTEM_DTRACE_PROG)
else

endif # ifneq ("$(systemDtraceFound)", "")
endif # ifneq ("$(patchDtraceFound)", "")

ifneq ("${DTRACE_PROG}", "")
ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "")

DTRACE_OBJS = $(DTRACE.o) $(JVMOFFS.o)
CFLAGS += $(DTRACE_INCL) -DDTRACE_ENABLED
MAPFILE_DTRACE_OPT = $(MAPFILE_DTRACE)

dtraceCheck:

else # manually disabled

dtraceCheck:
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled via environment variable"

endif # ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "")

else # No dtrace program found

dtraceCheck:
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled: not supported by system"

endif # ifneq ("${dtraceFound}", "")

endif # ifdef USE_GCC

else # KERNEL build

dtraceCheck:
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled for KERNEL builds"

endif # ifneq ("${TYPE}", "KERNEL")

else # CORE build

dtraceCheck:
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled for CORE builds"

endif # ifneq ("${TYPE}", "CORE")