equal
deleted
inserted
replaced
40 |
40 |
41 import jdk.jfr.EventType; |
41 import jdk.jfr.EventType; |
42 import jdk.jfr.internal.MetadataDescriptor; |
42 import jdk.jfr.internal.MetadataDescriptor; |
43 import jdk.jfr.internal.Type; |
43 import jdk.jfr.internal.Type; |
44 import jdk.jfr.internal.consumer.ChunkHeader; |
44 import jdk.jfr.internal.consumer.ChunkHeader; |
|
45 import jdk.jfr.internal.consumer.FileAccess; |
45 import jdk.jfr.internal.consumer.RecordingInput; |
46 import jdk.jfr.internal.consumer.RecordingInput; |
46 |
47 |
47 final class Summary extends Command { |
48 final class Summary extends Command { |
48 private final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withLocale(Locale.UK).withZone(ZoneOffset.UTC); |
49 private final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withLocale(Locale.UK).withZone(ZoneOffset.UTC); |
49 |
50 |
89 |
90 |
90 private void printInformation(Path p) throws IOException { |
91 private void printInformation(Path p) throws IOException { |
91 long totalDuration = 0; |
92 long totalDuration = 0; |
92 long chunks = 0; |
93 long chunks = 0; |
93 |
94 |
94 try (RecordingInput input = new RecordingInput(p.toFile())) { |
95 try (RecordingInput input = new RecordingInput(p.toFile(), FileAccess.UNPRIVILIGED)) { |
95 ChunkHeader first = new ChunkHeader(input); |
96 ChunkHeader first = new ChunkHeader(input); |
96 ChunkHeader ch = first; |
97 ChunkHeader ch = first; |
97 String eventPrefix = Type.EVENT_NAME_PREFIX; |
98 String eventPrefix = Type.EVENT_NAME_PREFIX; |
98 if (first.getMajor() == 1) { |
99 if (first.getMajor() == 1) { |
99 eventPrefix = "com.oracle.jdk."; |
100 eventPrefix = "com.oracle.jdk."; |