Retry: Enable EventPipe across Unix and Windows #15611
Conversation
…" (dotnet#15609)" This reverts commit 302005c.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LTGM modulo addressing the build and test issues that were found on x64 Pri1 and ARM.
arm build failing with:
|
Revert fixed the ETW failures https://github.com/dotnet/coreclr/issues/15607 @dotnet-bot test Windows_NT x64 Checked corefx_baseline |
@dotnet-bot test Windows_NT pri1 please |
https://github.com/dotnet/coreclr/issues/15607 occurs again
|
Thanks @benaadams I'm working on it |
FYI there's also https://github.com/dotnet/coreclr/issues/15537 in the errors for the run which is definitely unrelated |
@dotnet-bot test Windows_NT x64 Checked corefx_baseline |
@dotnet-bot test Windows_NT x64 Checked corefx_baseline |
The change originally causing #15607, is that I enabled FeaturePerfTracing in the managed areas, assuming it would be a purely additive and compatible change. I have since figured out that certain places within managed code treat the use of EventPipe and EventListener logging as mutually exclusive, and will require work to make both usable at once. In order to avoid expanding this PR further, I am opening https://github.com/dotnet/coreclr/issues/15656 and disabling tests which require use of the EventPipe's managed surface. |
@jkotas could you please kick off the ARM builds? |
@dotnet-bot test Ubuntu arm Cross Debug Innerloop Build please |
@dotnet-bot test Windows_NT x64 Checked corefx_baseline |
@BruceForstall @jkotas @benaadams all the concerns (Failures in ARM builds, failures in pri1 Windows builds, failed corefx tests, and erroneously introduced python2.7 dependency) of this PR's first iteration have been addressed. With your signoff I'll merge this PR. |
@@ -15,12 +15,12 @@ internal struct EventPipeProviderConfiguration | |||
[MarshalAs(UnmanagedType.LPWStr)] | |||
private string m_providerName; | |||
private UInt64 m_keywords; | |||
private uint m_loggingLevel; | |||
private UInt32 m_loggingLevel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Our convention is to use language keywords instead of BCL types (i.e. int, string, float instead of Int32, String, Single, etc). https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/coding-style.md . So this should have been rather changed other way around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was changed to fix a marshalling error on x86. Is there perhaps another solution to the marshalling error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not see how changing uint
to UInt32
can fix marshalling error in this file. uint
and UInt32
are different names for the same thing in C#. It is just a matter of style convention which one to use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same with long
and Int64
. These are also different names for the same thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the commit which fixed the marshalling error. If those are irrelevant, what fixed it?
Just the changes in the C++ side?
97d5c0b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the changes in the C++ side?
I think so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright. I'll try reverting the changes to the C# code and test this again
@@ -0,0 +1,108 @@ | |||
from filecmp import dircmp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
License header?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added now. Thanks
Add to PR summary Resolves https://github.com/dotnet/coreclr/issues/15607 Then should auto close on merge? |
@dotnet-bot test Windows_NT arm Cross Checked Innerloop Build and Test |
@nategraf If you can, you should avoid pushing any changes until the jobs I triggered finished, otherwise we'll lose their results and they'll need to get re-triggered. |
If you click on the ❌ or ✔ next to commit hash in between comments you can see any old results |
Jitstress2
Jitstress1
Do you think these failures could be related to these changes, or might they be unrelated? |
@nategraf Looks like those armlb failures have been occurring for a while. You can ignore them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some questions about the build.cmd changes
build.cmd
Outdated
set __IntermediatesIncDir=%__IntermediatesDir%\src\inc | ||
set __IntermediatesEventingDir=%__IntermediatesDir%\eventing | ||
|
||
echo Laying out dynamically generated files consumed by the build system |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate you have these "echo" status messages. Can you please make sure they all start with echo %__MsgPrefix%
, so we know where the message came from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in %__MsgPrefix%
build.cmd
Outdated
%PYTHON% -B -Wall %__SourceDir%\scripts\genEventing.py --inc %__IntermediatesIncDir% --dummy %__IntermediatesIncDir%\etmdummy.h --man %__SourceDir%\vm\ClrEtwAll.man --nonextern || exit /b 1 | ||
|
||
echo Laying out dynamically generated EventPipe Implementation | ||
%PYTHON% -B -Wall %__SourceDir%\scripts\genEventPipe.py --man %__SourceDir%\vm\ClrEtwAll.man --intermediate %__IntermediatesEventingDir%\eventpipe --nonextern || exit /b 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If one of the python scripts fails, will it output an appropriate error message, so we know what failed? Because you're going to immediate exit the build script with no additional error message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It lets python print out the stack trace like normal
@@ -380,6 +390,45 @@ for /f "tokens=*" %%s in ('%DotNetCli% msbuild "%OptDataProjectFilePath%" /t:Dum | |||
set __IbcOptDataVersion=%%s | |||
) | |||
|
|||
REM ========================================================================================= | |||
REM === | |||
REM === Generate source files for eventing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This phase looks unconditional, whether we're building native, corelib, etc. Is that appropriate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take another look at what types of builds actually need these files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured out better conditioning. Thanks for catching this
@@ -380,6 +390,45 @@ for /f "tokens=*" %%s in ('%DotNetCli% msbuild "%OptDataProjectFilePath%" /t:Dum | |||
set __IbcOptDataVersion=%%s | |||
) | |||
|
|||
REM ========================================================================================= | |||
REM === | |||
REM === Generate source files for eventing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this affect incremental build? If I run "build.cmd" twice in a row, will it generate new files that will cause the subsequent builds to build things they shouldn't need to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. I created a utility which ensures files are only written if the copy on disk is different
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build.cmd changes look good to me. I don't have any comments on the rest of it.
@dotnet-bot test Ubuntu arm Cross Debug Innerloop Build please |
This commit is breaking the build for people who keep their pythons in directories named "C:\Program Files". The pathname needs to be quoted. |
btw, seems that it also fixed ICorProfilerInfo::ForceGC on macOS because it always returned E_FAIL w/o FEATURE_EVENT_TRACE: https://github.com/dotnet/coreclr/blob/v1.1.13/src/vm/proftoeeinterfaceimpl.cpp#L4825 |
This PR Enables the native components of EventPipe and SampleProfiler to be used on Unix and Windows (expanded from only Linux).
The two largest components are the creation of native interfaces to ETW which match those used to LTTng, and the fixing of contracts within EventPipe code. Additionally bug fixes, build changes, and modification to the SampleProfiler were done to address errors and enable windows builds
Follow-up #14772
Resolves #15607