RFR: 8356698: JFR: @Contextual
Could I have a review of a new annotation that can be used to annotate a field as contextual. Testing: jdk/jdk/jfr + tier1 Thanks Erik ------------- Commit messages: - Simplification and cleanup - Merge - Remove mistakenly added file - Update - Whitspace - Initial Changes: https://git.openjdk.org/jdk/pull/25249/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25249&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356698 Stats: 706 lines in 6 files changed: 698 ins; 3 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/25249.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25249/head:pull/25249 PR: https://git.openjdk.org/jdk/pull/25249
On Thu, 15 May 2025 12:46:54 GMT, Erik Gahlin <egahlin@openjdk.org> wrote:
Could I have a review of a new annotation that can be used to annotate a field as contextual.
Testing: jdk/jdk/jfr + tier1
Thanks Erik
A very nice addition and an excellent demo example for showcasing the capabilities is provided in the test: TestPrintContextual.java src/jdk.jfr/share/classes/jdk/jfr/events/MethodTraceEvent.java line 39:
37: public final class MethodTraceEvent extends AbstractJDKEvent { 38: 39: @Contextual
Should the MethodTraceEvent's method field really have this annotation? Or is it a remnant from testing? ------------- Marked as reviewed by mgronlun (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25249#pullrequestreview-2884461033 PR Review Comment: https://git.openjdk.org/jdk/pull/25249#discussion_r2118169044
On Sat, 31 May 2025 18:58:29 GMT, Markus Grönlund <mgronlun@openjdk.org> wrote:
Could I have a review of a new annotation that can be used to annotate a field as contextual.
Testing: jdk/jdk/jfr + tier1
Thanks Erik
src/jdk.jfr/share/classes/jdk/jfr/events/MethodTraceEvent.java line 39:
37: public final class MethodTraceEvent extends AbstractJDKEvent { 38: 39: @Contextual
Should the MethodTraceEvent's method field really have this annotation? Or is it a remnant from testing?
I think it can be useful if a contextual GUI is created where users can drill down into tables and see all events that occur during a method call. For example, if you want to troubleshoot a slow login: $ java -XX:StartFlightRecording:method-trace=LoginService::login ... | Context Types |----------------------------------- | Order::id | **MethodTrace::method** (selected) | Trace::span | Trace::name |Context Values |----------------------------------- | **LoginService::login(String, String)** (selected) Start Time | Event Type | Duration --------------|-----------------------|------------- 20:05:02.45 | jdk.JavaMonitorEnter | 25 ms 20:05:03.12 | jdbc.ExecuteQuery | 2 s ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25249#discussion_r2119629183
On Sun, 1 Jun 2025 21:46:23 GMT, Erik Gahlin <egahlin@openjdk.org> wrote:
I think it can be useful if a contextual GUI is created where users can drill down into tables and see all events that occur during a method call. For example, if you want to troubleshoot a slow login:
``` $ java -XX:StartFlightRecording:method-trace=LoginService::login ... ```
Context Types Order::id **MethodTrace::method** (selected) Trace::id Trace::name Start Time Duration Context Values 20:05:02.10 5.0 s **LoginService::login(String, String)** (selected) 20:05:08.10 80 ms **LoginService::login(String, String)** 20:05:10.10 75 ms **LoginService::login(String, String)** Start Time Event Name Duration 20:05:02.45 Java Monitor Enter 25 ms 20:05:03.12 JDBC Execute Query 4.7 s
or some other known aspect of the program that has been problematic in the past and now have been annotated, for example:
``` $ java -XX:StartFlightRecording:method-trace=@com.example.UpdateOrder ... ```
I could not agree more. A GUI picking up these innovations, making them conveniently accessible and easily understandable to the end user would be fantastic. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25249#discussion_r2120658143
On Thu, 15 May 2025 12:46:54 GMT, Erik Gahlin <egahlin@openjdk.org> wrote:
Could I have a review of a new annotation that can be used to annotate a field as contextual.
Testing: jdk/jdk/jfr + tier1
Thanks Erik
This pull request has now been integrated. Changeset: 1373ceb7 Author: Erik Gahlin <egahlin@openjdk.org> URL: https://git.openjdk.org/jdk/commit/1373ceb7f3040a03ae142cfaab0f74894fc6a0a3 Stats: 706 lines in 6 files changed: 698 ins; 3 del; 5 mod 8356698: JFR: @Contextual Reviewed-by: mgronlun ------------- PR: https://git.openjdk.org/jdk/pull/25249
participants (2)
-
Erik Gahlin
-
Markus Grönlund