feat(cli): allow to profile benchmarks
@@ -381,8 +381,14 @@ func (c *App) currentActionName() string {
func (c *App) noRepositoryAction(act func(ctx context.Context) error) func(ctx *kingpin.ParseContext) error {
return func(kpc *kingpin.ParseContext) error {
return c.runAppWithContext(kpc.SelectedCommand, func(ctx context.Context) error {
+ return c.pf.withProfiling(func() error {
+ if c.dumpAllocatorStats {
+ defer gather.DumpStats(ctx)
+ }
+
return act(ctx)
})
+ })
}
}
