test/testlibrary/ctw/README

Thu, 26 Jul 2018 06:16:09 -0400

author
vaibhav
date
Thu, 26 Jul 2018 06:16:09 -0400
changeset 9421
6cfec782c42c
parent 7894
599c27e30262
permissions
-rw-r--r--

8189762: [TESTBUG] Create tests for JDK-8146115 container awareness and resource configuration
Summary: Created tests for the feature
Reviewed-by: mseledtsov

tschatzl@7894 1
tschatzl@7894 2 Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
tschatzl@7894 3 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
tschatzl@7894 4
tschatzl@7894 5 This code is free software; you can redistribute it and/or modify it
tschatzl@7894 6 under the terms of the GNU General Public License version 2 only, as
tschatzl@7894 7 published by the Free Software Foundation.
tschatzl@7894 8
tschatzl@7894 9 This code is distributed in the hope that it will be useful, but WITHOUT
tschatzl@7894 10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
tschatzl@7894 11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
tschatzl@7894 12 version 2 for more details (a copy is included in the LICENSE file that
tschatzl@7894 13 accompanied this code).
tschatzl@7894 14
tschatzl@7894 15 You should have received a copy of the GNU General Public License version
tschatzl@7894 16 2 along with this work; if not, write to the Free Software Foundation,
tschatzl@7894 17 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
tschatzl@7894 18
tschatzl@7894 19 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
tschatzl@7894 20 or visit www.oracle.com if you need additional information or have any
tschatzl@7894 21 questions.
tschatzl@7894 22
tschatzl@7894 23
aoqi@0 24
aoqi@0 25 DESCRIPTION
aoqi@0 26
aoqi@0 27 This is replacement for CompileTheWorld (CTW) written on java. Its purpose is
aoqi@0 28 to make possible the use of CTW in product builds.
aoqi@0 29
aoqi@0 30 DEPENDENCES
aoqi@0 31
aoqi@0 32 The tool depends on Whitebox API. Assumed, that the sources of whitebox are
aoqi@0 33 located in '../whitebox' directory.
aoqi@0 34
aoqi@0 35 BUILDING
aoqi@0 36
aoqi@0 37 Simple way to build, just type 'make'.
aoqi@0 38
aoqi@0 39 Makefile uses environment variables 'ALT_BOOTDIR', 'BOOTDIR' as root-dir of jdk
aoqi@0 40 that will be used for compilation and creating jar.
aoqi@0 41
aoqi@0 42 On successful building 'ctw.jar' will be created.
aoqi@0 43
aoqi@0 44 RUNNING
aoqi@0 45
aoqi@0 46 Since the tool uses WhiteBox API, options 'UnlockDiagnosticVMOptions' and
aoqi@0 47 'WhiteBoxAPI' should be specified, and 'wb.jar' should be added to
aoqi@0 48 boot-classpath:
aoqi@0 49 $ java -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:wb.jar -jar ctw.jar
aoqi@0 50
aoqi@0 51 Arguments can be paths to '.jar, '.zip', '.lst' files or directories with
aoqi@0 52 classes, that define which classes will be compiled:
aoqi@0 53 - '.jar', '.zip' files and directories are interpreted like in classpath
aoqi@0 54 (including '<dir>/*' syntax)
aoqi@0 55 - '.lst' files -- files with class names (in java notation) to compile.
aoqi@0 56 CTW will try to find these classes with default class loader, so they should
aoqi@0 57 be located in classpath.
aoqi@0 58
aoqi@0 59 Without arguments it would work as old version of CTW: all classes in
aoqi@0 60 boot-classpath will be compiled, excluding classes in 'rt.jar' if 'rt.jar' isn't
aoqi@0 61 first in boot-classpath.
aoqi@0 62
aoqi@0 63 Due CTW's flags also are not available in product builds, the tool uses
aoqi@0 64 properties with the same names:
aoqi@0 65 - 'CompileTheWorldPreloadClasses' -- type:boolean, default:true, description:
aoqi@0 66 Preload all classes used by a class before start loading
aoqi@0 67 - 'CompileTheWorldStartAt' -- type:long, default:1, description: First class
aoqi@0 68 to consider
aoqi@0 69 - 'CompileTheWorldStopAt' -- type:long, default:Long.MAX_VALUE, description:
aoqi@0 70 Last class to consider
aoqi@0 71
aoqi@0 72 Also it uses additional properties:
aoqi@0 73 - 'sun.hotspot.tools.ctw.verbose' -- type:boolean, default:false,
aoqi@0 74 description: Verbose output, adds additional information about compilation
aoqi@0 75 - 'sun.hotspot.tools.ctw.logfile' -- type:string, default:null,
aoqi@0 76 description: Path to logfile, if it's null, cout will be used.
aoqi@0 77
aoqi@0 78 EXAMPLES
aoqi@0 79
aoqi@0 80 compile classes from 'rt.jar':
aoqi@0 81 $ java -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:wb.jar -jar ctw.jar ${JAVA_HOME}/jre/lib/rt.jar
aoqi@0 82
aoqi@0 83 compile classes from all '.jar' in './testjars' directory:
aoqi@0 84 $ java -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:wb.jar -jar ctw.jar ./testjars/*
aoqi@0 85
aoqi@0 86 compile classes from './build/classes' directory:
aoqi@0 87 $ java -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:wb.jar -jar ctw.jar ./build/classes
aoqi@0 88
aoqi@0 89 compile only java.lang.String, java.lang.Object classes:
aoqi@0 90 $ echo java.lang.String > classes.lst
aoqi@0 91 $ echo java.lang.Object >> classes.lst
aoqi@0 92 $ java -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:wb.jar -jar ctw.jar classes.lst
aoqi@0 93

mercurial