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

Add JFR CPULoad and ThreadCPU event support #20186

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thallium
Copy link
Contributor

@thallium thallium commented Sep 18, 2024

Depends on: eclipse-omr/omr#7491

@thallium
Copy link
Contributor Author

@tajila requesting your review

@tajila
Copy link
Contributor

tajila commented Oct 4, 2024

Im seeing negative numbers for Thread user mode CPU load

runtime/oti/j9nonbuilder.h Outdated Show resolved Hide resolved
runtime/vm/jfr.cpp Outdated Show resolved Hide resolved
runtime/oti/j9nonbuilder.h Outdated Show resolved Hide resolved
runtime/vm/jfr.cpp Outdated Show resolved Hide resolved
runtime/vm/jfr.cpp Outdated Show resolved Hide resolved
runtime/vm/jfr.cpp Outdated Show resolved Hide resolved
@thallium thallium force-pushed the cpuload branch 2 times, most recently from 9399d91 to 9f17f2e Compare October 7, 2024 18:37
@thallium thallium force-pushed the cpuload branch 3 times, most recently from 42e1d9d to 94218be Compare October 8, 2024 22:21
runtime/vm/jfr.cpp Outdated Show resolved Hide resolved
runtime/vm/jfr.cpp Outdated Show resolved Hide resolved
runtime/vm/jfr.cpp Outdated Show resolved Hide resolved
thallium added a commit to thallium/omr that referenced this pull request Oct 10, 2024
This function returns the user and system cpu time of the calling
thread.
Related: eclipse-openj9/openj9#20186

Signed-off-by: Gengchen Tuo <[email protected]>
@thallium
Copy link
Contributor Author

Opend OMR PR and addressed previous state.

thallium added a commit to thallium/omr that referenced this pull request Oct 10, 2024
This function returns the user and system cpu time of the calling
thread.
Related: eclipse-openj9/openj9#20186

Signed-off-by: Gengchen Tuo <[email protected]>
thallium added a commit to thallium/omr that referenced this pull request Oct 11, 2024
This function returns the user and system cpu time of the calling
thread.
Related: eclipse-openj9/openj9#20186

Signed-off-by: Gengchen Tuo <[email protected]>
thallium added a commit to thallium/omr that referenced this pull request Oct 11, 2024
This function returns the user and system cpu time of the calling
thread.
Related: eclipse-openj9/openj9#20186

Signed-off-by: Gengchen Tuo <[email protected]>
runtime/vm/jfr.cpp Outdated Show resolved Hide resolved
Comment on lines 848 to 851
if (count % 100 == 0) { // 1000ms
jfrCPULoad(currentThread);
}
if (count % 1000 == 0) { // 10s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing parentheses, constants go on the left of ==:

			if (0 == (count % 100)) { // 1000ms

By the way, how do you conclude that 100 counts is 1000ms?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J9JFR_SAMPLING_RATE is defined to be 10 so 100 counts is 1000ms

thallium added a commit to thallium/omr that referenced this pull request Oct 11, 2024
This function returns the user and system cpu time of the calling
thread. This new function is needed because the only way that we're
aware of to get the user CPU time of a thread is to use
getrusage(RUSAGE_THREAD, ...) which can only be called on the current
thread.

Related: eclipse-openj9/openj9#20186

Signed-off-by: Gengchen Tuo <[email protected]>
thallium added a commit to thallium/omr that referenced this pull request Oct 11, 2024
This function returns the user and system cpu time of the calling
thread. This new function is needed because the only way that we're
aware of to get the user CPU time of a thread is to use
getrusage(RUSAGE_THREAD, ...) which can only be called on the current
thread.

Related: eclipse-openj9/openj9#20186

Signed-off-by: Gengchen Tuo <[email protected]>
thallium added a commit to thallium/omr that referenced this pull request Oct 11, 2024
This function returns the user and system cpu time of the calling
thread. This new function is needed because the only way that we're
aware of to get the user CPU time of a thread is to use
getrusage(RUSAGE_THREAD, ...) which can only be called on the current
thread.

Related: eclipse-openj9/openj9#20186

Signed-off-by: Gengchen Tuo <[email protected]>
thallium added a commit to thallium/omr that referenced this pull request Oct 11, 2024
This function returns the user and system cpu time of the calling
thread. This new function is needed because the only way that we're
aware of to get the user CPU time of a thread is to use
getrusage(RUSAGE_THREAD, ...) which can only be called on the current
thread.

Related: eclipse-openj9/openj9#20186

Signed-off-by: Gengchen Tuo <[email protected]>
runtime/vm/jfr.cpp Outdated Show resolved Hide resolved
thallium added a commit to thallium/omr that referenced this pull request Oct 11, 2024
This function returns the user and system cpu time of the calling
thread. This new function is needed because the only way that we're
aware of to get the user CPU time of a thread is to use
getrusage(RUSAGE_THREAD, ...) which can only be called on the current
thread.

Related: eclipse-openj9/openj9#20186

Signed-off-by: Gengchen Tuo <[email protected]>
runtime/vm/BufferWriter.hpp Outdated Show resolved Hide resolved
runtime/oti/j9nonbuilder.h Outdated Show resolved Hide resolved
runtime/vm/jfr.cpp Outdated Show resolved Hide resolved
thallium added a commit to thallium/omr that referenced this pull request Oct 18, 2024
This function returns the user and system cpu time of the calling
thread. This new function is needed so we can get both user time and
system time using only one system call.

Related: eclipse-openj9/openj9#20186

Signed-off-by: Gengchen Tuo <[email protected]>
thallium added a commit to thallium/omr that referenced this pull request Oct 21, 2024
This function returns the user and system cpu time of the calling
thread. This new function is needed so we can get both user time and
system time using only one system call.

Related: eclipse-openj9/openj9#20186

Signed-off-by: Gengchen Tuo <[email protected]>
thallium added a commit to thallium/omr that referenced this pull request Oct 22, 2024
This function returns the user and system cpu time of the calling
thread. This new function is needed so we can get both user time and
system time using only one system call.

Related: eclipse-openj9/openj9#20186

Signed-off-by: Gengchen Tuo <[email protected]>
@thallium
Copy link
Contributor Author

Addressed previous feedbacks

@tajila
Copy link
Contributor

tajila commented Oct 31, 2024

@thallium Please rebase your changes

@thallium
Copy link
Contributor Author

Rebased

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

Successfully merging this pull request may close these issues.

3 participants