It isn't currently possible to profile startup code using dotnet-trace as there's currently no way to suspend the runtime till a client has connected to EventPipe.
This is a regression in functionality compared to the controller file mechanism in 2.x that allowed profiling startup code.