annotate make/solaris/makefiles/dtrace.make @ 433:c1345e85f901

6767659: Conversion from i486 to x86 missed some entries in makefiles Summary: Fixed missed entries. Reviewed-by: never
author kvn
date Thu, 13 Nov 2008 14:50:04 -0800
parents d1605aabd0a1
children b5e603f2e024
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 #
196
d1605aabd0a1 6719955: Update copyright year
xdono
parents: 158
diff changeset
2 # Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 #
a61af66fc99e Initial load
duke
parents:
diff changeset
5 # This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 # under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 # published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 #
a61af66fc99e Initial load
duke
parents:
diff changeset
9 # This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 # version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 # accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 #
a61af66fc99e Initial load
duke
parents:
diff changeset
15 # You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 # 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 #
a61af66fc99e Initial load
duke
parents:
diff changeset
19 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a61af66fc99e Initial load
duke
parents:
diff changeset
20 # CA 95054 USA or visit www.sun.com if you need additional information or
a61af66fc99e Initial load
duke
parents:
diff changeset
21 # have any questions.
a61af66fc99e Initial load
duke
parents:
diff changeset
22 #
a61af66fc99e Initial load
duke
parents:
diff changeset
23 #
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 # Rules to build jvm_db/dtrace, used by vm.make
a61af66fc99e Initial load
duke
parents:
diff changeset
26
a61af66fc99e Initial load
duke
parents:
diff changeset
27 # we build libjvm_dtrace/libjvm_db/dtrace for COMPILER1 and COMPILER2
a61af66fc99e Initial load
duke
parents:
diff changeset
28 # but not for CORE configuration
a61af66fc99e Initial load
duke
parents:
diff changeset
29
a61af66fc99e Initial load
duke
parents:
diff changeset
30 ifneq ("${TYPE}", "CORE")
a61af66fc99e Initial load
duke
parents:
diff changeset
31 ifneq ("${TYPE}", "KERNEL")
a61af66fc99e Initial load
duke
parents:
diff changeset
32
a61af66fc99e Initial load
duke
parents:
diff changeset
33 ifdef USE_GCC
a61af66fc99e Initial load
duke
parents:
diff changeset
34
a61af66fc99e Initial load
duke
parents:
diff changeset
35 dtraceCheck:
a61af66fc99e Initial load
duke
parents:
diff changeset
36 $(QUIETLY) echo "**NOTICE** Dtrace support disabled for gcc builds"
a61af66fc99e Initial load
duke
parents:
diff changeset
37
a61af66fc99e Initial load
duke
parents:
diff changeset
38 else
a61af66fc99e Initial load
duke
parents:
diff changeset
39
a61af66fc99e Initial load
duke
parents:
diff changeset
40
a61af66fc99e Initial load
duke
parents:
diff changeset
41 JVM_DB = libjvm_db
a61af66fc99e Initial load
duke
parents:
diff changeset
42 LIBJVM_DB = libjvm$(G_SUFFIX)_db.so
a61af66fc99e Initial load
duke
parents:
diff changeset
43
a61af66fc99e Initial load
duke
parents:
diff changeset
44 JVM_DTRACE = jvm_dtrace
a61af66fc99e Initial load
duke
parents:
diff changeset
45 LIBJVM_DTRACE = libjvm$(G_SUFFIX)_dtrace.so
a61af66fc99e Initial load
duke
parents:
diff changeset
46
a61af66fc99e Initial load
duke
parents:
diff changeset
47 JVMOFFS = JvmOffsets
a61af66fc99e Initial load
duke
parents:
diff changeset
48 JVMOFFS.o = $(JVMOFFS).o
a61af66fc99e Initial load
duke
parents:
diff changeset
49 GENOFFS = generate$(JVMOFFS)
a61af66fc99e Initial load
duke
parents:
diff changeset
50
a61af66fc99e Initial load
duke
parents:
diff changeset
51 DTRACE_SRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/dtrace
a61af66fc99e Initial load
duke
parents:
diff changeset
52 DTRACE = dtrace
a61af66fc99e Initial load
duke
parents:
diff changeset
53 DTRACE.o = $(DTRACE).o
a61af66fc99e Initial load
duke
parents:
diff changeset
54
a61af66fc99e Initial load
duke
parents:
diff changeset
55 # to remove '-g' option which causes link problems
a61af66fc99e Initial load
duke
parents:
diff changeset
56 # also '-z nodefs' is used as workaround
a61af66fc99e Initial load
duke
parents:
diff changeset
57 GENOFFS_CFLAGS = $(shell echo $(CFLAGS) | sed -e 's/ -g / /g' -e 's/ -g0 / /g';)
a61af66fc99e Initial load
duke
parents:
diff changeset
58
a61af66fc99e Initial load
duke
parents:
diff changeset
59 ifdef LP64
a61af66fc99e Initial load
duke
parents:
diff changeset
60 DTRACE_OPTS = -64 -D_LP64
a61af66fc99e Initial load
duke
parents:
diff changeset
61 endif
a61af66fc99e Initial load
duke
parents:
diff changeset
62
a61af66fc99e Initial load
duke
parents:
diff changeset
63 # making libjvm_db
a61af66fc99e Initial load
duke
parents:
diff changeset
64
a61af66fc99e Initial load
duke
parents:
diff changeset
65 INCLS = $(GENERATED)/incls
a61af66fc99e Initial load
duke
parents:
diff changeset
66
a61af66fc99e Initial load
duke
parents:
diff changeset
67 # Use mapfile with libjvm_db.so
a61af66fc99e Initial load
duke
parents:
diff changeset
68 LIBJVM_DB_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_db
a61af66fc99e Initial load
duke
parents:
diff changeset
69 LFLAGS_JVM_DB += $(MAPFLAG:FILENAME=$(LIBJVM_DB_MAPFILE))
a61af66fc99e Initial load
duke
parents:
diff changeset
70
a61af66fc99e Initial load
duke
parents:
diff changeset
71 # Use mapfile with libjvm_dtrace.so
a61af66fc99e Initial load
duke
parents:
diff changeset
72 LIBJVM_DTRACE_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_dtrace
a61af66fc99e Initial load
duke
parents:
diff changeset
73 LFLAGS_JVM_DTRACE += $(MAPFLAG:FILENAME=$(LIBJVM_DTRACE_MAPFILE))
a61af66fc99e Initial load
duke
parents:
diff changeset
74
a61af66fc99e Initial load
duke
parents:
diff changeset
75 ifdef USE_GCC
a61af66fc99e Initial load
duke
parents:
diff changeset
76 LFLAGS_JVM_DB += -D_REENTRANT $(PICFLAG)
a61af66fc99e Initial load
duke
parents:
diff changeset
77 LFLAGS_JVM_DTRACE += -D_REENTRANT $(PICFLAG)
a61af66fc99e Initial load
duke
parents:
diff changeset
78 else
a61af66fc99e Initial load
duke
parents:
diff changeset
79 LFLAGS_JVM_DB += -mt $(PICFLAG) -xnolib
a61af66fc99e Initial load
duke
parents:
diff changeset
80 LFLAGS_JVM_DTRACE += -mt $(PICFLAG) -xnolib
a61af66fc99e Initial load
duke
parents:
diff changeset
81 endif
a61af66fc99e Initial load
duke
parents:
diff changeset
82
a61af66fc99e Initial load
duke
parents:
diff changeset
83 ISA = $(subst i386,i486,$(shell isainfo -n))
a61af66fc99e Initial load
duke
parents:
diff changeset
84
a61af66fc99e Initial load
duke
parents:
diff changeset
85 # Making 64/libjvm_db.so: 64-bit version of libjvm_db.so which handles 32-bit libjvm.so
a61af66fc99e Initial load
duke
parents:
diff changeset
86 ifneq ("${ISA}","${BUILDARCH}")
a61af66fc99e Initial load
duke
parents:
diff changeset
87
a61af66fc99e Initial load
duke
parents:
diff changeset
88 XLIBJVM_DB = 64/$(LIBJVM_DB)
a61af66fc99e Initial load
duke
parents:
diff changeset
89 XLIBJVM_DTRACE = 64/$(LIBJVM_DTRACE)
a61af66fc99e Initial load
duke
parents:
diff changeset
90
a61af66fc99e Initial load
duke
parents:
diff changeset
91 $(XLIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE)
a61af66fc99e Initial load
duke
parents:
diff changeset
92 @echo Making $@
a61af66fc99e Initial load
duke
parents:
diff changeset
93 $(QUIETLY) mkdir -p 64/ ; \
433
c1345e85f901 6767659: Conversion from i486 to x86 missed some entries in makefiles
kvn
parents: 196
diff changeset
94 $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. -I$(GENERATED) \
0
a61af66fc99e Initial load
duke
parents:
diff changeset
95 $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
a61af66fc99e Initial load
duke
parents:
diff changeset
96 $(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
a61af66fc99e Initial load
duke
parents:
diff changeset
97 @echo Making $@
a61af66fc99e Initial load
duke
parents:
diff changeset
98 $(QUIETLY) mkdir -p 64/ ; \
433
c1345e85f901 6767659: Conversion from i486 to x86 missed some entries in makefiles
kvn
parents: 196
diff changeset
99 $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \
0
a61af66fc99e Initial load
duke
parents:
diff changeset
100 $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
a61af66fc99e Initial load
duke
parents:
diff changeset
101 endif # ifneq ("${ISA}","${BUILDARCH}")
a61af66fc99e Initial load
duke
parents:
diff changeset
102
a61af66fc99e Initial load
duke
parents:
diff changeset
103 ifdef USE_GCC
a61af66fc99e Initial load
duke
parents:
diff changeset
104 LFLAGS_GENOFFS += -D_REENTRANT
a61af66fc99e Initial load
duke
parents:
diff changeset
105 else
a61af66fc99e Initial load
duke
parents:
diff changeset
106 LFLAGS_GENOFFS += -mt -xnolib -norunpath
a61af66fc99e Initial load
duke
parents:
diff changeset
107 endif
a61af66fc99e Initial load
duke
parents:
diff changeset
108
a61af66fc99e Initial load
duke
parents:
diff changeset
109 lib$(GENOFFS).so: $(DTRACE_SRCDIR)/$(GENOFFS).cpp $(DTRACE_SRCDIR)/$(GENOFFS).h \
a61af66fc99e Initial load
duke
parents:
diff changeset
110 $(INCLS)/_vmStructs.cpp.incl $(LIBJVM.o)
a61af66fc99e Initial load
duke
parents:
diff changeset
111 $(QUIETLY) $(CCC) $(CPPFLAGS) $(GENOFFS_CFLAGS) $(SHARED_FLAG) $(PICFLAG) \
a61af66fc99e Initial load
duke
parents:
diff changeset
112 $(LFLAGS_GENOFFS) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS).cpp -lc
a61af66fc99e Initial load
duke
parents:
diff changeset
113
a61af66fc99e Initial load
duke
parents:
diff changeset
114 $(GENOFFS): $(DTRACE_SRCDIR)/$(GENOFFS)Main.c lib$(GENOFFS).so
a61af66fc99e Initial load
duke
parents:
diff changeset
115 $(QUIETLY) $(LINK.CC) -z nodefs -o $@ $(DTRACE_SRCDIR)/$(GENOFFS)Main.c \
a61af66fc99e Initial load
duke
parents:
diff changeset
116 ./lib$(GENOFFS).so
a61af66fc99e Initial load
duke
parents:
diff changeset
117
a61af66fc99e Initial load
duke
parents:
diff changeset
118 # $@.tmp is created first. It's to avoid empty $(JVMOFFS).h produced in error case.
a61af66fc99e Initial load
duke
parents:
diff changeset
119 $(JVMOFFS).h: $(GENOFFS)
a61af66fc99e Initial load
duke
parents:
diff changeset
120 $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -header > $@.tmp ; \
a61af66fc99e Initial load
duke
parents:
diff changeset
121 if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \
a61af66fc99e Initial load
duke
parents:
diff changeset
122 then rm -f $@; mv $@.tmp $@; echo Updated $@ ; \
a61af66fc99e Initial load
duke
parents:
diff changeset
123 else rm -f $@.tmp; \
a61af66fc99e Initial load
duke
parents:
diff changeset
124 fi
a61af66fc99e Initial load
duke
parents:
diff changeset
125
a61af66fc99e Initial load
duke
parents:
diff changeset
126 $(JVMOFFS)Index.h: $(GENOFFS)
a61af66fc99e Initial load
duke
parents:
diff changeset
127 $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -index > $@.tmp ; \
a61af66fc99e Initial load
duke
parents:
diff changeset
128 if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \
a61af66fc99e Initial load
duke
parents:
diff changeset
129 then rm -f $@; mv $@.tmp $@; echo Updated $@ ; \
a61af66fc99e Initial load
duke
parents:
diff changeset
130 else rm -f $@.tmp; \
a61af66fc99e Initial load
duke
parents:
diff changeset
131 fi
a61af66fc99e Initial load
duke
parents:
diff changeset
132
a61af66fc99e Initial load
duke
parents:
diff changeset
133 $(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h
a61af66fc99e Initial load
duke
parents:
diff changeset
134 $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -table > $@.tmp ; \
a61af66fc99e Initial load
duke
parents:
diff changeset
135 if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \
a61af66fc99e Initial load
duke
parents:
diff changeset
136 then rm -f $@; mv $@.tmp $@; echo Updated $@ ; \
a61af66fc99e Initial load
duke
parents:
diff changeset
137 else rm -f $@.tmp; \
a61af66fc99e Initial load
duke
parents:
diff changeset
138 fi
a61af66fc99e Initial load
duke
parents:
diff changeset
139
a61af66fc99e Initial load
duke
parents:
diff changeset
140 $(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp
a61af66fc99e Initial load
duke
parents:
diff changeset
141 $(QUIETLY) $(CCC) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp
a61af66fc99e Initial load
duke
parents:
diff changeset
142
a61af66fc99e Initial load
duke
parents:
diff changeset
143 $(LIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE)
a61af66fc99e Initial load
duke
parents:
diff changeset
144 @echo Making $@
a61af66fc99e Initial load
duke
parents:
diff changeset
145 $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \
a61af66fc99e Initial load
duke
parents:
diff changeset
146 $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
a61af66fc99e Initial load
duke
parents:
diff changeset
147
a61af66fc99e Initial load
duke
parents:
diff changeset
148 $(LIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
a61af66fc99e Initial load
duke
parents:
diff changeset
149 @echo Making $@
a61af66fc99e Initial load
duke
parents:
diff changeset
150 $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. \
a61af66fc99e Initial load
duke
parents:
diff changeset
151 $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
a61af66fc99e Initial load
duke
parents:
diff changeset
152
a61af66fc99e Initial load
duke
parents:
diff changeset
153 $(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \
a61af66fc99e Initial load
duke
parents:
diff changeset
154 $(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d
a61af66fc99e Initial load
duke
parents:
diff changeset
155 $(QUIETLY) cat $^ > $@
a61af66fc99e Initial load
duke
parents:
diff changeset
156
a61af66fc99e Initial load
duke
parents:
diff changeset
157 # Dtrace is available, so we build $(DTRACE.o)
a61af66fc99e Initial load
duke
parents:
diff changeset
158 $(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files)
a61af66fc99e Initial load
duke
parents:
diff changeset
159 @echo Compiling $(DTRACE).d
a61af66fc99e Initial load
duke
parents:
diff changeset
160
a61af66fc99e Initial load
duke
parents:
diff changeset
161 $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -G -o $@ -s $(DTRACE).d \
a61af66fc99e Initial load
duke
parents:
diff changeset
162 $(DTraced_Files) ||\
a61af66fc99e Initial load
duke
parents:
diff changeset
163 STATUS=$$?;\
a61af66fc99e Initial load
duke
parents:
diff changeset
164 if [ x"$$STATUS" = x"1" -a \
a61af66fc99e Initial load
duke
parents:
diff changeset
165 x`uname -r` = x"5.10" -a \
a61af66fc99e Initial load
duke
parents:
diff changeset
166 x`uname -p` = x"sparc" ]; then\
a61af66fc99e Initial load
duke
parents:
diff changeset
167 echo "*****************************************************************";\
a61af66fc99e Initial load
duke
parents:
diff changeset
168 echo "* If you are building server compiler, and the error message is ";\
a61af66fc99e Initial load
duke
parents:
diff changeset
169 echo "* \"incorrect ELF machine type...\", you have run into solaris bug ";\
a61af66fc99e Initial load
duke
parents:
diff changeset
170 echo "* 6213962, \"dtrace -G doesn't work on sparcv8+ object files\".";\
a61af66fc99e Initial load
duke
parents:
diff changeset
171 echo "* Either patch/upgrade your system (>= S10u1_15), or set the ";\
a61af66fc99e Initial load
duke
parents:
diff changeset
172 echo "* environment variable HOTSPOT_DISABLE_DTRACE_PROBES to disable ";\
a61af66fc99e Initial load
duke
parents:
diff changeset
173 echo "* dtrace probes for this build.";\
a61af66fc99e Initial load
duke
parents:
diff changeset
174 echo "*****************************************************************";\
a61af66fc99e Initial load
duke
parents:
diff changeset
175 fi;\
a61af66fc99e Initial load
duke
parents:
diff changeset
176 exit $$STATUS
a61af66fc99e Initial load
duke
parents:
diff changeset
177 # Since some DTraced_Files are in LIBJVM.o and they are touched by this
a61af66fc99e Initial load
duke
parents:
diff changeset
178 # command, and libgenerateJvmOffsets.so depends on LIBJVM.o, 'make' will
a61af66fc99e Initial load
duke
parents:
diff changeset
179 # think it needs to rebuild libgenerateJvmOffsets.so and thus JvmOffsets*
a61af66fc99e Initial load
duke
parents:
diff changeset
180 # files, but it doesn't, so we touch the necessary files to prevent later
a61af66fc99e Initial load
duke
parents:
diff changeset
181 # recompilation. Note: we only touch the necessary files if they already
a61af66fc99e Initial load
duke
parents:
diff changeset
182 # exist in order to close a race where an empty file can be created
a61af66fc99e Initial load
duke
parents:
diff changeset
183 # before the real build rule is executed.
a61af66fc99e Initial load
duke
parents:
diff changeset
184 # But, we can't touch the *.h files: This rule depends
a61af66fc99e Initial load
duke
parents:
diff changeset
185 # on them, and that would cause an infinite cycle of rebuilding.
a61af66fc99e Initial load
duke
parents:
diff changeset
186 # Neither the *.h or *.ccp files need to be touched, since they have
a61af66fc99e Initial load
duke
parents:
diff changeset
187 # rules which do not update them when the generator file has not
a61af66fc99e Initial load
duke
parents:
diff changeset
188 # changed their contents.
a61af66fc99e Initial load
duke
parents:
diff changeset
189 $(QUIETLY) if [ -f lib$(GENOFFS).so ]; then touch lib$(GENOFFS).so; fi
a61af66fc99e Initial load
duke
parents:
diff changeset
190 $(QUIETLY) if [ -f $(GENOFFS) ]; then touch $(GENOFFS); fi
a61af66fc99e Initial load
duke
parents:
diff changeset
191 $(QUIETLY) if [ -f $(JVMOFFS.o) ]; then touch $(JVMOFFS.o); fi
a61af66fc99e Initial load
duke
parents:
diff changeset
192
a61af66fc99e Initial load
duke
parents:
diff changeset
193 .PHONY: dtraceCheck
a61af66fc99e Initial load
duke
parents:
diff changeset
194
116
018d5b58dd4f 6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents: 91
diff changeset
195 SYSTEM_DTRACE_H = /usr/include/dtrace.h
0
a61af66fc99e Initial load
duke
parents:
diff changeset
196 SYSTEM_DTRACE_PROG = /usr/sbin/dtrace
a61af66fc99e Initial load
duke
parents:
diff changeset
197 PATCH_DTRACE_PROG = /opt/SUNWdtrd/sbin/dtrace
a61af66fc99e Initial load
duke
parents:
diff changeset
198 systemDtraceFound := $(wildcard ${SYSTEM_DTRACE_PROG})
a61af66fc99e Initial load
duke
parents:
diff changeset
199 patchDtraceFound := $(wildcard ${PATCH_DTRACE_PROG})
116
018d5b58dd4f 6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents: 91
diff changeset
200 systemDtraceHdrFound := $(wildcard $(SYSTEM_DTRACE_H))
018d5b58dd4f 6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents: 91
diff changeset
201
018d5b58dd4f 6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents: 91
diff changeset
202 ifneq ("$(systemDtraceHdrFound)", "")
018d5b58dd4f 6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents: 91
diff changeset
203 CFLAGS += -DHAVE_DTRACE_H
018d5b58dd4f 6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents: 91
diff changeset
204 endif
0
a61af66fc99e Initial load
duke
parents:
diff changeset
205
a61af66fc99e Initial load
duke
parents:
diff changeset
206 ifneq ("$(patchDtraceFound)", "")
a61af66fc99e Initial load
duke
parents:
diff changeset
207 DTRACE_PROG=$(PATCH_DTRACE_PROG)
a61af66fc99e Initial load
duke
parents:
diff changeset
208 DTRACE_INCL=-I/opt/SUNWdtrd/include
a61af66fc99e Initial load
duke
parents:
diff changeset
209 else
a61af66fc99e Initial load
duke
parents:
diff changeset
210 ifneq ("$(systemDtraceFound)", "")
a61af66fc99e Initial load
duke
parents:
diff changeset
211 DTRACE_PROG=$(SYSTEM_DTRACE_PROG)
a61af66fc99e Initial load
duke
parents:
diff changeset
212 else
a61af66fc99e Initial load
duke
parents:
diff changeset
213
a61af66fc99e Initial load
duke
parents:
diff changeset
214 endif # ifneq ("$(systemDtraceFound)", "")
a61af66fc99e Initial load
duke
parents:
diff changeset
215 endif # ifneq ("$(patchDtraceFound)", "")
a61af66fc99e Initial load
duke
parents:
diff changeset
216
a61af66fc99e Initial load
duke
parents:
diff changeset
217 ifneq ("${DTRACE_PROG}", "")
a61af66fc99e Initial load
duke
parents:
diff changeset
218 ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "")
a61af66fc99e Initial load
duke
parents:
diff changeset
219
a61af66fc99e Initial load
duke
parents:
diff changeset
220 DTRACE_OBJS = $(DTRACE.o) $(JVMOFFS.o)
a61af66fc99e Initial load
duke
parents:
diff changeset
221 CFLAGS += $(DTRACE_INCL) -DDTRACE_ENABLED
a61af66fc99e Initial load
duke
parents:
diff changeset
222 MAPFILE_DTRACE_OPT = $(MAPFILE_DTRACE)
a61af66fc99e Initial load
duke
parents:
diff changeset
223
a61af66fc99e Initial load
duke
parents:
diff changeset
224 dtraceCheck:
a61af66fc99e Initial load
duke
parents:
diff changeset
225
a61af66fc99e Initial load
duke
parents:
diff changeset
226 else # manually disabled
a61af66fc99e Initial load
duke
parents:
diff changeset
227
a61af66fc99e Initial load
duke
parents:
diff changeset
228 dtraceCheck:
a61af66fc99e Initial load
duke
parents:
diff changeset
229 $(QUIETLY) echo "**NOTICE** Dtrace support disabled via environment variable"
a61af66fc99e Initial load
duke
parents:
diff changeset
230
a61af66fc99e Initial load
duke
parents:
diff changeset
231 endif # ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "")
a61af66fc99e Initial load
duke
parents:
diff changeset
232
a61af66fc99e Initial load
duke
parents:
diff changeset
233 else # No dtrace program found
a61af66fc99e Initial load
duke
parents:
diff changeset
234
a61af66fc99e Initial load
duke
parents:
diff changeset
235 dtraceCheck:
a61af66fc99e Initial load
duke
parents:
diff changeset
236 $(QUIETLY) echo "**NOTICE** Dtrace support disabled: not supported by system"
a61af66fc99e Initial load
duke
parents:
diff changeset
237
a61af66fc99e Initial load
duke
parents:
diff changeset
238 endif # ifneq ("${dtraceFound}", "")
a61af66fc99e Initial load
duke
parents:
diff changeset
239
a61af66fc99e Initial load
duke
parents:
diff changeset
240 endif # ifdef USE_GCC
a61af66fc99e Initial load
duke
parents:
diff changeset
241
a61af66fc99e Initial load
duke
parents:
diff changeset
242 else # KERNEL build
a61af66fc99e Initial load
duke
parents:
diff changeset
243
a61af66fc99e Initial load
duke
parents:
diff changeset
244 dtraceCheck:
a61af66fc99e Initial load
duke
parents:
diff changeset
245 $(QUIETLY) echo "**NOTICE** Dtrace support disabled for KERNEL builds"
a61af66fc99e Initial load
duke
parents:
diff changeset
246
a61af66fc99e Initial load
duke
parents:
diff changeset
247 endif # ifneq ("${TYPE}", "KERNEL")
a61af66fc99e Initial load
duke
parents:
diff changeset
248
a61af66fc99e Initial load
duke
parents:
diff changeset
249 else # CORE build
a61af66fc99e Initial load
duke
parents:
diff changeset
250
a61af66fc99e Initial load
duke
parents:
diff changeset
251 dtraceCheck:
a61af66fc99e Initial load
duke
parents:
diff changeset
252 $(QUIETLY) echo "**NOTICE** Dtrace support disabled for CORE builds"
a61af66fc99e Initial load
duke
parents:
diff changeset
253
a61af66fc99e Initial load
duke
parents:
diff changeset
254 endif # ifneq ("${TYPE}", "CORE")