diff --git a/hotspot/make/aix/makefiles/trace.make b/hotspot/make/aix/makefiles/trace.make
index 11a92c8ff46..c00b0e3383a 100644
--- a/hotspot/make/aix/makefiles/trace.make
+++ b/hotspot/make/aix/makefiles/trace.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2015, 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
@@ -82,8 +82,7 @@ all: $(TraceGeneratedFiles)
GENERATE_CODE= \
$(QUIETLY) echo $(LOG_INFO) Generating $@; \
- $(XSLT) -IN $(word 1,$^) -XSL $(word 2,$^) -OUT $@; \
- test -f $@
+ $(XSLT) -IN $(word 1,$^) -XSL $(word 2,$^) -OUT $@
$(TraceOutDir)/traceEventIds.hpp: $(TraceSrcDir)/trace.xml $(TraceSrcDir)/traceEventIds.xsl $(XML_DEPS)
$(GENERATE_CODE)
diff --git a/hotspot/make/bsd/makefiles/trace.make b/hotspot/make/bsd/makefiles/trace.make
index ed2eb159aee..c7ef3d8ea01 100644
--- a/hotspot/make/bsd/makefiles/trace.make
+++ b/hotspot/make/bsd/makefiles/trace.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2015, 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
@@ -83,8 +83,7 @@ all: $(TraceGeneratedFiles)
GENERATE_CODE= \
$(QUIETLY) echo $(LOG_INFO) Generating $@; \
- $(XSLT) -IN $(word 1,$^) -XSL $(word 2,$^) -OUT $@; \
- test -f $@
+ $(XSLT) -IN $(word 1,$^) -XSL $(word 2,$^) -OUT $@
$(TraceOutDir)/traceEventIds.hpp: $(TraceSrcDir)/trace.xml $(TraceSrcDir)/traceEventIds.xsl $(XML_DEPS)
$(GENERATE_CODE)
diff --git a/hotspot/make/linux/makefiles/trace.make b/hotspot/make/linux/makefiles/trace.make
index 5cdec9adcb3..7218adc27b3 100644
--- a/hotspot/make/linux/makefiles/trace.make
+++ b/hotspot/make/linux/makefiles/trace.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2015, 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
@@ -82,8 +82,7 @@ all: $(TraceGeneratedFiles)
GENERATE_CODE= \
$(QUIETLY) echo $(LOG_INFO) Generating $@; \
- $(XSLT) -IN $(word 1,$^) -XSL $(word 2,$^) -OUT $@; \
- test -f $@
+ $(XSLT) -IN $(word 1,$^) -XSL $(word 2,$^) -OUT $@
$(TraceOutDir)/traceEventIds.hpp: $(TraceSrcDir)/trace.xml $(TraceSrcDir)/traceEventIds.xsl $(XML_DEPS)
$(GENERATE_CODE)
diff --git a/hotspot/make/solaris/makefiles/trace.make b/hotspot/make/solaris/makefiles/trace.make
index ef4beda149c..ab96c7ffd65 100644
--- a/hotspot/make/solaris/makefiles/trace.make
+++ b/hotspot/make/solaris/makefiles/trace.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2015, 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
@@ -78,8 +78,7 @@ all: $(TraceGeneratedFiles)
GENERATE_CODE= \
$(QUIETLY) echo $(LOG_INFO) Generating $@; \
- $(XSLT) -IN $(word 1,$^) -XSL $(word 2,$^) -OUT $@; \
- test -f $@
+ $(XSLT) -IN $(word 1,$^) -XSL $(word 2,$^) -OUT $@
$(TraceOutDir)/traceEventIds.hpp: $(TraceSrcDir)/trace.xml $(TraceSrcDir)/traceEventIds.xsl $(XML_DEPS)
$(GENERATE_CODE)
diff --git a/hotspot/src/share/vm/prims/jvmtiGen.java b/hotspot/src/share/vm/prims/jvmtiGen.java
index f2cdbe9ae72..0b79555b35a 100644
--- a/hotspot/src/share/vm/prims/jvmtiGen.java
+++ b/hotspot/src/share/vm/prims/jvmtiGen.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -22,52 +22,60 @@
*
*/
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;
-
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DOMException;
-// For write operation
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.stream.StreamResult;
-import java.io.*;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.w3c.dom.Document;
+import org.w3c.dom.DOMException;
public class jvmtiGen
{
+ private static final int EXIT_FAILURE_ERROR = 1;
+ private static final int EXIT_FAILURE_BADARGUMENTS = 2;
+
+ private static boolean verbose = false;
+
/**
* Write out usage and exit.
*/
private static void showUsage() {
System.err.println("usage:");
System.err.println(" java jvmtiGen " +
+ "[-verbose] " +
"-IN " +
"-XSL " +
"-OUT