New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8264768: JFR: Allow events to be printed to the log #3377
Conversation
|
Webrevs
|
Nice feature!
Just peeked at the patch and saw some include nits.
#include "oops/objArrayOop.hpp" | ||
#include "oops/objArrayOop.inline.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually don't explicitly include the .hpp file when the .inline.hpp file is already included.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I also see that the lines many a few of the include lines are not sorted)
@egahlin This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 148 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.
|
/integrate |
@egahlin Since your change was applied there have been 149 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit e80012e. |
Hi,
Could I have a review of change that allow events to be printed to the log.
This feature is meant for debugging purposes and to simplify development of new events, both user-defined and JDK events. It's not suitable for production environments because 1) The amount of data that will printed in the default configuration 2) The overhead of formatting the output 3) Events may contain sensitive information that should not end up in a log file.
To print only user-defined events to standard out:
$ java -Xlog:jfr+event=debug -XX:StartFlightRecording ...
To print only JDK events to standard out:
$ java -Xlog:jfr+event+system=debug -XX:StartFlightRecording ...
To print both user-defined and JDK events to standard out:
$ java -Xlog:jfr+event*=debug -XX:StartFlightRecording ...
To print more than five frames in a stack trace:
$ java -Xlog:jfr+event*=trace -XX:StartFlightRecording ...
To print all events to standard out without decoration, similar to 'jfr print'
$ java -Xlog:jfr+event*=debug::none -XX:StartFlightRecording ...
Example outputs of -Xlog:jfr+event*=debug:
[2.444s][debug][jfr,system,event] jdk.CPULoad {
[2.444s][debug][jfr,system,event] startTime = 15:32:09.605
[2.444s][debug][jfr,system,event] jvmUser = 8,27%
[2.444s][debug][jfr,system,event] jvmSystem = 0,68%
[2.444s][debug][jfr,system,event] machineTotal = 12,78%
[2.444s][debug][jfr,system,event] }
[7.352s][debug][jfr,event ] testing.FooBarBaz {
[7.352s][debug][jfr,event ] startTime = 15:33:11.526
[7.352s][debug][jfr,event ] duration = 1,00 s
[7.352s][debug][jfr,event ] eventThread = "main" (javaThreadId = 1)
[7.352s][debug][jfr,event ] stackTrace = [
[7.352s][debug][jfr,event ] Test.method3() line: 32
[7.352s][debug][jfr,event ] Test.method2() line: 24
[7.352s][debug][jfr,event ] Test.method1() line: 20
[7.352s][debug][jfr,event ] Test.main(String[]) line: 15
[7.352s][debug][jfr,event ] jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Method, Object, Object[])
[7.352s][debug][jfr,event ] ...
[7.352s][debug][jfr,event ] ]
[7.352s][debug][jfr,event ] }
There is no good way to do filtering per event, since log tags needs to be known at compile time and JFR allows user-defined events to be registered at runtime. Maybe something can be invented that allows UL to accept some JFR specific syntax, i.e. -Xlog:jfr[jdk.ConcurrentModeFailure,jdk.AllocationRequiringGC], but it's outside the scope of this enhancement request.
A custom .jfc file can always be created for the events you want to record, i.e. -Xlog:jfr+event*=debug -XX:StartFlightRecording:settings=custom.jfc
Testing: jdk/jdk/jfr
Thanks
Erik
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3377/head:pull/3377
$ git checkout pull/3377
Update a local copy of the PR:
$ git checkout pull/3377
$ git pull https://git.openjdk.java.net/jdk pull/3377/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3377
View PR using the GUI difftool:
$ git pr show -t 3377
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3377.diff