Description
The 'jfr scrub' command allows user to filter recording files, for example:
$ cd /recordings
$ jfr scrub --include-events jdk.JVMInformation test.jfr
Scrubbed recording file written to:
/recordings/test-scrubbed.jfr
But if repeated, for example with additional filters, it fails:
$ jfr scrub --include-events jdk.JVMInformation,jdk.SystemProperty test.jfr
jfr scrub: file 'test-scrubbed.jfr' already exists
This inconvenient and it would be better to overwrite the file. This is the behavior of JFR.dump. In case of a scrubbed file, the original still exists, so any destroyed scrubbed file can easily be regenerated.
There should still be a check so the output file is not the same as the input.
$ cd /recordings
$ jfr scrub --include-events jdk.JVMInformation test.jfr
Scrubbed recording file written to:
/recordings/test-scrubbed.jfr
But if repeated, for example with additional filters, it fails:
$ jfr scrub --include-events jdk.JVMInformation,jdk.SystemProperty test.jfr
jfr scrub: file 'test-scrubbed.jfr' already exists
This inconvenient and it would be better to overwrite the file. This is the behavior of JFR.dump. In case of a scrubbed file, the original still exists, so any destroyed scrubbed file can easily be regenerated.
There should still be a check so the output file is not the same as the input.