Skip to content

Create TR_IPBCDataDirectCall for IProfiler #21874

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

Merged
merged 1 commit into from
May 16, 2025

Conversation

mpirvu
Copy link
Contributor

@mpirvu mpirvu commented May 14, 2025

The IProfiler does not collect samples for direct calls. Instead, the optimizer will use the setCallCount() API to set the number of samples for such direct calls. Until this commit, direct-call info was stored in TR_IPBCDataCallGraph entries which was mainly created for interface and virtual calls. Such entries track 3 different call targets and are somewhat bigger than the rest of IProfiler entries. For direct calls we only need a simple counter, so using TR_IPBCDataCallGraph entries for this purpose is wasteful.

This commit introduces a new type of IProfiler entry, called TR_IPBCDataDirectCall, which will be used for storing profiling info related to direct calls. Note that the optimizer will remain the sole entity that will populate such entries. Moreover, these new entries will not be stored into the SCC (this follows the existing approach where profiling info related to direct calls is not stored in SCC).

@mpirvu mpirvu requested a review from dsouzai as a code owner May 14, 2025 13:40
@mpirvu mpirvu force-pushed the iprofiler_directcalls branch from 3499bb6 to f9d568f Compare May 14, 2025 13:56
@mpirvu
Copy link
Contributor Author

mpirvu commented May 14, 2025

jenkins compile all jdk8,jdk21

@mpirvu
Copy link
Contributor Author

mpirvu commented May 14, 2025

jenkins test sanity all jdk21

@mpirvu
Copy link
Contributor Author

mpirvu commented May 15, 2025

Windows failed one test: jdk_util_1

17:37:00  STDOUT:
17:37:00  test WhiteBox.Iterator_remove_safetyWhileInDetachedMode(): success
17:37:00  test WhiteBox.advancing2CyclesWillRemoveIterators(): success
17:37:00  test WhiteBox.clear_willClearItrs(): success
17:37:00  test WhiteBox.collectiveSanity(): success
17:37:00  test WhiteBox.dequeuesBypassingIteratorCurrentPositions(): success
17:37:00  test WhiteBox.garbageCollectionOfUnreachableIterators(): success
17:37:00  test WhiteBox.garbageCollectionOfUnreachableIteratorsWithRandomlyRetainedSubset(): success
17:37:00  test WhiteBox.incrementalSweepingOfUnreachableIterators(): failure
17:37:00  java.lang.AssertionError: failed to do a "full" gc
17:37:00  	at WhiteBox.forceFullGc(WhiteBox.java:226)

I have also looked at performance of this PR and there might be a small perf regression ~3.5%

@mpirvu mpirvu marked this pull request as draft May 15, 2025 00:28
@mpirvu mpirvu force-pushed the iprofiler_directcalls branch from f9d568f to bce0daf Compare May 15, 2025 13:02
@mpirvu
Copy link
Contributor Author

mpirvu commented May 15, 2025

I fixed the performance regression in the latest forced push.

@mpirvu mpirvu marked this pull request as ready for review May 15, 2025 13:04
@mpirvu
Copy link
Contributor Author

mpirvu commented May 15, 2025

@dsouzai Could you please review/merge this PR? Thanks

Copy link
Contributor

@dsouzai dsouzai left a comment

Choose a reason for hiding this comment

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

LGTM. That said, looks like the memory type OMR PR has propagated to openj9-omr, so you could update this PR with the memory type (unless you think it's better to do so in another one).

@dsouzai dsouzai self-assigned this May 16, 2025
@mpirvu
Copy link
Contributor Author

mpirvu commented May 16, 2025

I will update now.

The IProfiler does not collect samples for direct calls.
Instead, the optimizer will use the setCallCount() API to
set the number of samples for such direct calls.
Until this commit, direct-call info was stored in
TR_IPBCDataCallGraph entries which was mainly created for
interface and virtual calls. Such entries track 3 different
call targets and are somewhat bigger than the rest of IProfiler
entries. For direct calls we only need a simple counter, so
using TR_IPBCDataCallGraph entries for this purpose is wasteful.

This commit introduces a new type of IProfiler entry, called
TR_IPBCDataDirectCall, which will be used for storing profiling
info related to direct calls. Note that the optimizer will
remain the sole entity that will populate such entries.
Moreover, these new entries will not be stored into the SCC
(this follows the existing approach where profiling info related
to direct calls is not stored in SCC).

Signed-off-by: Marius Pirvu <[email protected]>
@mpirvu mpirvu force-pushed the iprofiler_directcalls branch from bce0daf to 16ec425 Compare May 16, 2025 03:13
@mpirvu
Copy link
Contributor Author

mpirvu commented May 16, 2025

Updated the code with the correct memory tag from OMR.

@mpirvu
Copy link
Contributor Author

mpirvu commented May 16, 2025

jenkins test sanity.functional all jdk21

@dsouzai dsouzai merged commit 14d9c79 into eclipse-openj9:master May 16, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants