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

EventPipe support for ProcessInfo #87562

Merged
merged 10 commits into from
Jul 14, 2023
Merged

EventPipe support for ProcessInfo #87562

merged 10 commits into from
Jul 14, 2023

Conversation

LakshanF
Copy link
Member

Missing process information - work by @elinor-fung to support commandLine and added managedEntrypointAssemblyName. Enabled the existing diagnostic tests related to this.

@ghost
Copy link

ghost commented Jun 14, 2023

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

Issue Details

Missing process information - work by @elinor-fung to support commandLine and added managedEntrypointAssemblyName. Enabled the existing diagnostic tests related to this.

Author: LakshanF
Assignees: -
Labels:

area-Diagnostics-coreclr

Milestone: -

@ghost
Copy link

ghost commented Jun 14, 2023

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

Missing process information - work by @elinor-fung to support commandLine and added managedEntrypointAssemblyName. Enabled the existing diagnostic tests related to this.

Author: LakshanF
Assignees: LakshanF
Labels:

area-Diagnostics-coreclr, area-NativeAOT-coreclr

Milestone: -

@LakshanF LakshanF added this to the 8.0.0 milestone Jun 14, 2023
@LakshanF LakshanF marked this pull request as draft June 14, 2023 16:48
@LakshanF LakshanF marked this pull request as ready for review June 15, 2023 20:33
if (PalInterlockedCompareExchangePointer((void**)(&entrypoint_assembly_name), (void*)(entrypoint_assembly_name_local), nullptr) != nullptr)
delete[] entrypoint_assembly_name_local;
}
return reinterpret_cast<const char*>(entrypoint_assembly_name);
Copy link
Member

Choose a reason for hiding this comment

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

Is always returning the process name (minus extension) what we want? So if someone renames the executable or if someone uses a nativeaot library, they would get the name of the process which would not match the assembly.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think for the first iteration, using the process name without extension is fine. We can enhance if user feedback requests this.

src/coreclr/nativeaot/Runtime/eventpipe/ep-rt-aot.cpp Outdated Show resolved Hide resolved
Comment on lines 113 to 121
const wchar_t* process_name_const = wcsrchr(wszModuleFileName, DIRECTORY_SEPARATOR_CHAR);
if (process_name_const != NULL) {
process_name_const++;
}
size_t len = -1;
const wchar_t* extension = wcsrchr(process_name_const, '.');
if (extension != NULL) {
len = extension - process_name_const;
}
Copy link
Member

Choose a reason for hiding this comment

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

You could define something like _tcslen / _tcsrchr based on the platform and then share this logic for finding the start of the name and its length.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added this to the tracking issue, #87069

src/coreclr/nativeaot/Runtime/eventpipe/ep-rt-aot.cpp Outdated Show resolved Hide resolved
src/coreclr/nativeaot/Runtime/eventpipe/ep-rt-aot.cpp Outdated Show resolved Hide resolved
@LakshanF LakshanF merged commit 9cf89bf into dotnet:main Jul 14, 2023
165 of 171 checks passed
@ghost ghost locked as resolved and limited conversation to collaborators Aug 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants