test/hotspot/jtreg/serviceability/sa/ClhsdbLauncher.java
changeset 48160 599f67f3c6d6
parent 47899 f113d1ef7bed
child 48949 d2a860bc50a3
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbLauncher.java	Thu Nov 30 15:05:03 2017 +0100
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbLauncher.java	Thu Nov 30 19:46:20 2017 +0530
@@ -53,10 +53,12 @@
     private void attach(long lingeredAppPid)
         throws IOException {
 
-        System.out.println("Starting clhsdb against " + lingeredAppPid);
         JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jhsdb");
         launcher.addToolArg("clhsdb");
-        launcher.addToolArg("--pid=" + Long.toString(lingeredAppPid));
+        if (lingeredAppPid != -1) {
+            launcher.addToolArg("--pid=" + Long.toString(lingeredAppPid));
+            System.out.println("Starting clhsdb against " + lingeredAppPid);
+        }
 
         ProcessBuilder processBuilder = new ProcessBuilder(launcher.getCommand());
         processBuilder.redirectError(ProcessBuilder.Redirect.INHERIT);