8241885: JFR tool: print does not work with inner class events

Reviewed-by: jbachorik
This commit is contained in:
Erik Gahlin 2020-06-23 21:28:45 +02:00
parent 0a6262f0b8
commit 1aa6539576
2 changed files with 13 additions and 6 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020, 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
@ -66,9 +66,10 @@ public final class Main {
System.out.println();
System.out.println(" jfr print --json --events CPULoad recording.jfr");
System.out.println();
System.out.println(" jfr print --categories \"GC,JVM,Java*\" recording.jfr");
char q = Print.quoteCharacter();
System.out.println(" jfr print --categories " + q + "GC,JVM,Java*" + q + " recording.jfr");
System.out.println();
System.out.println(" jfr print --events \"jdk.*\" --stack-depth 64 recording.jfr");
System.out.println(" jfr print --events " + q + "jdk.*" + q + " --stack-depth 64 recording.jfr");
System.out.println();
System.out.println(" jfr summary recording.jfr");
System.out.println();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020, 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
@ -25,6 +25,7 @@
package jdk.jfr.internal.tool;
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
@ -92,9 +93,10 @@ final class Print extends Command {
stream.println();
stream.println(" jfr print --events CPULoad,GarbageCollection recording.jfr");
stream.println();
stream.println(" jfr print --categories \"GC,JVM,Java*\" recording.jfr");
char q = quoteCharacter();
stream.println(" jfr print --categories " + q + "GC,JVM,Java*" + q + " recording.jfr");
stream.println();
stream.println(" jfr print --events \"jdk.*\" --stack-depth 64 recording.jfr");
stream.println(" jfr print --events "+ q + "jdk.*" + q +" --stack-depth 64 recording.jfr");
stream.println();
stream.println(" jfr print --json --events CPULoad recording.jfr");
}
@ -279,4 +281,8 @@ final class Print extends Command {
}
return list;
}
static char quoteCharacter() {
return File.pathSeparatorChar == ';' ? '"' : '\'';
}
}