Skip to content

Supporting Changes for Patchable JProfiling - #24488

Draft
r30shah wants to merge 5 commits into
eclipse-openj9:masterfrom
r30shah:jProfCodeGenChangesForPatchingPR
Draft

Supporting Changes for Patchable JProfiling#24488
r30shah wants to merge 5 commits into
eclipse-openj9:masterfrom
r30shah:jProfCodeGenChangesForPatchingPR

Conversation

@r30shah

@r30shah r30shah commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

r30shah added 5 commits August 6, 2026 10:28
Changes in this commit adds TR_JProfBlockFrequencyCounterSites for
Patching BlockFrequencyInfo is patching of JProfiling is enabled.
Counters emitted for the block frequency info in low opt compilations
through JProfiling would need to be patched to turn-off data
collection and potentially turn-on.
TR_JProfBlockFrequencyCounterSites to facilitate back and forth
patching.

Signed-off-by: Rahil Shah <rahil@ca.ibm.com>
This commit adds JProfValueSites that contains the information about the
instruction and location pair that controls execution of the Value Profiling
using JProfiling. This assumption can be used to turn-off or turn-on profiling.

Signed-off-by: Rahil Shah <rahil@ca.ibm.com>
Add following two lists in the CodeGenerator class to hold the
instructions related to JProfiling.

1. _jProfilingCounterBumpInstructionList - List of instructions in this
   method, that increments the counter inserted for computing frequency
   using JProfilingBlock.
2. _jProfilingValueProfilingBranchInstructions - List of branch
   instructions in this method, that control execution of the value
   profiling code.
This list can be used when creating runtime assumption for the method to
enable patching of the Profiling code to turn-off profiling data
collection.

Signed-off-by: Rahil Shah <rahil@ca.ibm.com>
Update the persistent BlockFrequencyInfo and ValueProfileInfo for the
method to hold the runtime assumption TR_JProfBlockFrequencyCounterSites
and TR_JProfValueSites respectively. This assumption contains the
information about the profiling code in the compiled method and
facilitates patching to turn-on or off profiling.

Signed-off-by: Rahil Shah <rahil@ca.ibm.com>
Introduce a new JProfilingPatchSitesInitPhase that performs following
tasks.
1. Construct TR_JProfBlockFrequencyCounterSites that holds information
   about the location in the compiled code that increments the Block
   Frequency counters.
2. Construct TR_JProfValueSites that holds information about the
   location in the compiled code that guards Value Profiling code.
This phase is performed at the end after binary encoding and relocation
has been run so that assumption list has precise information about the
code that can be patched.

Signed-off-by: Rahil Shah <rahil@ca.ibm.com>
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.

1 participant