Add MIBC output mode to maui profile startup#100
Merged
jfversluis merged 12 commits intoApr 24, 2026
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the richer runtime provider mask and MIBC-specific startup environment so Android startup traces carry real block, edge, and type profile data for dotnet-pgo. Keep the README, installer integration, and tests aligned with the new flow. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Launch the Android app in DiagnosticSuspend mode before starting dotnet-trace so slow deploys do not trip the dsrouter EndOfStream race while waiting for the runtime to appear. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new MIBC output mode to maui profile startup, enabling collection of richer dynamic PGO startup data and converting the resulting .nettrace into a reusable .mibc profile via dotnet-pgo. It also adjusts the launch/trace sequencing and finalization behavior to reduce startup races and better survive user stop signals.
Changes:
- Add
--format mibcsupport, including.nettrace→.mibcconversion and reference assembly resolution. - Add on-demand
dotnet-pgoinstallation/build-from-source flow with live status output. - Improve trace lifecycle and launch sequencing (including retry behavior and post-processing after manual stop).
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Cli/Microsoft.Maui.StartupProfiling/README.md | Documents the new mibc format and dotnet-pgo behavior. |
| src/Cli/Microsoft.Maui.Cli/Utils/ProcessRunner.cs | Adds stdout/stderr streaming callbacks for long-running operations. |
| src/Cli/Microsoft.Maui.Cli/Utils/DotnetPgoInstaller.cs | Implements dotnet-pgo discovery + build-from-source + install with status tailing. |
| src/Cli/Microsoft.Maui.Cli/Output/SpectreOutputFormatter.cs | Minor documentation/comment cleanup around StatusAsync overloads. |
| src/Cli/Microsoft.Maui.Cli/Commands/TraceOutputFormat.cs | Adds Mibc enum value. |
| src/Cli/Microsoft.Maui.Cli/Commands/ProfileTraceOutputValidation.cs | Treats MIBC like other derived formats for output validation rules. |
| src/Cli/Microsoft.Maui.Cli/Commands/ProfileTraceLifecycle.cs | Returns whether the user requested stop to drive post-processing cancellation behavior. |
| src/Cli/Microsoft.Maui.Cli/Commands/ProfileSessionSetup.cs | Enables runtime PGO injection when output format is MIBC. |
| src/Cli/Microsoft.Maui.Cli/Commands/ProfileSessionRunner.cs | Runs MIBC conversion and adjusts cancellation handling after manual stop. |
| src/Cli/Microsoft.Maui.Cli/Commands/ProfileSessionLaunch.cs | Supports starting dotnet-trace after launch (with retry) to avoid dsrouter/connect races. |
| src/Cli/Microsoft.Maui.Cli/Commands/ProfileSessionContext.cs | Introduces StartTraceAfterLaunch decision logic per platform. |
| src/Cli/Microsoft.Maui.Cli/Commands/ProfileOutputResolver.cs | Adds mibc format parsing, prompting, and output path/sidecar behavior. |
| src/Cli/Microsoft.Maui.Cli/Commands/ProfileCommand.cs | Wires in MIBC flow, dotnet-pgo presence check, and conversion step. |
| src/Cli/Microsoft.Maui.Cli/Commands/DotnetTraceRunner.cs | Adds MIBC-specific provider/profile setup and trace-start retry path. |
| src/Cli/Microsoft.Maui.Cli/Build/MauiStartupProfilingInjection.targets | Updates Android/CoreCLR vs Mono runtime error messaging for nettrace/mibc. |
| src/Cli/Microsoft.Maui.Cli.UnitTests/ProfileCommandTests.cs | Adds unit coverage for MIBC format/path logic and dotnet-pgo installer helpers. |
maui profile startup
Use cross-platform .NET path handling for dotnet-pgo and profiling tests, and guard process output callbacks so tool execution remains stable across hosts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
@jfversluis please take a look when you have time |
maui profile startupmaui profile startup
jfversluis
approved these changes
Apr 24, 2026
Member
jfversluis
left a comment
There was a problem hiding this comment.
Congratulations on PR 100!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #60.
Summary
maui profile startup --format mibcflowdotnet-pgoon demand and convert the collected.nettraceinto a reusable.mibcprofileValidation
dotnet test src/Cli/Microsoft.Maui.Cli.UnitTests/Microsoft.Maui.Cli.UnitTests.csproj~/Downloads/TestDummy/TestDummy.csprojproducing.nettrace,.etlx, and.mibcoutputs