Skip to content

Commit

Permalink
Added new malloc trace for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
schmelter-sap committed Jul 8, 2024
1 parent dd32edf commit 28fe6ca
Show file tree
Hide file tree
Showing 20 changed files with 5,236 additions and 0 deletions.
13 changes: 13 additions & 0 deletions make/copy/Copy-java.base.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,16 @@ $(eval $(call SetupTextFileProcessing, CREATE_CLASSFILE_CONSTANTS_H, \
TARGETS += $(CREATE_CLASSFILE_CONSTANTS_H)

################################################################################
# SapMachine 2023-11-28: Copy mallochook.h

ifeq ($(call isTargetOs, linux macosx), true)

$(eval $(call SetupCopyFiles, CREATE_MALLOC_HOOKS_H, \
FILES := $(TOPDIR)/src/java.base/unix/native/libmallochooks/mallochooks.h, \
DEST := $(SUPPORT_OUTPUTDIR)/modules_include/java.base/, \
))

TARGETS += $(CREATE_MALLOC_HOOKS_H)
endif

################################################################################
15 changes: 15 additions & 0 deletions make/lib/CoreLibraries.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -281,3 +281,18 @@ ifeq ($(call isTargetOs, aix), true)
TARGETS += $(BUILD_LIBJLI_STATIC)

endif

# SapMachine 2023-11-28: build libmallochooks

ifeq ($(call isTargetOs, linux macosx), true)
$(eval $(call SetupJdkLibrary, BUILD_LIBMALLOCHOOKS, \
NAME := mallochooks, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB), \
LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN), \
LIBS := -ldl, \
))

TARGETS += $(BUILD_LIBMALLOCHOOKS)
endif
3 changes: 3 additions & 0 deletions make/test/JtregNativeHotspot.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,9 @@ ifeq ($(call isTargetOs, linux), true)
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exestack-gap := -ljvm -lpthread
BUILD_TEST_exeinvoke_exeinvoke.c_OPTIMIZATION := NONE
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exeFPRegs := -ldl
# SapMachine 2023-10-04: Added link flags for malloc hooks tests
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exetestmallochooks := -ldl
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libtestmallochooks := -ldl
else
BUILD_HOTSPOT_JTREG_EXCLUDE += libtest-rw.c libtest-rwx.c libTestJNI.c \
exeinvoke.c exestack-gap.c
Expand Down
Loading

0 comments on commit 28fe6ca

Please sign in to comment.