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

Do not build class verification exit tracepoint by default #21104

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mstoodle
Copy link
Contributor

Adds a J9VM_OPT_INCLUDE_CLASSVERIFY_EXIT_TRACEPOINT macro (not defined by default) to guard the recently (re?)introduced VerifyExit tracepoint, which resulted in some start-up regressions in -Xint mode.

Adds a J9VM_OPT_INCLUDE_CLASSVERIFY_EXIT_TRACEPOINT macro (not
defined by default) to guard the recently (re?)introduced
VerifyExit tracepoint, which resulted in some start-up regressions
in -Xint mode.

Signed-off-by: Mark Stoodley <[email protected]>
@mstoodle
Copy link
Contributor Author

jenkins compile amac jdk11

@pshipton pshipton requested a review from keithc-ca February 11, 2025 15:40
@pshipton
Copy link
Member

@@ -271,7 +271,10 @@ performVerification(J9VMThread *currentThread, J9Class *clazz)
}
}
done:
#if defined(J9VM_OPT_INCLUDE_CLASSVERIFY_EXIT_TRACEPOINT)
/* This tracepoint can introduce startup regressions even when disabled, so don't build into the VM by default */
Copy link
Contributor

Choose a reason for hiding this comment

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

Please fold this line and finish the sentence with a period.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, what do you mean by "fold this line" ? Do you mean put it on the same line as the #if defined()... ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe "split" would have been a better word than "fold" (it's too long if you can't see all of it without scrolling horizontally here).

Trc_VM_performVerification_Exit(currentThread);
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

This is missing the comment connecting it with line 274.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

d'oh. fixing.

@@ -271,7 +271,10 @@ performVerification(J9VMThread *currentThread, J9Class *clazz)
}
}
done:
#if defined(J9VM_OPT_INCLUDE_CLASSVERIFY_EXIT_TRACEPOINT)
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the proposed mechanism to enable this tracepoint?

The corresponding entry tracepoint should be also be conditional so entry/exit tracing is balanced (and nesting is properly displayed when using -Xtrace:iprint...).

Copy link
Member

Choose a reason for hiding this comment

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

I was thinking we could make the entry tracepoint an event rather than removing it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What is the proposed mechanism to enable this tracepoint?
#define it in the file and rebuild. Do you want me to document that too?

The corresponding entry tracepoint should be also be conditional so entry/exit tracing is balanced (and nesting is properly displayed when using -Xtrace:iprint...).
I'm aware (because this exit tracepoint was originally missing and so I added it to provide the balance you mention). But that causes a start-up regression. So I was trying to restore the "original" start-up performance without losing the knowledge that start-up performance is sensitive to this tracepoint's presence (even if disabled). I assume there is some diagnostic benefit to having at least the entry tracepoint, though I would guess it's not turned on very frequently and possibly even less frequently along with iprint.

What do you think of proceeding with this change as-is (to restore the world as it was before my effort to balance the tracepoints) and then we can open a follow-on issue to discuss how these verify tracepoints are used and decide whether the entry should also be taken out of the build by default?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer to take Peter's suggestion to replace the tracepoint used at the start of the function with an "event" tracepoint. I think changing the existing tracepoint from TraceEntry to TraceEvent would qualify as a "signature" change (see doc/diagnostics/AddingTracepoints.md), so a first step could be to obsolete Trc_VM_performVerification_Entry and Trc_VM_performVerification_Exit then a new TraceEvent tracepoint to replace the former. Later we could decide whether we want to have a tracepoint at the return of the function.

Signed-off-by: Mark Stoodley <[email protected]>
@mstoodle
Copy link
Contributor Author

Ok, i guess the other question is whether 1-2% startup regression in -Xint is worth mucking about with this RAS feature. I'll pursue that in the linked issue, since it's an internal one, and will summarize that discussion here. Honestly, I'm not sure it matters enough to go through the process Keith outlined.

@mstoodle mstoodle marked this pull request as draft February 11, 2025 20:33
@keithc-ca
Copy link
Contributor

I don't see the suggestion here as onerous. What's the concern?

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

Successfully merging this pull request may close these issues.

3 participants