-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Enable XplatEventLogger on all non-Windows platforms #3879
Conversation
@manu-silicon Could you please take a look at the OSX build break? Looks like the condition for |
@jkotas Just pushed a change to always include |
LGTM. Could you please squash into single commit? |
Squashed. |
Hey instead of this big change, you can just conditionally turn on FEATURE_EVENTSOURCE_XPLAT in the VM for non windows, This would keep the feature self contained |
Correct me if i am wrong, this would not have raised if we had ways to trun off features for different flavors of linux in mscorlib |
The issue was that on Linux ARM mscorlib assumed that Xplat was available but the native part had been disabled due to poor support (see #2824). And indeed if we could have turned on/off some features in mscorlib, it would have matched the native part and there would not have been an issue. |
That is exactly the above mentioned solution would do, instead of matching mscorlib to native, we would be changing native to match mscorlib ,only for this instance needs to be moved out of |
Yes, that would work too - but it would required keeping the managed and unmanaged settings in sync somehow. The typical approach taken in corefx is to build the managed code general purpose, and have the fine-grained differences in unmanaged C++ wrappers only. Here is one example from many: https://github.com/dotnet/corefx/blob/1db0c74f3f525365c2573458aa1f454cacf00453/src/Native/System.Security.Cryptography.Native/pal_ssl.cpp#L49. This corefx approach make it easier to maintain different configurations. It is why I have suggested it here as well. |
I see - you are basically suggesting to use |
Ok, it makes sense from that point of view, although composition is lost. |
The reason behind is FEATURE_EVENTSOURCE_XPLAT is to compose functionality for logging EventSource Events distinctly from ETW period. This could potentially be reused on windows too [ not gonna happen- but still saying] FEATURE_PAL implies non windows to be exact For the record - I would like to keep FEATURE_EVENTSOURCE_XPLAT, as it a nice way to turn of the feature. If the current change is going to be merged,please clean all usages of FEATURE_EVENTSOURCE_XPLAT, as it no longer makes any sense |
Ok. @manu-silicon Could you please make these changes:
Sorry about the back and forth on this one... |
The ifdef for real implementation vs. the dummy implementation in |
@jkotas Thanks for the clarification. I'll have a second pass at it tomorrow. |
by turning on FEATURE_EVENTSOURCE_XPLAT for all Linux, you do not need to have dummy implementation anywhere, this was the case when the feature got checked in, the current status is due to consolidation from this change dd9c20c in CMakeLists.txt [The piece I pointed above] |
I think you still need to have the dummy implementation even when |
Almost all of the functionality defined by FEATURE_EVENT_TRACE and not used by FEATURE_EVENTSOURCE_XPLAT should have dummy default implementations already if it is not defined. |
74aa690
to
89d31c6
Compare
@jkotas @ramarag Here is my latest take on the matter. Compared to the original code, the only change is that now you can disable FEATURE_EVENTSOURCE_XPLAT when FEATURE_EVENT_TRACE is enabled, which was not possible before. However, disabling FEATURE_EVENT_TRACE on Unix requires the set of changes I made originally if we do not want to change the way mscorlib is compiled. So I gave up doing that, which means that if someone disable it in CMakeLists.txt, it has to disable it in mscorlib too. Let me know what you think. |
@@ -408,13 +408,17 @@ class BulkStaticsLogger | |||
|
|||
#endif // __EVENTTRACEPRIV_H__ | |||
|
|||
#if defined(FEATURE_EVENTSOURCE_XPLAT) | |||
#if defined(FEATURE_EVENT_TRACE) |
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 think this should stay FEATURE_EVENTSOURCE_XPLAT
Please let me know if there is anything that I am missing... |
@prajwal-aithal , Could you please test this one? (Me and @leemgs are away for a week and cannot test ARM devices) |
The OSX build is failing. The problem is that FEATURE_EVENTSOURCE_XPLAT has to be defined for Unix unconditionally in the root CMakefile.txt. |
You mean regardless of the value of FEATURE_EVENT_TRACE?
|
Do you mean having something like that in the CMakeLists.txt
? I just tried on my Mac and it works. I did not test if that would work for arm but will try tomorrow. |
Yes, exactly that. |
I pushed the changes. It works for me on Mac and Linux ARM. Did not test anything else. |
If it is not too much too ask can you build on top of ramarag@84a8d4d ? |
@ramarag I would like to get this done in steps. Make one small step to get it working - because of there are people waiting for this, and then work on better factoring. The implementation of the event tracing is very entangled and the history of this PR shows that it is hard to do bigger steps here (e.g. there are still build breaks). |
@@ -412,9 +412,13 @@ class BulkStaticsLogger | |||
class XplatEventSourceLogger | |||
{ | |||
public: | |||
#ifdef FEATURE_EVENT_TRACE |
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 conditional compilation is done for FireEtw* and XplatEventLogger::IsEventLoggingEnabled under the hoods. If it is not pressing to check in the change as it is please do look to build on top of ramarag@84a8d4d
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.
Do you mean compiling just your commit? or Mine and yours combined?
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.
With your commit, it seems to work.
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 i meant add your changes on top of ramarag/coreclr@84a8d4d
@manu-silicon The global CMakefile is sensitive to order in which things are defined. You have moved them earlier and it broke the build. Could you please keep it where it was, and just tweak the ifdef? |
@jkotas I wanted to put them together. I've pushed the change |
@dotnet-bot test Ubuntu x64 Checked Build and Test please |
@manu-silicon I am sorry - I have just merged a number of other PRs while the CI was running on this one, and it has conflict now. Could you please resolve it? |
@ramarag I have created issue #4403 about the cleanup that you are suggesting. |
@jkotas Just pushed the changed. |
Because on non-Windows platform, we assume event tracing, we also requires it to compile native code for non-Windows platform. Event tracing is only enabled on AMD64 devices for now on Unix platforms.
@dotnet-bot test Ubuntu x64 Checked Build and Test please |
@manu-silicon Thank you for all work you have put into this one! |
@manu-silicon : i have updated the changes to ramarag@0ec237e |
Enable XplatEventLogger on all non-Windows platforms Commit migrated from dotnet/coreclr@0eff733
Ensure that even if FEATURE_EVENTSOURCE_XPLAT is not defined it, the
implementation provides a dummy implementation. This is required because
mscorlib defines FEATURE_EVENTSOURCE_XPLAT even if this is not supported
by the underlying platform.