8241902: AIX Build broken after integration of JDK-8223147 (JFR Backport)

Tue, 21 Apr 2020 12:03:29 +0200

author
clanger
date
Tue, 21 Apr 2020 12:03:29 +0200
changeset 9907
35063c223567
parent 9906
0df63a32f7bb
child 9908
0826fcd35939

8241902: AIX Build broken after integration of JDK-8223147 (JFR Backport)
Reviewed-by: mdoerr, apetushkov

make/aix/makefiles/buildtree.make file | annotate | diff | comparison | revisions
make/aix/makefiles/jfr.make file | annotate | diff | comparison | revisions
make/aix/makefiles/top.make file | annotate | diff | comparison | revisions
make/aix/makefiles/vm.make file | annotate | diff | comparison | revisions
src/os/aix/vm/os_perf_aix.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/make/aix/makefiles/buildtree.make	Wed Apr 15 15:19:07 2020 +0200
     1.2 +++ b/make/aix/makefiles/buildtree.make	Tue Apr 21 12:03:29 2020 +0200
     1.3 @@ -1,6 +1,6 @@
     1.4  #
     1.5  # Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
     1.6 -# Copyright 2012, 2013 SAP AG. All rights reserved.
     1.7 +# Copyright (c) 2012, 2020 SAP SE. All rights reserved.
     1.8  # Copyright 2019 Red Hat, Inc.
     1.9  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    1.10  #
    1.11 @@ -49,7 +49,7 @@
    1.12  # flags.make	- with macro settings
    1.13  # vm.make	- to support making "$(MAKE) -v vm.make" in makefiles
    1.14  # adlc.make	-
    1.15 -# trace.make	- generate tracing event and type definitions
    1.16 +# jfr.make	- generate jfr event and type definitions
    1.17  # jvmti.make	- generate JVMTI bindings from the spec (JSR-163)
    1.18  # sa.make	- generate SA jar file and natives
    1.19  #
    1.20 @@ -111,6 +111,10 @@
    1.21  endif
    1.22  endif
    1.23  
    1.24 +ifeq ($(ENABLE_JFR),false)
    1.25 +ALWAYS_EXCLUDE_DIRS += -o -name jfr
    1.26 +endif
    1.27 +
    1.28  # Get things from the platform file.
    1.29  COMPILER	= $(shell sed -n 's/^compiler[ 	]*=[ 	]*//p' $(PLATFORM_FILE))
    1.30  
    1.31 @@ -118,7 +122,7 @@
    1.32  	$(PLATFORM_DIR)/generated/dependencies \
    1.33  	$(PLATFORM_DIR)/generated/adfiles \
    1.34  	$(PLATFORM_DIR)/generated/jvmtifiles \
    1.35 -	$(PLATFORM_DIR)/generated/tracefiles
    1.36 +	$(PLATFORM_DIR)/generated/jfrfiles
    1.37  
    1.38  TARGETS      = debug fastdebug optimized product
    1.39  SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
    1.40 @@ -126,7 +130,7 @@
    1.41  # For dependencies and recursive makes.
    1.42  BUILDTREE_MAKE	= $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
    1.43  
    1.44 -BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make trace.make sa.make
    1.45 +BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make jfr.make sa.make
    1.46  
    1.47  BUILDTREE_VARS	= GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
    1.48  	SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
    1.49 @@ -195,6 +199,12 @@
    1.50  
    1.51  DATA_MODE = $(DATA_MODE/$(BUILDARCH))
    1.52  
    1.53 +ifeq ($(ENABLE_JFR), true)
    1.54 +  INCLUDE_JFR = 1
    1.55 +else
    1.56 +  INCLUDE_JFR = 0
    1.57 +endif
    1.58 +
    1.59  flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
    1.60  	@echo Creating $@ ...
    1.61  	$(QUIETLY) ( \
    1.62 @@ -274,8 +284,7 @@
    1.63  	    echo && \
    1.64  	    echo "HOTSPOT_EXTRA_SYSDEFS\$$(HOTSPOT_EXTRA_SYSDEFS) = $(HOTSPOT_EXTRA_SYSDEFS)" && \
    1.65  	    echo "SYSDEFS += \$$(HOTSPOT_EXTRA_SYSDEFS)"; \
    1.66 -	[ -n "$(INCLUDE_TRACE)" ] && \
    1.67 -	    echo && echo "INCLUDE_TRACE = $(INCLUDE_TRACE)"; \
    1.68 +	echo && echo "CFLAGS += -DINCLUDE_JFR=$(INCLUDE_JFR)"; \
    1.69  	echo; \
    1.70  	[ -n "$(SPEC)" ] && \
    1.71  	    echo "include $(SPEC)"; \
    1.72 @@ -344,7 +353,7 @@
    1.73  	echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
    1.74  	) > $@
    1.75  
    1.76 -trace.make: $(BUILDTREE_MAKE)
    1.77 +jfr.make: $(BUILDTREE_MAKE)
    1.78  	@echo Creating $@ ...
    1.79  	$(QUIETLY) ( \
    1.80  	$(BUILDTREE_COMMENT); \
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/make/aix/makefiles/jfr.make	Tue Apr 21 12:03:29 2020 +0200
     2.3 @@ -0,0 +1,92 @@
     2.4 +#
     2.5 +# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
     2.6 +# Copyright (c) 2020 SAP SE. All rights reserved.
     2.7 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     2.8 +#
     2.9 +# This code is free software; you can redistribute it and/or modify it
    2.10 +# under the terms of the GNU General Public License version 2 only, as
    2.11 +# published by the Free Software Foundation.
    2.12 +#
    2.13 +# This code is distributed in the hope that it will be useful, but WITHOUT
    2.14 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    2.15 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    2.16 +# version 2 for more details (a copy is included in the LICENSE file that
    2.17 +# accompanied this code).
    2.18 +#
    2.19 +# You should have received a copy of the GNU General Public License version
    2.20 +# 2 along with this work; if not, write to the Free Software Foundation,
    2.21 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    2.22 +#
    2.23 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    2.24 +# or visit www.oracle.com if you need additional information or have any
    2.25 +# questions.
    2.26 +#
    2.27 +#
    2.28 +
    2.29 +# This makefile (jfr.make) is included from the jfr.make in the
    2.30 +# build directories.
    2.31 +#
    2.32 +# It knows how to build and run the tools to generate jfr.
    2.33 +
    2.34 +include $(GAMMADIR)/make/linux/makefiles/rules.make
    2.35 +
    2.36 +# #########################################################################
    2.37 +# Build tools needed for the Jfr source code generation
    2.38 +
    2.39 +TOPDIR      = $(shell echo `pwd`)
    2.40 +GENERATED   = $(TOPDIR)/../generated
    2.41 +
    2.42 +JFR_TOOLS_SRCDIR := $(GAMMADIR)/src/share/vm/jfr
    2.43 +JFR_TOOLS_OUTPUTDIR := $(GENERATED)/tools/jfr
    2.44 +
    2.45 +JFR_OUTPUTDIR := $(GENERATED)/jfrfiles
    2.46 +JFR_SRCDIR := $(GAMMADIR)/src/share/vm/jfr/metadata
    2.47 +
    2.48 +METADATA_XML ?= $(JFR_SRCDIR)/metadata.xml
    2.49 +METADATA_XSD ?= $(JFR_SRCDIR)/metadata.xsd
    2.50 +
    2.51 +# Changing these will trigger a rebuild of generated jfr files.
    2.52 +JFR_DEPS += \
    2.53 +    $(METADATA_XML) \
    2.54 +    $(METADATA_XSD) \
    2.55 +    #
    2.56 +
    2.57 +JfrGeneratedNames = \
    2.58 +	jfrEventClasses.hpp \
    2.59 +	jfrEventControl.hpp \
    2.60 +	jfrEventIds.hpp \
    2.61 +	jfrPeriodic.hpp \
    2.62 +	jfrTypes.hpp
    2.63 +
    2.64 +JfrGenSource = $(JFR_TOOLS_SRCDIR)/GenerateJfrFiles.java
    2.65 +JfrGenClass = $(JFR_TOOLS_OUTPUTDIR)/build/tools/jfr/GenerateJfrFiles.class
    2.66 +
    2.67 +JfrGeneratedFiles = $(JfrGeneratedNames:%=$(JFR_OUTPUTDIR/%)
    2.68 +
    2.69 +.PHONY: all clean cleanall
    2.70 +
    2.71 +# #########################################################################
    2.72 +
    2.73 +all: $(JfrGeneratedFiles)
    2.74 +
    2.75 +$(JfrGenClass): $(JfrGenSource)
    2.76 +	mkdir -p $(@D)
    2.77 +	$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -d $(JFR_TOOLS_OUTPUTDIR) $(JfrGenSource)
    2.78 +
    2.79 +$(JFR_OUTPUTDIR)/jfrEventClasses.hpp: $(METADATA_XML) $(METADATA_XSD) $(JfrGenClass)
    2.80 +	$(QUIETLY) echo Generating $(@F)
    2.81 +	mkdir -p $(@D)
    2.82 +	$(QUIETLY) $(REMOTE) $(RUN.JAVA) -cp $(JFR_TOOLS_OUTPUTDIR) build.tools.jfr.GenerateJfrFiles $(METADATA_XML) $(METADATA_XSD) $(JFR_OUTPUTDIR)
    2.83 +	test -f $@
    2.84 +
    2.85 +$(filter-out $(JFR_OUTPUTDIR)/jfrEventClasses.hpp, $(JfrGeneratedFiles)): $(JFR_OUTPUTDIR)/jfrEventClasses.hpp
    2.86 +
    2.87 +TARGETS += $(JFR_OUTPUTDIR)/jfrEventClasses.hpp
    2.88 +
    2.89 +# #########################################################################
    2.90 +
    2.91 +clean cleanall :
    2.92 +	rm $(JfrGenClass) $(JfrGeneratedFiles)
    2.93 +
    2.94 +# #########################################################################
    2.95 +
     3.1 --- a/make/aix/makefiles/top.make	Wed Apr 15 15:19:07 2020 +0200
     3.2 +++ b/make/aix/makefiles/top.make	Tue Apr 21 12:03:29 2020 +0200
     3.3 @@ -1,5 +1,5 @@
     3.4  #
     3.5 -# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
     3.6 +# Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
     3.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3.8  #
     3.9  # This code is free software; you can redistribute it and/or modify it
    3.10 @@ -80,7 +80,7 @@
    3.11  	@echo All done.
    3.12  
    3.13  # This is an explicit dependency for the sake of parallel makes.
    3.14 -vm_build_preliminaries:  checks $(Cached_plat) $(AD_Files_If_Required) trace_stuff jvmti_stuff sa_stuff
    3.15 +vm_build_preliminaries:  checks $(Cached_plat) $(AD_Files_If_Required) jfr_stuff jvmti_stuff sa_stuff
    3.16  	@# We need a null action here, so implicit rules don't get consulted.
    3.17  
    3.18  $(Cached_plat): $(Plat_File)
    3.19 @@ -94,9 +94,9 @@
    3.20  jvmti_stuff: $(Cached_plat) $(adjust-mflags)
    3.21  	@$(MAKE) -f jvmti.make $(MFLAGS-adjusted)
    3.22  
    3.23 -# generate trace files
    3.24 -trace_stuff: jvmti_stuff $(Cached_plat) $(adjust-mflags)
    3.25 -	@$(MAKE) -f trace.make $(MFLAGS-adjusted)
    3.26 +# generate JFR files
    3.27 +jfr_stuff: $(Cached_plat) $(adjust-mflags)
    3.28 +	@$(MAKE) -f jfr.make $(MFLAGS-adjusted)
    3.29  
    3.30  # generate SA jar files and native header
    3.31  sa_stuff:
     4.1 --- a/make/aix/makefiles/vm.make	Wed Apr 15 15:19:07 2020 +0200
     4.2 +++ b/make/aix/makefiles/vm.make	Tue Apr 21 12:03:29 2020 +0200
     4.3 @@ -1,6 +1,6 @@
     4.4  #
     4.5  # Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
     4.6 -# Copyright 2012, 2013 SAP AG. All rights reserved.
     4.7 +# Copyright (c) 2012, 2020 SAP SE. All rights reserved.
     4.8  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.9  #
    4.10  # This code is free software; you can redistribute it and/or modify it
    4.11 @@ -53,7 +53,7 @@
    4.12  # Src_Dirs_V is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
    4.13  # The adfiles directory contains ad_<arch>.[ch]pp.
    4.14  # The jvmtifiles directory contains jvmti*.[ch]pp
    4.15 -Src_Dirs_V += $(GENERATED)/adfiles $(GENERATED)/jvmtifiles $(GENERATED)/tracefiles
    4.16 +Src_Dirs_V += $(GENERATED)/adfiles $(GENERATED)/jvmtifiles $(GENERATED)/jfrfiles
    4.17  VPATH += $(Src_Dirs_V:%=%:)
    4.18  
    4.19  # set INCLUDES for C preprocessor.
    4.20 @@ -147,24 +147,22 @@
    4.21  LIBJVM_DEBUGINFO   = lib$(JVM).debuginfo
    4.22  LIBJVM_DIZ         = lib$(JVM).diz
    4.23  
    4.24 +ifeq ($(ENABLE_JFR),false)
    4.25 +EXCLUDE_JFR_PATHS:= -o -name jfr -prune
    4.26 +endif
    4.27 +
    4.28  SPECIAL_PATHS:=adlc c1 gc_implementation opto shark libadt
    4.29  
    4.30  SOURCE_PATHS=\
    4.31    $(shell find $(HS_COMMON_SRC)/share/vm/* -type d \! \
    4.32 -      \( -name DUMMY $(foreach dir,$(SPECIAL_PATHS),-o -name $(dir)) \))
    4.33 +      \( -name DUMMY $(foreach dir,$(SPECIAL_PATHS),-o -name $(dir)) $(EXCLUDE_JFR_PATHS) \))
    4.34  SOURCE_PATHS+=$(HS_COMMON_SRC)/os/$(Platform_os_family)/vm
    4.35  SOURCE_PATHS+=$(HS_COMMON_SRC)/os/posix/vm
    4.36  SOURCE_PATHS+=$(HS_COMMON_SRC)/cpu/$(SRCARCH)/vm
    4.37  SOURCE_PATHS+=$(HS_COMMON_SRC)/os_cpu/$(Platform_os_family)_$(SRCARCH)/vm
    4.38  
    4.39  CORE_PATHS=$(foreach path,$(SOURCE_PATHS),$(call altsrc,$(path)) $(path))
    4.40 -CORE_PATHS+=$(GENERATED)/jvmtifiles $(GENERATED)/tracefiles
    4.41 -
    4.42 -ifneq ($(INCLUDE_TRACE), false)
    4.43 -CORE_PATHS+=$(shell if [ -d $(HS_ALT_SRC)/share/vm/jfr ]; then \
    4.44 -  find $(HS_ALT_SRC)/share/vm/jfr -type d; \
    4.45 -  fi)
    4.46 -endif
    4.47 +CORE_PATHS+=$(GENERATED)/jvmtifiles $(GENERATED)/jfrfiles
    4.48  
    4.49  COMPILER1_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/c1)
    4.50  COMPILER1_PATHS += $(HS_COMMON_SRC)/share/vm/c1
     5.1 --- a/src/os/aix/vm/os_perf_aix.cpp	Wed Apr 15 15:19:07 2020 +0200
     5.2 +++ b/src/os/aix/vm/os_perf_aix.cpp	Tue Apr 21 12:03:29 2020 +0200
     5.3 @@ -1,5 +1,6 @@
     5.4  /*
     5.5   * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
     5.6 + * Copyright (c) 2020 SAP SE. All rights reserved.
     5.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5.8   *
     5.9   * This code is free software; you can redistribute it and/or modify it
    5.10 @@ -28,8 +29,7 @@
    5.11  #include "os_aix.inline.hpp"
    5.12  #include "runtime/os.hpp"
    5.13  #include "runtime/os_perf.hpp"
    5.14 -
    5.15 -#include CPU_HEADER(vm_version_ext)
    5.16 +#include "vm_version_ext_ppc.hpp"
    5.17  
    5.18  #include <stdio.h>
    5.19  #include <stdarg.h>
    5.20 @@ -179,32 +179,6 @@
    5.21  
    5.22  */
    5.23  
    5.24 -/**
    5.25 - * For platforms that have them, when declaring
    5.26 - * a printf-style function,
    5.27 - *   formatSpec is the parameter number (starting at 1)
    5.28 - *       that is the format argument ("%d pid %s")
    5.29 - *   params is the parameter number where the actual args to
    5.30 - *       the format starts. If the args are in a va_list, this
    5.31 - *       should be 0.
    5.32 - */
    5.33 -#ifndef PRINTF_ARGS
    5.34 -#  define PRINTF_ARGS(formatSpec,  params) ATTRIBUTE_PRINTF(formatSpec, params)
    5.35 -#endif
    5.36 -
    5.37 -#ifndef SCANF_ARGS
    5.38 -#  define SCANF_ARGS(formatSpec,   params) ATTRIBUTE_SCANF(formatSpec, params)
    5.39 -#endif
    5.40 -
    5.41 -#ifndef _PRINTFMT_
    5.42 -#  define _PRINTFMT_
    5.43 -#endif
    5.44 -
    5.45 -#ifndef _SCANFMT_
    5.46 -#  define _SCANFMT_
    5.47 -#endif
    5.48 -
    5.49 -
    5.50  struct CPUPerfTicks {
    5.51    uint64_t  used;
    5.52    uint64_t  usedKernel;
    5.53 @@ -234,7 +208,7 @@
    5.54  /** reads /proc/<pid>/stat data, with some checks and some skips.
    5.55   *  Ensure that 'fmt' does _NOT_ contain the first two "%d %s"
    5.56   */
    5.57 -static int SCANF_ARGS(2, 0) vread_statdata(const char* procfile, _SCANFMT_ const char* fmt, va_list args) {
    5.58 +static int vread_statdata(const char* procfile, const char* fmt, va_list args) {
    5.59    FILE*f;
    5.60    int n;
    5.61    char buf[2048];
    5.62 @@ -263,7 +237,7 @@
    5.63    return n;
    5.64  }
    5.65  
    5.66 -static int SCANF_ARGS(2, 3) read_statdata(const char* procfile, _SCANFMT_ const char* fmt, ...) {
    5.67 +static int read_statdata(const char* procfile, const char* fmt, ...) {
    5.68    int   n;
    5.69    va_list args;
    5.70  
    5.71 @@ -472,7 +446,7 @@
    5.72    return user_load;
    5.73  }
    5.74  
    5.75 -static int SCANF_ARGS(1, 2) parse_stat(_SCANFMT_ const char* fmt, ...) {
    5.76 +static int parse_stat(const char* fmt, ...) {
    5.77    FILE *f;
    5.78    va_list args;
    5.79  
    5.80 @@ -609,7 +583,7 @@
    5.81  
    5.82  CPUPerformanceInterface::CPUPerformance::~CPUPerformance() {
    5.83    if (_counters.cpus != NULL) {
    5.84 -    FREE_C_HEAP_ARRAY(char, _counters.cpus);
    5.85 +    FREE_C_HEAP_ARRAY(char, _counters.cpus, mtInternal);
    5.86    }
    5.87  }
    5.88  
    5.89 @@ -886,7 +860,7 @@
    5.90    cmdline = get_cmdline();
    5.91    if (cmdline != NULL) {
    5.92      process_info->set_command_line(allocate_string(cmdline));
    5.93 -    FREE_C_HEAP_ARRAY(char, cmdline);
    5.94 +    FREE_C_HEAP_ARRAY(char, cmdline, mtInternal);
    5.95    }
    5.96  
    5.97    return OS_OK;
    5.98 @@ -1011,12 +985,12 @@
    5.99    if (_cpu_info != NULL) {
   5.100      if (_cpu_info->cpu_name() != NULL) {
   5.101        const char* cpu_name = _cpu_info->cpu_name();
   5.102 -      FREE_C_HEAP_ARRAY(char, cpu_name);
   5.103 +      FREE_C_HEAP_ARRAY(char, cpu_name, mtInternal);
   5.104        _cpu_info->set_cpu_name(NULL);
   5.105      }
   5.106      if (_cpu_info->cpu_description() != NULL) {
   5.107         const char* cpu_desc = _cpu_info->cpu_description();
   5.108 -       FREE_C_HEAP_ARRAY(char, cpu_desc);
   5.109 +       FREE_C_HEAP_ARRAY(char, cpu_desc, mtInternal);
   5.110        _cpu_info->set_cpu_description(NULL);
   5.111      }
   5.112      delete _cpu_info;

mercurial