8022259: MakeClasslist is buggy and its README is out of date.
authorhseigel
Tue, 13 Aug 2013 10:56:13 -0400
changeset 19401 d4cc956b926b
parent 19399 e2e5122cd62e
child 19402 77755a81b73f
8022259: MakeClasslist is buggy and its README is out of date. Summary: Fixed bug in FOR loop and updated comments and README Reviewed-by: dholmes, alanb
jdk/make/tools/sharing/README.txt
jdk/make/tools/src/build/tools/makeclasslist/MakeClasslist.java
--- a/jdk/make/tools/sharing/README.txt	Tue Aug 13 19:10:54 2013 +0100
+++ b/jdk/make/tools/sharing/README.txt	Tue Aug 13 10:56:13 2013 -0400
@@ -2,20 +2,20 @@
 class list for class data sharing.
 
 The class list is produced by running the refWorkload startup3 benchmark with
-the -verbose:class option. The -Xshare:off option must also be used so that
-bootclasspath classes are loaded from rt.jar.  The MakeClasslist program
-should be built into the jar file makeclasslist.jar and is run
+the -XX:+TraceClassLoadingPreorder option.  The -Xshare:off option must also be
+used so that bootclasspath classes are loaded from rt.jar.  The MakeClasslist
+program should be built into the jar file makeclasslist.jar and is run
 on one of the logs from each of the benchmarks in the following fashion:
 
-cd .../results.startup3
-$JAVA_HOME/bin/java -jar makeclasslist.jar results.Noop/results_1/log results.Framer/results_1/log results.XFramer/results_1/log results.JEdit/results_1/log results.LimeWire/results_1/log results.NetBeans/results_1/log
+cd .../<resultsdir>/results.startup3
+$JAVA_HOME/bin/java -jar makeclasslist.jar results.Noop/results_1/log results.Framer/results_1/log results.XFramer/results_1/log results.JEdit/results_1/log results.LimeWire/results_1/log results.NetBeans50/results_1/log
 
 Presently, $JAVA_HOME must be the same path used to run the startup3 benchmark.
 
-The logs are deliberately concatenated in roughly smallest to largest
-order based on application size. The resulting output is redirected
-into a file and results in one of classlist.solaris, classlist.linux,
-or classlist.windows. These files are checked in to the workspace. A
+The logs are deliberately concatenated in roughly smallest to largest order
+based on application size.  The resulting output is redirected into a file
+and results in one of classlist.solaris, classlist.linux, classlist.macosx,
+or classlist.windows.  These files are checked in to the workspace.  A
 necessary checksum (AddJsum.java) is added to the final classlist
 (installed in lib/ or jre/lib/) during the build process by the
 makefiles in make/java/redist.
@@ -27,8 +27,8 @@
 The properties file supplied to the refworkload is approximately the
 following:
 
-javahome=/usr/java/j2sdk1.5.0
+javahome=/usr/java/j2sdk1.8.0
 resultsdir=classlist-run
 iterations=1
 benchmarks=startup3
-globalvmoptions=-client -Xshare:off -verbose:class
+globalvmoptions=-client -Xshare:off -XX:+TraceClassLoadingPreorder
--- a/jdk/make/tools/src/build/tools/makeclasslist/MakeClasslist.java	Tue Aug 13 19:10:54 2013 +0100
+++ b/jdk/make/tools/src/build/tools/makeclasslist/MakeClasslist.java	Tue Aug 13 10:56:13 2013 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,11 +29,11 @@
 import java.util.*;
 import java.util.jar.*;
 
-/** Reads a set of files containing the output of java -verbose:class
-    runs. Finds all classes that were loaded from the bootstrap class
-    path by comparing the prefix of the load path to the current JRE's
-    java.home system property. Prints the names of these classes to
-    stdout.
+/** Reads a set of files containing the output of java
+    -XX:+TraceClassLoadingPreorder runs. Finds all classes that were
+    loaded from the bootstrap class path by comparing the prefix of
+    the load path to the current JRE's java.home system property.
+    Prints the names of these classes to stdout.
 */
 
 public class MakeClasslist {
@@ -86,7 +86,7 @@
 
     Set<String> seenClasses = new HashSet<>();
 
-    for (String str : seenClasses) {
+    for (String str : classes) {
       if (seenClasses.add(str)) {
         System.out.println(str);
       }