Scrubbing recording data by datetime
Yasumasa Suenaga
suenaga at oss.nttdata.com
Sun Oct 5 23:11:16 UTC 2025
Hi Erik,
I agree with you that we can use `JFR.dump` to cutout flight record on living process, however I think it is not enough in some use cases.
For example, the user was aware something wrong in their batch system few days ago, but the process was already finished. The user could know when it happend, so he could find out the recording file, but it was very big ( > 250MB), thus it is difficult to show thread lanes (very heavy!!).
I want to propose very simple option to cutout by datetime like [1].
Thanks,
Yasumasa
[1] https://github.com/YaSuenag/garakuta/blob/master/trjfr/src/main/java/com/yasuenag/trjfr/Main.java
On 10/6/2025 12:29 AM, Erik Gahlin wrote:
> Hi Yasumasa,
>
> As you’ve probably noticed, this question came up when we added ‘jfr scrub’.
>
> Before adding flags, it would help to understand your concrete use case. Why do you need to select a datetime interval on an existing recording file? If you can describe the underlying goal, we can design the right option.
>
> For example, if the intent is to split a large recording into smaller pieces - say, to send them as attachments - then a size-based approach might be a better fit than a time-based one, e.g. ‘jfr disassemble --max-size 5000000’
>
> JFR.dump can select an interval precisely because the user knows the current wall-clock time, so choosing start and end is straightforward. With an offline file like dump.jfr, absolute times are usually not obvious, and time zones can complicate matters further.
>
> Erik
>
> Confidential – Oracle Internal
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> *From:* hotspot-jfr-dev <hotspot-jfr-dev-retn at openjdk.org> on behalf of Yasumasa Suenaga <suenaga at oss.nttdata.com>
> *Sent:* Saturday, October 4, 2025 4:02 AM
> *To:* hotspot-jfr-dev at openjdk.org <hotspot-jfr-dev at openjdk.org>
> *Cc:* yasuenag at gmail.com <yasuenag at gmail.com>
> *Subject:* Scrubbing recording data by datetime
> Hi all,
>
> I want to propose to add a feature to scrub recording data by datetime in `jfr scrub` command.
>
> CSR of `jfr scrub` [1] says a possibility to dump the last 30 seconds for later analysis. I completely agree with this use case, but `jfr scrub` hasn't yet had a feature to scrub recording data to datetime. Currently we can scrub recording data by thread, event, and categories. However it is more useful if all of contents which emitted in the time window we want to focus especially the analyst doesn't know what happened yet.
>
>
> I think we can add both `--start` and `--end` commandline option to `jfr scrub` command for this purpose.
> Implementation POV, I think we can implement it easily with `RecordingFile::write` API.
>
> I think it needs CSR because to add new commandline options to `jfr` command, so I want to hear your comments before to work.
>
>
> Thanks,
>
> Yasumasa
>
>
> [1] https://bugs.openjdk.org/browse/JDK-8271585 <https://bugs.openjdk.org/browse/JDK-8271585>
More information about the hotspot-jfr-dev
mailing list