Skip to content

Add MIBC output mode to maui profile startup#100

Merged
jfversluis merged 12 commits into
dotnet:mainfrom
simonrozsival:feature/maui-profile-mibc
Apr 24, 2026
Merged

Add MIBC output mode to maui profile startup#100
jfversluis merged 12 commits into
dotnet:mainfrom
simonrozsival:feature/maui-profile-mibc

Conversation

@simonrozsival
Copy link
Copy Markdown
Member

Follow-up to #60.

Summary

  • add a new maui profile startup --format mibc flow
  • install or build dotnet-pgo on demand and convert the collected .nettrace into a reusable .mibc profile
  • enable the richer runtime/provider configuration needed for dynamic PGO data during Android startup tracing
  • improve startup trace finalization and launch sequencing so the trace survives Ctrl+C and avoids the dsrouter startup race

Validation

  • dotnet test src/Cli/Microsoft.Maui.Cli.UnitTests/Microsoft.Maui.Cli.UnitTests.csproj
  • end-to-end run against ~/Downloads/TestDummy/TestDummy.csproj producing .nettrace, .etlx, and .mibc outputs

simonrozsival and others added 11 commits April 17, 2026 14:21
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>
Copilot AI review requested due to automatic review settings April 17, 2026 12:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 mibc support, including .nettrace.mibc conversion and reference assembly resolution.
  • Add on-demand dotnet-pgo installation/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.

Comment thread src/Cli/Microsoft.Maui.Cli/Utils/ProcessRunner.cs
Comment thread src/Cli/Microsoft.Maui.Cli/Utils/ProcessRunner.cs
Comment thread src/Cli/Microsoft.Maui.Cli/Commands/ProfileCommand.cs Outdated
Comment thread src/Cli/Microsoft.Maui.Cli.UnitTests/ProfileCommandTests.cs Outdated
Comment thread src/Cli/Microsoft.Maui.StartupProfiling/README.md Outdated
Comment thread src/Cli/Microsoft.Maui.Cli/Utils/DotnetPgoInstaller.cs Outdated
@simonrozsival simonrozsival changed the title feat: add MIBC output mode to maui profile startup feat: add MIBC output mode to maui profile startup Apr 17, 2026
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>
@simonrozsival
Copy link
Copy Markdown
Member Author

@jfversluis please take a look when you have time

@simonrozsival simonrozsival changed the title feat: add MIBC output mode to maui profile startup Add MIBC output mode to maui profile startup Apr 24, 2026
Copy link
Copy Markdown
Member

@jfversluis jfversluis left a comment

Choose a reason for hiding this comment

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

Congratulations on PR 100!

@jfversluis jfversluis merged commit d96f887 into dotnet:main Apr 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants