author | ctornqvi |
Tue, 09 Jan 2018 16:52:25 -0500 | |
changeset 48624 | 5f86c562a39e |
parent 48096 | 513e0b467a92 |
child 48677 | 62b6e9b1dfdc |
permissions | -rw-r--r-- |
1 | 1 |
# |
48624
5f86c562a39e
8194636: Apply CONCURRENCY_FACTOR to max value in concurrency calculation
ctornqvi
parents:
48096
diff
changeset
|
2 |
# Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
# |
|
5 |
# This code is free software; you can redistribute it and/or modify it |
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
|
42429 | 7 |
# published by the Free Software Foundation. Oracle designates this |
8 |
# particular file as subject to the "Classpath" exception as provided |
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
|
1 | 10 |
# |
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
2868
diff
changeset
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
2868
diff
changeset
|
22 |
# or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
2868
diff
changeset
|
23 |
# questions. |
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
24 |
# |
1 | 25 |
# |
26 |
||
42429 | 27 |
NATIVE_TEST_PATH := hotspot/jtreg/native |
1 | 28 |
|
42429 | 29 |
TREAT_EXIT_CODE_1_AS_0 := true |
27695 | 30 |
|
42429 | 31 |
CLEAN_BEFORE_PREP := true |
12225 | 32 |
|
42429 | 33 |
USE_JTREG_VERSION := 4.1 |
34 |
||
35 |
USE_JTREG_ASSERT := false |
|
25628 | 36 |
|
42429 | 37 |
LIMIT_JTREG_VM_MEMORY := false |
38255
5784bccf53b0
8148244: Finalize and integrate GTest implementation
iignatyev
parents:
37299
diff
changeset
|
38 |
|
42429 | 39 |
IGNORE_MARKED_TESTS := true |
38255
5784bccf53b0
8148244: Finalize and integrate GTest implementation
iignatyev
parents:
37299
diff
changeset
|
40 |
|
25628 | 41 |
# Get OS name from uname (Cygwin inexplicably adds _NT-5.1) |
42429 | 42 |
UNAME_S := $(shell uname -s | cut -f1 -d_) |
43 |
||
25628 | 44 |
ifeq ($(UNAME_S), SunOS) |
41720
93c64aa0b62f
8166738: Enable concurrency in Hotspot jtreg testing
ctornqvi
parents:
40346
diff
changeset
|
45 |
NUM_CORES := $(shell LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line) |
1 | 46 |
endif |
25628 | 47 |
ifeq ($(UNAME_S), Linux) |
41720
93c64aa0b62f
8166738: Enable concurrency in Hotspot jtreg testing
ctornqvi
parents:
40346
diff
changeset
|
48 |
NUM_CORES := $(shell cat /proc/cpuinfo | grep -c processor) |
1 | 49 |
endif |
25628 | 50 |
ifeq ($(UNAME_S), Darwin) |
41720
93c64aa0b62f
8166738: Enable concurrency in Hotspot jtreg testing
ctornqvi
parents:
40346
diff
changeset
|
51 |
NUM_CORES := $(shell /usr/sbin/sysctl -n hw.ncpu) |
10565 | 52 |
endif |
42429 | 53 |
ifeq ($(findstring CYGWIN,$(UNAME_S)), CYGWIN) |
41720
93c64aa0b62f
8166738: Enable concurrency in Hotspot jtreg testing
ctornqvi
parents:
40346
diff
changeset
|
54 |
ifneq ($(NUMBER_OF_PROCESSORS), ) |
93c64aa0b62f
8166738: Enable concurrency in Hotspot jtreg testing
ctornqvi
parents:
40346
diff
changeset
|
55 |
NUM_CORES := $(NUMBER_OF_PROCESSORS) |
93c64aa0b62f
8166738: Enable concurrency in Hotspot jtreg testing
ctornqvi
parents:
40346
diff
changeset
|
56 |
else |
93c64aa0b62f
8166738: Enable concurrency in Hotspot jtreg testing
ctornqvi
parents:
40346
diff
changeset
|
57 |
ifneq ($(HOTSPOT_BUILD_JOBS), ) |
93c64aa0b62f
8166738: Enable concurrency in Hotspot jtreg testing
ctornqvi
parents:
40346
diff
changeset
|
58 |
NUM_CORES := $(HOTSPOT_BUILD_JOBS) |
42429 | 59 |
else |
60 |
NUM_CORES := 1 # fallback |
|
41720
93c64aa0b62f
8166738: Enable concurrency in Hotspot jtreg testing
ctornqvi
parents:
40346
diff
changeset
|
61 |
endif |
93c64aa0b62f
8166738: Enable concurrency in Hotspot jtreg testing
ctornqvi
parents:
40346
diff
changeset
|
62 |
endif |
1 | 63 |
endif |
64 |
||
48096
513e0b467a92
8191768: Introduce a concurrency factor to be able to scale up or down jtreg concurrency when running Hotspot tests
ctornqvi
parents:
47218
diff
changeset
|
65 |
ifndef CONCURRENCY_FACTOR |
513e0b467a92
8191768: Introduce a concurrency factor to be able to scale up or down jtreg concurrency when running Hotspot tests
ctornqvi
parents:
47218
diff
changeset
|
66 |
CONCURRENCY_FACTOR = 1 |
513e0b467a92
8191768: Introduce a concurrency factor to be able to scale up or down jtreg concurrency when running Hotspot tests
ctornqvi
parents:
47218
diff
changeset
|
67 |
endif |
513e0b467a92
8191768: Introduce a concurrency factor to be able to scale up or down jtreg concurrency when running Hotspot tests
ctornqvi
parents:
47218
diff
changeset
|
68 |
|
48624
5f86c562a39e
8194636: Apply CONCURRENCY_FACTOR to max value in concurrency calculation
ctornqvi
parents:
48096
diff
changeset
|
69 |
# Concurrency based on min(cores / 2, 12) * CONCURRENCY_FACTOR |
5f86c562a39e
8194636: Apply CONCURRENCY_FACTOR to max value in concurrency calculation
ctornqvi
parents:
48096
diff
changeset
|
70 |
CONCURRENCY := $(shell awk \ |
5f86c562a39e
8194636: Apply CONCURRENCY_FACTOR to max value in concurrency calculation
ctornqvi
parents:
48096
diff
changeset
|
71 |
'BEGIN { \ |
5f86c562a39e
8194636: Apply CONCURRENCY_FACTOR to max value in concurrency calculation
ctornqvi
parents:
48096
diff
changeset
|
72 |
c = $(NUM_CORES) / 2; \ |
5f86c562a39e
8194636: Apply CONCURRENCY_FACTOR to max value in concurrency calculation
ctornqvi
parents:
48096
diff
changeset
|
73 |
if (c > 12) c = 12; \ |
5f86c562a39e
8194636: Apply CONCURRENCY_FACTOR to max value in concurrency calculation
ctornqvi
parents:
48096
diff
changeset
|
74 |
c = c * $(CONCURRENCY_FACTOR); \ |
5f86c562a39e
8194636: Apply CONCURRENCY_FACTOR to max value in concurrency calculation
ctornqvi
parents:
48096
diff
changeset
|
75 |
if (c < 1) c = 1; \ |
5f86c562a39e
8194636: Apply CONCURRENCY_FACTOR to max value in concurrency calculation
ctornqvi
parents:
48096
diff
changeset
|
76 |
printf "%.0f", c; \ |
5f86c562a39e
8194636: Apply CONCURRENCY_FACTOR to max value in concurrency calculation
ctornqvi
parents:
48096
diff
changeset
|
77 |
}') |
37299
db3b0d4c3bda
8149777: Enable enhanced failure handler for "make test"
erikj
parents:
35526
diff
changeset
|
78 |
|
47100
17953cf82d51
8186248: Allow more flexibility in selecting Heap % of available RAM
bobv
parents:
46570
diff
changeset
|
79 |
# Make sure MaxRAMPercentage is high enough to not cause OOM or swapping since we may end up with a lot of JVM's |
17953cf82d51
8186248: Allow more flexibility in selecting Heap % of available RAM
bobv
parents:
46570
diff
changeset
|
80 |
JTREG_BASIC_OPTIONS += -vmoption:-XX:MaxRAMPercentage=$(shell expr 25 / $(CONCURRENCY)) |
25628 | 81 |
|
42429 | 82 |
# Include the common base file with most of the logic |
47218 | 83 |
include ../../TestCommon.gmk |
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
84 |
|
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
85 |
################################################################ |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
86 |
# Default make rule (runs jtreg_tests) |
25628 | 87 |
all: hotspot_all |
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
88 |
@$(ECHO) "Testing completed successfully" |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
89 |
|
25628 | 90 |
# Support "hotspot_" prefixed test make targets (too) |
91 |
# The hotspot_% targets are used by the top level Makefile |
|
92 |
# Unless explicitly defined below, hotspot_<x> is interpreted as a jtreg test group name |
|
24433
492c1fb41098
8042804: Support invoking Hotspot tests from top level
mikael
parents:
22234
diff
changeset
|
93 |
hotspot_%: |
25628 | 94 |
$(ECHO) "Running tests: $@" |
95 |
$(MAKE) -j 1 TEST_SELECTION=":$@" UNIQUE_DIR=$@ jtreg_tests; |
|
24433
492c1fb41098
8042804: Support invoking Hotspot tests from top level
mikael
parents:
22234
diff
changeset
|
96 |
|
33588
13edf132ffa0
8139256: Add Makefile target to run internal VM tests
ehelin
parents:
30595
diff
changeset
|
97 |
hotspot_internal: |
13edf132ffa0
8139256: Add Makefile target to run internal VM tests
ehelin
parents:
30595
diff
changeset
|
98 |
$(ALT_OUTPUTDIR)/jdk/bin/java -XX:+ExecuteInternalVMTests -XX:+ShowMessageBoxOnError -version |
13edf132ffa0
8139256: Add Makefile target to run internal VM tests
ehelin
parents:
30595
diff
changeset
|
99 |
|
1132
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
100 |
################################################################ |
915051915ce9
6745363: Add ability to run packtest to hotspot/test/makefile
ohair
parents:
1
diff
changeset
|
101 |
|
30267 | 102 |
# Set up the directory in which the jvm directories live (client/, server/, etc.) |
103 |
ifeq ($(PLATFORM),windows) |
|
104 |
JVMS_DIR := $(PRODUCT_HOME)/bin |
|
42633
0c23e9d8fccf
8066474: Remove the lib/ directory from Linux and Solaris images
erikj
parents:
42045
diff
changeset
|
105 |
else |
30267 | 106 |
JVMS_DIR := $(PRODUCT_HOME)/lib |
107 |
endif |
|
108 |
||
109 |
# Use the existance of a directory as a sign that jvm variant is available |
|
110 |
CANDIDATE_JVM_VARIANTS := client minimal server |
|
111 |
JVM_VARIANTS := $(strip $(foreach x,$(CANDIDATE_JVM_VARIANTS),$(if $(wildcard $(JVMS_DIR)/$(x)),$(x)))) |
|
112 |
||
2868
051eb4af737f
6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents:
2105
diff
changeset
|
113 |
################################################################ |
051eb4af737f
6839151: Add a JPRT default test of -Xshare:dump when new hotspot is built
ohair
parents:
2105
diff
changeset
|
114 |
|
38255
5784bccf53b0
8148244: Finalize and integrate GTest implementation
iignatyev
parents:
37299
diff
changeset
|
115 |
# Run the native gtest tests from the test image |
5784bccf53b0
8148244: Finalize and integrate GTest implementation
iignatyev
parents:
37299
diff
changeset
|
116 |
|
42429 | 117 |
define NEWLINE |
118 |
||
119 |
||
120 |
endef |
|
121 |
||
122 |
||
38255
5784bccf53b0
8148244: Finalize and integrate GTest implementation
iignatyev
parents:
37299
diff
changeset
|
123 |
hotspot_gtest: |
5784bccf53b0
8148244: Finalize and integrate GTest implementation
iignatyev
parents:
37299
diff
changeset
|
124 |
$(foreach v, $(JVM_VARIANTS), \ |
5784bccf53b0
8148244: Finalize and integrate GTest implementation
iignatyev
parents:
37299
diff
changeset
|
125 |
$(MAKE) hotspot_gtest$v $(NEWLINE) ) |
5784bccf53b0
8148244: Finalize and integrate GTest implementation
iignatyev
parents:
37299
diff
changeset
|
126 |
|
5784bccf53b0
8148244: Finalize and integrate GTest implementation
iignatyev
parents:
37299
diff
changeset
|
127 |
hotspot_gtestserver hotspot_gtestclient hotspot_gtestminimal: hotspot_gtest%: |
5784bccf53b0
8148244: Finalize and integrate GTest implementation
iignatyev
parents:
37299
diff
changeset
|
128 |
$(TESTNATIVE_DIR)/hotspot/gtest/$*/gtestLauncher \ |
5784bccf53b0
8148244: Finalize and integrate GTest implementation
iignatyev
parents:
37299
diff
changeset
|
129 |
-jdk $(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") |
5784bccf53b0
8148244: Finalize and integrate GTest implementation
iignatyev
parents:
37299
diff
changeset
|
130 |
|
5784bccf53b0
8148244: Finalize and integrate GTest implementation
iignatyev
parents:
37299
diff
changeset
|
131 |
PHONY_LIST += hotspot_gtest hotspot_gtestserver hotspot_gtestclient \ |
5784bccf53b0
8148244: Finalize and integrate GTest implementation
iignatyev
parents:
37299
diff
changeset
|
132 |
hotspot_gtestminimal |