Disable PerfMap generation for Apple mobile platforms#121237
Disable PerfMap generation for Apple mobile platforms#121237kotlarmilos merged 4 commits intodotnet:mainfrom
Conversation
|
Tagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @steveisok, @akoeplinger |
|
/cc: @jkoritzinsky Please let me know if this is good approach |
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for Apple platform variants to the PerfMap writer by mapping additional Darwin-based operating systems (MacCatalyst, iOS, iOSSimulator, tvOS, tvOSSimulator) to the existing OSX PerfMapOSToken.
Key Changes
- Maps five additional Apple platform variants to
PerfMapOSToken.OSXin the switch expression
Comments suppressed due to low confidence (1)
src/coreclr/tools/aot/ILCompiler.Diagnostics/PerfMapWriter.cs:126
- The switch expression is now missing a case for
TargetOS.WebAssemblywhich exists in the TargetOS enum (defined in src/coreclr/tools/Common/TypeSystem/Common/TargetDetails.cs). This will cause a NotImplementedException at runtime when WebAssembly is used as the target OS. Add a case for TargetOS.WebAssembly with an appropriate PerfMapOSToken mapping, or add test coverage to ensure all TargetOS values are handled.
PerfMapOSToken osToken = details.OperatingSystem switch
{
TargetOS.Unknown => PerfMapOSToken.Unknown,
TargetOS.Windows => PerfMapOSToken.Windows,
TargetOS.Linux => PerfMapOSToken.Linux,
TargetOS.OSX => PerfMapOSToken.OSX,
TargetOS.MacCatalyst => PerfMapOSToken.OSX,
TargetOS.iOS => PerfMapOSToken.OSX,
TargetOS.iOSSimulator => PerfMapOSToken.OSX,
TargetOS.tvOS => PerfMapOSToken.OSX,
TargetOS.tvOSSimulator => PerfMapOSToken.OSX,
TargetOS.FreeBSD => PerfMapOSToken.FreeBSD,
TargetOS.NetBSD => PerfMapOSToken.NetBSD,
TargetOS.SunOS => PerfMapOSToken.SunOS,
_ => throw new NotImplementedException(details.OperatingSystem.ToString())
};
|
Shall we make match or maybe dedup them if possible? |
|
The PerfMap constants are part of the PerfMap format, so any changes would require versioning the format, which isn't worth doing for this case (especially as this format doesn't really make sense in this scenario) |
Should the right fix be to disable perfmap generation in these scenarios instead then? |
|
The right fix would be to disable generation on the consumer side (ie don't pass the flag to emit PerfMaps). Then we could block passing the flag to emit them for these platforms. The iOS perf tests for CoreCLR aren't well configured at the moment though if they're hitting this. They're requesting ReadyToRun image generation even though it doesn't work as-is. |
@kotlarmilos Can we do that instead this change? |
am11
left a comment
There was a problem hiding this comment.
PR title can be now changed to Disable PerfMap generation for Apple mobile platforms.
There was a problem hiding this comment.
@jkoritzinsky,, can we dedup this targets with https://github.com/dotnet/sdk/blob/7538a89c176527c27767a85bdfe0afacef9edeb3/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.CrossGen.targets? Ideally there should be a single source of truth (like @ViktorHofer did for RID graph #92211).
There was a problem hiding this comment.
I assume these changes should be ported to the SDK repo (if not dedup-ed)
There was a problem hiding this comment.
There was a problem hiding this comment.
@jkoritzinsky Should this be upstreamed to the SDK, or is there a way to deduplicate it?
There was a problem hiding this comment.
@kotlarmilos note that if you upstream this then you can't use TargetOS since that property is only set in our build.
There was a problem hiding this comment.
I do agree we should upstream this though, using TargetPlatformIdentifier, and set the PublishReadyToRunEmitSymbols in our build to false for Apple mobile
|
/azp run runtime-ioslike |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/ba-g Android queue timeouts dotnet/dnceng#3008 |
Description
After #121187 Crossgen2 determines cross-compilation targets by reading Crossgen2Tool.GetMetadata(MetadataKeys.TargetOS). This code path triggers PerfMapWriter, which currentl doesn't support iOS targets. This PR disables PerfMap generation for Apple mobile platforms.