Integrated: 8287800: JFR: Incorrect error message when starting recording with missing .jfc file
Erik Gahlin
egahlin at openjdk.org
Mon Jun 20 12:27:01 UTC 2022
On Mon, 20 Jun 2022 01:40:59 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:
> Could I have a review of PR that fixes incorrect error messages when starting a recording.
>
> The current message is very confusing. If a user types`jcmd <pid> JFR.start settings=my.jfc`, but doesn't realise that the path should be relative to where the JVM started, the error message says "Could not parse settings file custom.jfc"
>
> It should say "Could not **find** file custom.jfc"
>
> Furthermore, if a user specifies `settings=default.jfc settings=my.jfc`to get settings from two files, the error message will say "Could not parse file default.jfc", even though it was my.jfc it was unable to find.
>
> This problem impacts `jfr configure`, `-XX:StartFlightRecording` and `JFR.start`. Code has been refactored so error formatting now happens per file and in one place with a proper verb ("find", "parse", "use", "access", "open"). Error messages from the parser are also propagated, for example: "Could not parse file 'my.jfc". Expected root element to be named 'configuration'"
>
> Testing: jdk/jdk/jfr
>
> Thanks
> Erik
This pull request has now been integrated.
Changeset: 1cf83a40
Author: Erik Gahlin <egahlin at openjdk.org>
URL: https://git.openjdk.org/jdk19/commit/1cf83a403f15067fb5a64cff68dc5706f533ebd7
Stats: 225 lines in 14 files changed: 101 ins; 52 del; 72 mod
8287800: JFR: Incorrect error message when starting recording with missing .jfc file
Reviewed-by: mgronlun
-------------
PR: https://git.openjdk.org/jdk19/pull/43
More information about the hotspot-jfr-dev
mailing list