Skip to content
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

JFR: Add JavaThreadStatistics event #20919

Open
tajila opened this issue Jan 13, 2025 · 1 comment
Open

JFR: Add JavaThreadStatistics event #20919

tajila opened this issue Jan 13, 2025 · 1 comment

Comments

@tajila
Copy link
Contributor

tajila commented Jan 13, 2025

Add support for the JavaThreadStatistics event described here, https://sap.github.io/SapMachine/jfrevents/21.html#javathreadstatistics

This event is profiled and is triggered every second, so it will require the use of the VM JFR profiler thread (see jfrSamplingThreadProc)

A new function jfrThreadStatistics can be added which is called every second to collect the relevant thread statistics.

Java thread creation is done in vmthread.cpp in startJavaThreadInternal.

Daemon thread can be determined by looking at vmthread->privateFlags & J9_PRIVATE_FLAGS_DAEMON_THREAD

We will need to add a U_64 peakThreads, U_64 liveThreads and U_64 cumulativeThreads fields to J9JavaVM to keep track of those. THe updates to those values can be performed when the vm->vmThreadListMutex is held.

@tajila
Copy link
Contributor Author

tajila commented Jan 13, 2025

@adpopescu Please take a look at this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant