RecordedObject toString stack depth

Stig Rohde Døssing stigdoessing at gmail.com
Tue May 28 17:37:50 UTC 2024


Hi,

JFR has an internal pretty printer (PrettyWriter), which is used to
implement a friendly toString for RecordedObject. The toString method
hardcodes the stack depth to 5
https://github.com/openjdk/jdk/blob/da6aa2a86c86ba5fce747b36dcb2d6001cfcc44e/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedObject.java#L859

I'm programmatically running JFR and dumping events into a logging system,
and figure you intend for people to write their own pretty printers, but I
was wondering why this limit is even there? It's already possible to limit
the stack depth of recordings via a JFR setting, so why does the toString
method need a separate fixed limit?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-jfr-dev/attachments/20240528/c6f63c1e/attachment-0001.htm>


More information about the hotspot-jfr-dev mailing list