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

fixed mixed output of adapter and regular traces #2101

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lslusarczyk
Copy link
Contributor

Fixed #2002 issue.
Regular UR tracing prints 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 added a commit to lslusarczyk/llvm that referenced this pull request Sep 19, 2024
lslusarczyk added a commit to lslusarczyk/llvm that referenced this pull request Sep 20, 2024
lslusarczyk added a commit to lslusarczyk/llvm that referenced this pull request Sep 20, 2024
lslusarczyk added a commit to lslusarczyk/llvm that referenced this pull request Sep 20, 2024
lslusarczyk added a commit to lslusarczyk/llvm that referenced this pull request Sep 20, 2024
Fixed oneapi-src#2002 issue.
Regular UR tracing prints now calls in two separate lines like PI does.
lslusarczyk added a commit to lslusarczyk/llvm that referenced this pull request Sep 20, 2024
lslusarczyk added a commit to lslusarczyk/llvm that referenced this pull request Sep 21, 2024
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