hotspot/make/linux/makefiles/dtrace.make
author lana
Mon, 04 Aug 2014 15:34:37 -0700
changeset 25745 3a55fad9854a
parent 25471 3ab9867d7786
child 26691 40ea2c41f53b
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
#
13958
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
     2
# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
     3
# Copyright (c) 2012 Red Hat, Inc.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
# This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
# under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
# published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
# This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
# version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
# accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
# You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
# 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
#
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 670
diff changeset
    20
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 670
diff changeset
    21
# or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 670
diff changeset
    22
# questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
#  
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
# Linux does not build jvm_db
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
LIBJVM_DB =
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
13958
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    29
# Only OPENJDK builds test and support SDT probes currently.
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    30
ifndef OPENJDK
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    31
REASON = "This JDK does not support SDT probes"
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    32
else
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    33
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    34
# We need a recent GCC for the default
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    35
ifeq "$(shell expr \( $(CC_VER_MAJOR) \>= 4 \) \& \( $(CC_VER_MINOR) \>= 4 \) )" "0"
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    36
REASON = "gcc version is too old"
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    37
else
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    38
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    39
# But it does have a SystemTap dtrace compatible sys/sdt.h
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    40
ifneq ($(ALT_SDT_H),)
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    41
  SDT_H_FILE = $(ALT_SDT_H)
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    42
else
25471
3ab9867d7786 8046818: Hotspot build system looking for sdt.h in the wrong place
mikael
parents: 22736
diff changeset
    43
  ifeq ($(USE_CLANG), true)
3ab9867d7786 8046818: Hotspot build system looking for sdt.h in the wrong place
mikael
parents: 22736
diff changeset
    44
    # Clang doesn't support the -print-sysroot option and there is no known equivalent
3ab9867d7786 8046818: Hotspot build system looking for sdt.h in the wrong place
mikael
parents: 22736
diff changeset
    45
    # option, so fall back to using / as sysroot
3ab9867d7786 8046818: Hotspot build system looking for sdt.h in the wrong place
mikael
parents: 22736
diff changeset
    46
    SDT_SYSROOT=
3ab9867d7786 8046818: Hotspot build system looking for sdt.h in the wrong place
mikael
parents: 22736
diff changeset
    47
  else
3ab9867d7786 8046818: Hotspot build system looking for sdt.h in the wrong place
mikael
parents: 22736
diff changeset
    48
    SDT_SYSROOT=$(shell $(CXX) -print-sysroot)
3ab9867d7786 8046818: Hotspot build system looking for sdt.h in the wrong place
mikael
parents: 22736
diff changeset
    49
  endif
3ab9867d7786 8046818: Hotspot build system looking for sdt.h in the wrong place
mikael
parents: 22736
diff changeset
    50
  SDT_H_FILE = $(SDT_SYSROOT)/usr/include/sys/sdt.h
13958
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    51
endif
22736
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    52
13958
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    53
DTRACE_ENABLED = $(shell test -f $(SDT_H_FILE) && echo $(SDT_H_FILE))
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    54
REASON = "$(SDT_H_FILE) not found"
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    55
22736
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    56
endif # GCC version
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    57
endif # OPENJDK
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    58
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    59
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    60
DTRACE_COMMON_SRCDIR = $(GAMMADIR)/src/os/posix/dtrace
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    61
DTRACE_PROG = dtrace
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    62
DtraceOutDir = $(GENERATED)/dtracefiles
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    63
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    64
$(DtraceOutDir):
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    65
	mkdir $(DtraceOutDir)
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    66
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    67
$(DtraceOutDir)/hotspot.h: $(DTRACE_COMMON_SRCDIR)/hotspot.d | $(DtraceOutDir)
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    68
	$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hotspot.d
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    69
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    70
$(DtraceOutDir)/hotspot_jni.h: $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d | $(DtraceOutDir)
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    71
	$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    72
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    73
$(DtraceOutDir)/hs_private.h: $(DTRACE_COMMON_SRCDIR)/hs_private.d | $(DtraceOutDir)
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    74
	$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hs_private.d
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    75
13958
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    76
ifneq ($(DTRACE_ENABLED),)
22736
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    77
CFLAGS += -DDTRACE_ENABLED
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    78
dtrace_gen_headers: $(DtraceOutDir)/hotspot.h $(DtraceOutDir)/hotspot_jni.h $(DtraceOutDir)/hs_private.h
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    79
else
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    80
dtrace_gen_headers:
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    81
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled: $(REASON)"
13958
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    82
endif
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    83
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    84
# Phony target used in vm.make build target to check whether enabled.
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    85
ifeq ($(DTRACE_ENABLED),)
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    86
dtraceCheck:
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    87
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled: $(REASON)"
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    88
else
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    89
dtraceCheck:
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    90
endif
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    91
22736
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    92
.PHONY: dtrace_gen_headers dtraceCheck
6c317cced072 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents: 13958
diff changeset
    93
13958
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    94
# It doesn't support HAVE_DTRACE_H though.
f5598a86c223 7170638: Use DTRACE_PROBE[N] in JNI Set and SetStatic Field.
coleenp
parents: 5547
diff changeset
    95