Proposal: should we add a 'clip' command to the jfr tool?
Mat Carter
Matthew.Carter at microsoft.com
Tue Jul 12 20:12:35 UTC 2022
I'd like to propose that we add a command that filters based on time (clip perhaps)
While working with large JFR files from jdk8 and jdk11 jvms I stumbled upon the 'jfr scrub' command that was introduced in 19.
I used the 'jfr summary' to get a list of events and programmatically split the JFR into a JFR for each eventtype, but the data can still be unwieldy especially when converted to JSON.
Given that 'jfr scrub' introduced the write(newJfrFile, predicate) method I wrote a java app to clip the JFR file based on a period of time (i hadn't seen the example in the JBS issue[1]), so now I can clip a JFR recording both horizontally (by events) and vertically (by time) and generate slices that are easier for JMC and other tools to parse (JMC would crash alot with large data)
I took a stab at writing 'jfr clip' locally (based on scrub) and can share that in a new JBS issue if it's felt by this group that its a worthy addition to the jfr tool
Again, I know that developers can write this themselves, but I feel it would be a nice convenience to have this in the jfr tool
Alternatively, we could extend 'jfr scrub' to handle both event filters and a time region
Cheers
Mat
[1] https://bugs.openjdk.org/browse/JDK-8271585
[JDK-8271585] JFR: Scrub recording data - Java Bug System<https://bugs.openjdk.org/browse/JDK-8271585>
JDK; JDK-8271585; JFR: Scrub recording data. Log In. Export
bugs.openjdk.org
Sent from Outlook<http://aka.ms/weboutlook>
________________________________
From: hotspot-jfr-dev <hotspot-jfr-dev-retn at openjdk.java.net> on behalf of Erik Gahlin <egahlin at openjdk.java.net>
Sent: Tuesday, May 17, 2022 9:47 PM
To: hotspot-jfr-dev at openjdk.java.net <hotspot-jfr-dev at openjdk.java.net>
Subject: Integrated: 8286706: JFR: 'jfr scrub' should overwrite output
On Mon, 16 May 2022 14:04:43 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:
> Could I have a review of a change that makes the 'jfr scrub' overwrite the output file if it already exists.
>
> Testing: /test/jdk/jdk/jfr/tool (Mac, Linux, Windows)
>
> Thanks
> Erik
This pull request has now been integrated.
Changeset: ab144190
Author: Erik Gahlin <egahlin at openjdk.org>
URL: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.openjdk.java.net%2Fjdk%2Fcommit%2Fab144190c9951f2a9a3acf30db4b570484d5f751&data=05%7C01%7Cmatthew.carter%40microsoft.com%7C6f907133f0514919728708da3889a4f5%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637884461083849921%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=zzPR1OA6evAeRWbmVBqXoOKgKb8wef7SVHZlxGF9xc4%3D&reserved=0
Stats: 35 lines in 2 files changed: 34 ins; 0 del; 1 mod
8286706: JFR: 'jfr scrub' should overwrite output
Reviewed-by: mgronlun
-------------
PR: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.openjdk.java.net%2Fjdk%2Fpull%2F8728&data=05%7C01%7Cmatthew.carter%40microsoft.com%7C6f907133f0514919728708da3889a4f5%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637884461083849921%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=QZ1ptTTj5JDIcqDPmdmK4BWSqq3JLKHMzBhT%2BbrM%2FDs%3D&reserved=0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-jfr-dev/attachments/20220712/87ed60dc/attachment-0001.htm>
More information about the hotspot-jfr-dev
mailing list