Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8241885: JFR tool: print does not work with inner class events
Reviewed-by: jbachorik
  • Loading branch information
egahlin committed Jun 23, 2020
1 parent 0a6262f commit 1aa653957619acfdb5f08ce0f3a1ad1a17cfa127
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
@@ -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 static void main(String... args) {
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();
@@ -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 @@ public void displayOptionUsage(PrintStream stream) {
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 @@ private static List<String> explodeFilter(String filter) throws UserSyntaxExcept
}
return list;
}

static char quoteCharacter() {
return File.pathSeparatorChar == ';' ? '"' : '\'';
}
}

0 comments on commit 1aa6539

Please sign in to comment.