<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br class="Apple-interchange-newline">
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
</div>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:16.0px Menlo;color:#000000"><span style="font-variant-ligatures:no-common-ligatures">Hi Mat,</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:16.0px Menlo;color:#000000;min-height:19.0px">
<span style="font-variant-ligatures:no-common-ligatures"></span><br>
</p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:16.0px Menlo;color:#000000" class="elementToProof">
<span style="font-variant-ligatures:no-common-ligatures">I think there is a use case for removing events with respect to time. A common use case for the 'disassemble' command today is to reduce the size of th</span>e recording, but it's unintuitive and cumbersome
 to use as it is based on chunks.</p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:16.0px Menlo;color:#000000;min-height:19.0px">
<span style="font-variant-ligatures:no-common-ligatures"></span><br>
</p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:16.0px Menlo;color:#000000" class="elementToProof">
<span style="font-variant-ligatures:no-common-ligatures">I think the capability can be included in the existing 'scrub' command, but I can also see the use case for a separate command if 'scrub' gets too many options so it's hard for users to discover and understand
 how to use it.</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:16.0px Menlo;color:#000000" class="elementToProof">
<span style="font-variant-ligatures:no-common-ligatures"><br>
</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:16.0px Menlo;color:#000000" class="elementToProof">
<span style="font-variant-ligatures:no-common-ligatures">Time-based filtering has been mentioned before:</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:16.0px Menlo;color:#000000" class="elementToProof">
<span style="font-variant-ligatures:no-common-ligatures"><a href="https://mail.openjdk.org/pipermail/hotspot-jfr-dev/2022-February/003584.html" id="LPlnk468532">https://mail.openjdk.org/pipermail/hotspot-jfr-dev/2022-February/003584.html</a></span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:16.0px Menlo;color:#000000" class="elementToProof">
<span style="font-variant-ligatures:no-common-ligatures"><br>
</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:16.0px Menlo;color:#000000" class="elementToProof">
<span style="font-variant-ligatures:no-common-ligatures">Before discussing the implementation, it would be interesting to hear how you want to use it.</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:16.0px Menlo;color:#000000" class="elementToProof">
<span style="font-variant-ligatures:no-common-ligatures"><br>
</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:16.0px Menlo;color:#000000" class="elementToProof">
<span style="font-variant-ligatures:no-common-ligatures">Is the purpose to reduce the size of the recording to be able to open it in JMC? </span><span style="color: rgb(0, 0, 0); font-family: Menlo; font-size: 16px; font-style: normal; font-variant-caps: normal;">Divide
 the recording into smaller pieces, for example, at most 5 minutes each so they are more convenient to work with? </span><span style="color: rgb(0, 0, 0); font-family: Menlo; font-size: 16px; font-style: normal; font-variant-caps: normal;">Pick out a certain
 time interval, for example where you have an indication the application/JVM didn't respond? Is there a need to use this in combination with options to limit the size, similar to exist today with jcmd <pid> JFR.dump</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:16.0px Menlo;color:#000000" class="elementToProof">
<span style="color: rgb(0, 0, 0); font-family: Menlo; font-size: 16px; font-style: normal; font-variant-caps: normal;"><br>
</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:16.0px Menlo;color:#000000" class="elementToProof">
<span style="color: rgb(0, 0, 0); font-family: Menlo; font-size: 16px; font-style: normal; font-variant-caps: normal;">Thanks</span><br>
</p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:16.0px Menlo;color:#000000" class="elementToProof">
<span style="color: rgb(0, 0, 0); font-family: Menlo; font-size: 16px; font-style: normal; font-variant-caps: normal;">Erik</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:16.0px Menlo;color:#000000" class="elementToProof">
<span style="font-variant-ligatures:no-common-ligatures"><br>
</span></p>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Mat Carter <Matthew.Carter@microsoft.com><br>
<b>Sent:</b> Tuesday, July 12, 2022 10:12 PM<br>
<b>To:</b> Erik Gahlin <egahlin@openjdk.java.net>; hotspot-jfr-dev@openjdk.java.net <hotspot-jfr-dev@openjdk.java.net><br>
<b>Subject:</b> Proposal: should we add a 'clip' command to the jfr tool?</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<span style="color:rgb(0,0,0); background-color:rgb(255,255,255); display:inline!important">I'd like to propose that we add a command that filters based on time (clip perhaps)</span><br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
While working with large JFR files from jdk8 and jdk11 jvms I stumbled upon the 'jfr scrub' command that was introduced in 19.</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
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.</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
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)</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
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</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
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</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Alternatively, we could extend 'jfr scrub' to handle both event filters and a time region</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Cheers</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Mat</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
[1] <a href="https://bugs.openjdk.org/browse/JDK-8271585" id="LPlnkOWALinkPreview">https://bugs.openjdk.org/browse/JDK-8271585</a>
<div class="x__Entity x__EType_OWALinkPreview x__EId_OWALinkPreview x__EReadonly_1">
<div id="LPBorder_GTaHR0cHM6Ly9idWdzLm9wZW5qZGsub3JnL2Jyb3dzZS9KREstODI3MTU4NQ.." class="x_LPBorder142992" style="width:100%; margin-top:16px; margin-bottom:16px; max-width:800px; min-width:424px">
<table id="LPContainer142992" role="presentation" style="padding:12px 36px 12px 12px; width:100%; border-width:1px; border-style:solid; border-color:rgb(200,200,200); border-radius:2px">
<tbody>
<tr valign="top" style="border-spacing:0px">
<td style="width:100%">
<div id="LPTitle142992" style="font-size:21px; font-weight:300; margin-right:8px; font-family:wf_segoe-ui_light,"Segoe UI Light","Segoe WP Light","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; margin-bottom:12px">
<a target="_blank" id="LPUrlAnchor142992" href="https://bugs.openjdk.org/browse/JDK-8271585" style="text-decoration:none">[JDK-8271585] JFR: Scrub recording data - Java Bug System</a></div>
<div id="LPDescription142992" style="font-size:14px; max-height:100px; color:rgb(102,102,102); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; margin-bottom:12px; margin-right:8px; overflow:hidden">
JDK; JDK-8271585; JFR: Scrub recording data. Log In. Export</div>
<div id="LPMetadata142992" style="font-size:14px; font-weight:400; color:rgb(166,166,166); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif">
bugs.openjdk.org</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<br>
</div>
<div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div id="x_Signature">
<div>
<p>Sent from <a href="http://aka.ms/weboutlook">Outlook</a><br>
</p>
</div>
</div>
</div>
<div id="x_appendonsend"></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> hotspot-jfr-dev <hotspot-jfr-dev-retn@openjdk.java.net> on behalf of Erik Gahlin <egahlin@openjdk.java.net><br>
<b>Sent:</b> Tuesday, May 17, 2022 9:47 PM<br>
<b>To:</b> hotspot-jfr-dev@openjdk.java.net <hotspot-jfr-dev@openjdk.java.net><br>
<b>Subject:</b> Integrated: 8286706: JFR: 'jfr scrub' should overwrite output</font>
<div> </div>
</div>
<div class="x_BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="x_PlainText">On Mon, 16 May 2022 14:04:43 GMT, Erik Gahlin <egahlin@openjdk.org> wrote:<br>
<br>
> Could I have a review of a change that makes the 'jfr scrub' overwrite the output file if it already exists.<br>
> <br>
> Testing: /test/jdk/jdk/jfr/tool  (Mac, Linux, Windows)<br>
> <br>
> Thanks<br>
> Erik<br>
<br>
This pull request has now been integrated.<br>
<br>
Changeset: ab144190<br>
Author:    Erik Gahlin <egahlin@openjdk.org><br>
URL:       <a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.openjdk.java.net%2Fjdk%2Fcommit%2Fab144190c9951f2a9a3acf30db4b570484d5f751&amp;data=05%7C01%7Cmatthew.carter%40microsoft.com%7C6f907133f0514919728708da3889a4f5%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637884461083849921%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=zzPR1OA6evAeRWbmVBqXoOKgKb8wef7SVHZlxGF9xc4%3D&amp;reserved=0">
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.openjdk.java.net%2Fjdk%2Fcommit%2Fab144190c9951f2a9a3acf30db4b570484d5f751&amp;data=05%7C01%7Cmatthew.carter%40microsoft.com%7C6f907133f0514919728708da3889a4f5%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637884461083849921%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=zzPR1OA6evAeRWbmVBqXoOKgKb8wef7SVHZlxGF9xc4%3D&amp;reserved=0</a><br>
Stats:     35 lines in 2 files changed: 34 ins; 0 del; 1 mod<br>
<br>
8286706: JFR: 'jfr scrub' should overwrite output<br>
<br>
Reviewed-by: mgronlun<br>
<br>
-------------<br>
<br>
PR: <a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.openjdk.java.net%2Fjdk%2Fpull%2F8728&amp;data=05%7C01%7Cmatthew.carter%40microsoft.com%7C6f907133f0514919728708da3889a4f5%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637884461083849921%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=QZ1ptTTj5JDIcqDPmdmK4BWSqq3JLKHMzBhT%2BbrM%2FDs%3D&amp;reserved=0">
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.openjdk.java.net%2Fjdk%2Fpull%2F8728&amp;data=05%7C01%7Cmatthew.carter%40microsoft.com%7C6f907133f0514919728708da3889a4f5%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637884461083849921%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=QZ1ptTTj5JDIcqDPmdmK4BWSqq3JLKHMzBhT%2BbrM%2FDs%3D&amp;reserved=0</a><br>
</div>
</span></font></div>
</div>
</body>
</html>