Skip to content

Fix mixed output of adapter and regular traces #2101

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
Oct 3, 2024

Conversation

lslusarczyk
Copy link
Contributor

@lslusarczyk lslusarczyk commented Sep 18, 2024

Fix #2002 issue.
When merged this PR will make regular UR calls tracing being printed calls in two separate lines like PI does.

@lslusarczyk lslusarczyk requested a review from a team as a code owner September 18, 2024 15:52
@github-actions github-actions bot added the loader Loader related feature/bug label Sep 18, 2024
Copy link
Contributor

@pbalcer pbalcer left a comment

Choose a reason for hiding this comment

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

I'm not really a fan of this approach, I'd prefer to have indents like ltrace. But I guess it solves the immediate problem...

Also, please try to keep the first line of the commit message under 50 characters, and the rest of the message lines under ~70.

$ man git commit

...
Though not required, it’s a good idea to begin the commit message with a single short (less than 50 character)
line summarizing the change, followed by a blank line and then a more thorough description. The text up to the
first blank line in a commit message is treated as the commit title, and that title is used throughout Git.

@@ -40,16 +40,18 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGet(
uint64_t instance = getContext()->notify_begin(UR_FUNCTION_ADAPTER_GET,
"urAdapterGet", &params);

getContext()->logger.info("---> urAdapterGet");
std::ostringstream args_str;
ur::extras::printFunctionParams(args_str, UR_FUNCTION_ADAPTER_GET, &params);
Copy link
Contributor

@pbalcer pbalcer Sep 18, 2024

Choose a reason for hiding this comment

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

not all the arguments can be accessed here, because some of them may be output arguments, with uninitialized content, which results in UB on access.

We either have to selectively access the parameters, adding an option to printFunctionParams to decide whether we are pre or post function execution, or, we can simply read those arguments after the execution. Which is what the original implementation did, for this exact reason.

@lslusarczyk lslusarczyk changed the title fix for non-readable output of adapter-specific tracing interleaved with regular tracing fixed mixed output of adapter and regular traces Sep 19, 2024
@lslusarczyk lslusarczyk force-pushed the fix-interleaved-urtraces branch from 30f8e30 to 2d10f85 Compare September 19, 2024 07:31
@lslusarczyk lslusarczyk force-pushed the fix-interleaved-urtraces branch from 2b5d716 to 12e0cee Compare September 20, 2024 18:01
@lslusarczyk lslusarczyk force-pushed the fix-interleaved-urtraces branch from 12e0cee to cf835bf Compare September 23, 2024 09:22
@lslusarczyk lslusarczyk force-pushed the fix-interleaved-urtraces branch from cf835bf to 3785539 Compare September 23, 2024 20:23
@lslusarczyk lslusarczyk changed the title fixed mixed output of adapter and regular traces Fix mixed output of adapter and regular traces Sep 23, 2024
@lslusarczyk lslusarczyk force-pushed the fix-interleaved-urtraces branch from 3785539 to 1e4088f Compare September 25, 2024 14:35
@lslusarczyk lslusarczyk force-pushed the fix-interleaved-urtraces branch from 1e4088f to 3a7b9f1 Compare September 25, 2024 20:11
@lslusarczyk lslusarczyk force-pushed the fix-interleaved-urtraces branch from 3a7b9f1 to 439c484 Compare September 26, 2024 07:39
@lslusarczyk lslusarczyk force-pushed the fix-interleaved-urtraces branch from 439c484 to 5e8592b Compare October 2, 2024 13:25
@lslusarczyk lslusarczyk force-pushed the fix-interleaved-urtraces branch from 5e8592b to cf5994a Compare October 2, 2024 18:10
Fixed oneapi-src#2002 issue.
Regular UR tracing prints now calls in two separate lines like PI does.
@lslusarczyk
Copy link
Contributor Author

@pbalcer , can you take a look again to this PR and merge this if all is OK?
There are three checks failing here:

  1. Build and test / E2E L0 / Start e2e job / Build SYCL, UR, run E2E (L0, level_zero...) this is expected as llvm has no changes from [SYCL][E2E] fixed UR FileCheck conditions to match new traces intel/llvm#15439 yet
  2. Build and test / E2E CUDA / Start e2e job / Build SYCL, UR, run E2E (CUDA...) expected - same situation
  3. Build and test / E2E OpenCL / Start e2e job / Build SYCL, UR, run E2E (OPENCL...) this fail is unrelated to my change and as I see this check is executed very rarely and even if it runs then nobody cares about failures in it and happily merges PRs with red color on it

E2E tests on llvm pass on my change and corresponding change in llvm is approved, see: intel/llvm#15439

@pbalcer pbalcer merged commit 7aba70b into oneapi-src:main Oct 3, 2024
72 of 75 checks passed
lslusarczyk added a commit to lslusarczyk/llvm that referenced this pull request Oct 3, 2024
steffenlarsen pushed a commit to intel/llvm that referenced this pull request Oct 3, 2024
Issue with ugly interleaved Level0 adapter and Level0 Unified Runtime
traces, that is
oneapi-src/unified-runtime#2002 issue, has
been fixed in oneapi-src/unified-runtime#2101.

This PR adds necessary changes to e2e tests to make them pass with
modified tracing in L0 Adapter.
This PR also reverts #15167 which
disabled some traces because of the bug which is now fixed, so traces
can be restored.

---------

Co-authored-by: Piotr Balcer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
loader Loader related feature/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adapter-specific tracing interferes with regular tracing output
2 participants