comparison make/bsd/makefiles/dtrace.make @ 14278:a3ba776d6ab6

8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1 Reviewed-by: coleenp, sspitsyn, dsamersoff
author sla
date Thu, 16 Jan 2014 20:14:21 +0100
parents f509b8f4699b
children a00b8f42c4c4
comparison
equal deleted inserted replaced
14277:3bee68af0296 14278:a3ba776d6ab6
66 66
67 # making libjvm_db 67 # making libjvm_db
68 68
69 # Use mapfile with libjvm_db.so 69 # Use mapfile with libjvm_db.so
70 LIBJVM_DB_MAPFILE = # no mapfile for usdt2 # $(MAKEFILES_DIR)/mapfile-vers-jvm_db 70 LIBJVM_DB_MAPFILE = # no mapfile for usdt2 # $(MAKEFILES_DIR)/mapfile-vers-jvm_db
71 #LFLAGS_JVM_DB += $(MAPFLAG:FILENAME=$(LIBJVM_DB_MAPFILE))
72 71
73 # Use mapfile with libjvm_dtrace.so 72 # Use mapfile with libjvm_dtrace.so
74 LIBJVM_DTRACE_MAPFILE = # no mapfile for usdt2 # $(MAKEFILES_DIR)/mapfile-vers-jvm_dtrace 73 LIBJVM_DTRACE_MAPFILE = # no mapfile for usdt2 # $(MAKEFILES_DIR)/mapfile-vers-jvm_dtrace
75 #LFLAGS_JVM_DTRACE += $(MAPFLAG:FILENAME=$(LIBJVM_DTRACE_MAPFILE))
76 74
77 LFLAGS_JVM_DB += $(PICFLAG) # -D_REENTRANT 75 LFLAGS_JVM_DB += $(PICFLAG) # -D_REENTRANT
78 LFLAGS_JVM_DTRACE += $(PICFLAG) # -D_REENTRANT 76 LFLAGS_JVM_DTRACE += $(PICFLAG) # -D_REENTRANT
79 77
80 ISA = $(subst i386,i486,$(BUILDARCH)) 78 ISA = $(subst i386,i486,$(BUILDARCH))
258 $(RM) $(LIBJVM_DTRACE_DEBUGINFO) 256 $(RM) $(LIBJVM_DTRACE_DEBUGINFO)
259 endif 257 endif
260 endif 258 endif
261 endif 259 endif
262 260
263 #$(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \
264 # $(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d
265 # $(QUIETLY) cat $^ > $@
266 261
267 $(DtraceOutDir): 262 $(DtraceOutDir):
268 mkdir $(DtraceOutDir) 263 mkdir $(DtraceOutDir)
269 264
270 $(DtraceOutDir)/hotspot.h: $(DTRACE_SRCDIR)/hotspot.d | $(DtraceOutDir) 265 $(DtraceOutDir)/hotspot.h: $(DTRACE_SRCDIR)/hotspot.d | $(DtraceOutDir)
274 $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hotspot_jni.d 269 $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hotspot_jni.d
275 270
276 $(DtraceOutDir)/hs_private.h: $(DTRACE_SRCDIR)/hs_private.d | $(DtraceOutDir) 271 $(DtraceOutDir)/hs_private.h: $(DTRACE_SRCDIR)/hs_private.d | $(DtraceOutDir)
277 $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hs_private.d 272 $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hs_private.d
278 273
279 $(DtraceOutDir)/jhelper.h: $(DTRACE_SRCDIR)/jhelper.d $(JVMOFFS).o | $(DtraceOutDir)
280 $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/jhelper.d
281
282 # jhelper currently disabled
283 dtrace_gen_headers: $(DtraceOutDir)/hotspot.h $(DtraceOutDir)/hotspot_jni.h $(DtraceOutDir)/hs_private.h 274 dtrace_gen_headers: $(DtraceOutDir)/hotspot.h $(DtraceOutDir)/hotspot_jni.h $(DtraceOutDir)/hs_private.h
284 275
285 DTraced_Files = ciEnv.o \
286 classLoadingService.o \
287 compileBroker.o \
288 hashtable.o \
289 instanceKlass.o \
290 java.o \
291 jni.o \
292 jvm.o \
293 memoryManager.o \
294 nmethod.o \
295 objectMonitor.o \
296 runtimeService.o \
297 sharedRuntime.o \
298 synchronizer.o \
299 thread.o \
300 unsafe.o \
301 vmThread.o \
302 vmCMSOperations.o \
303 vmPSOperations.o \
304 vmGCOperations.o \
305
306 # Dtrace is available, so we build $(DTRACE.o)
307 #$(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files)
308 # @echo Compiling $(DTRACE).d
309
310 # $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -G -xlazyload -o $@ -s $(DTRACE).d \
311 # $(DTraced_Files) ||\
312 # STATUS=$$?;\
313 # if [ x"$$STATUS" = x"1" -a \
314 # x`uname -r` = x"5.10" -a \
315 # x`uname -p` = x"sparc" ]; then\
316 # echo "*****************************************************************";\
317 # echo "* If you are building server compiler, and the error message is ";\
318 # echo "* \"incorrect ELF machine type...\", you have run into solaris bug ";\
319 # echo "* 6213962, \"dtrace -G doesn't work on sparcv8+ object files\".";\
320 # echo "* Either patch/upgrade your system (>= S10u1_15), or set the ";\
321 # echo "* environment variable HOTSPOT_DISABLE_DTRACE_PROBES to disable ";\
322 # echo "* dtrace probes for this build.";\
323 # echo "*****************************************************************";\
324 # fi;\
325 # exit $$STATUS
326 # Since some DTraced_Files are in LIBJVM.o and they are touched by this
327 # command, and libgenerateJvmOffsets.so depends on LIBJVM.o, 'make' will
328 # think it needs to rebuild libgenerateJvmOffsets.so and thus JvmOffsets*
329 # files, but it doesn't, so we touch the necessary files to prevent later
330 # recompilation. Note: we only touch the necessary files if they already
331 # exist in order to close a race where an empty file can be created
332 # before the real build rule is executed.
333 # But, we can't touch the *.h files: This rule depends
334 # on them, and that would cause an infinite cycle of rebuilding.
335 # Neither the *.h or *.ccp files need to be touched, since they have
336 # rules which do not update them when the generator file has not
337 # changed their contents.
338 # $(QUIETLY) if [ -f lib$(GENOFFS).so ]; then touch lib$(GENOFFS).so; fi
339 # $(QUIETLY) if [ -f $(GENOFFS) ]; then touch $(GENOFFS); fi
340 # $(QUIETLY) if [ -f $(JVMOFFS.o) ]; then touch $(JVMOFFS.o); fi
341 276
342 .PHONY: dtraceCheck 277 .PHONY: dtraceCheck
343 278
344 #SYSTEM_DTRACE_H = /usr/include/dtrace.h
345 SYSTEM_DTRACE_PROG = /usr/sbin/dtrace 279 SYSTEM_DTRACE_PROG = /usr/sbin/dtrace
346 #PATCH_DTRACE_PROG = /opt/SUNWdtrd/sbin/dtrace
347 systemDtraceFound := $(wildcard ${SYSTEM_DTRACE_PROG}) 280 systemDtraceFound := $(wildcard ${SYSTEM_DTRACE_PROG})
348 #patchDtraceFound := $(wildcard ${PATCH_DTRACE_PROG}) 281
349 #systemDtraceHdrFound := $(wildcard $(SYSTEM_DTRACE_H))
350
351 #ifneq ("$(systemDtraceHdrFound)", "")
352 #CFLAGS += -DHAVE_DTRACE_H
353 #endif
354
355 #ifneq ("$(patchDtraceFound)", "")
356 #DTRACE_PROG=$(PATCH_DTRACE_PROG)
357 #DTRACE_INCL=-I/opt/SUNWdtrd/include
358 #else
359 ifneq ("$(systemDtraceFound)", "") 282 ifneq ("$(systemDtraceFound)", "")
360 DTRACE_PROG=$(SYSTEM_DTRACE_PROG) 283 DTRACE_PROG=$(SYSTEM_DTRACE_PROG)
361 else 284 else
362 285
363 endif # ifneq ("$(systemDtraceFound)", "") 286 endif
364 #endif # ifneq ("$(patchDtraceFound)", "")
365 287
366 ifneq ("${DTRACE_PROG}", "") 288 ifneq ("${DTRACE_PROG}", "")
367 ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "") 289 ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "")
368 290
369 DTRACE_OBJS = $(DTRACE.o) #$(JVMOFFS.o) 291 DTRACE_OBJS = $(DTRACE.o) #$(JVMOFFS.o)
370 CFLAGS += -DDTRACE_ENABLED #$(DTRACE_INCL) 292 CFLAGS += -DDTRACE_ENABLED #$(DTRACE_INCL)
371 #clangCFLAGS += -DDTRACE_ENABLED -fno-optimize-sibling-calls
372 #MAPFILE_DTRACE_OPT = $(MAPFILE_DTRACE)
373 293
374 294
375 dtraceCheck: 295 dtraceCheck:
376 296
377 dtrace_stuff: dtrace_gen_headers 297 dtrace_stuff: dtrace_gen_headers