Skip to content

[SYCL] Reduce cost of XPTI instrumentation #5158

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
Dec 17, 2021

Conversation

alexbatashev
Copy link
Contributor

Argument pack added unwanted overhead. Guard it with xptiTraceEnabled() with the intention to guard it with new API, that would allow instrumented apps to check if the stream is observed.

@@ -175,7 +180,7 @@ class plugin {
pi::emitFunctionEndTrace(CorrelationID, PIFnName);
pi::emitFunctionWithArgsEndTrace(CorrelationIDWithArgs,
static_cast<uint32_t>(PiApiOffset),
PIFnName, ArgsData.data(), R, *MPlugin);
PIFnName, ArgsDataPtr, R, *MPlugin);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should you also put lines 180-181 under if (xptiTraceEnabled())?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so. Bodies of those functions are wrapped with if (xptiTraceEnabled()) already. The main overhead here is from packing arguments.

Copy link
Contributor

Choose a reason for hiding this comment

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

It just looks strange that the call to emitFunctionWithArgsBeginTrace is guarded above (I assume their bodies also have that check) but these are not. Anyways, I am fine as is if you don't want to change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, I'm planning some more changes to shut down notifications, that are not received by any party. This is a temporary fix for the problem anyway.

Copy link
Contributor

@smaslov-intel smaslov-intel left a comment

Choose a reason for hiding this comment

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

LGTM

@bader bader merged commit 927fb89 into intel:sycl Dec 17, 2021
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