@@ -284,7 +284,7 @@ var labelsOnce sync.Once
284284// subbenchmarks. b must not have subbenchmarks.
285285func (b * B ) run () {
286286 labelsOnce .Do (func () {
287- fmt .Fprintf (b .w , "Running with CodSpeed (mode: walltime )\n " )
287+ fmt .Fprintf (b .w , "Running with CodSpeed (mode: %s )\n " , getCodspeedRunnerMode () )
288288
289289 fmt .Fprintf (b .w , "goos: %s\n " , runtime .GOOS )
290290 fmt .Fprintf (b .w , "goarch: %s\n " , runtime .GOARCH )
@@ -347,8 +347,9 @@ func (b *B) launch() {
347347 // b.Loop does its own ramp-up logic so we just need to run it once.
348348 // If b.loop.n is non zero, it means b.Loop has already run.
349349 if b .loop .n == 0 {
350- // Run the benchmark for at least the specified amount of time.
351- if b .benchTime .n > 0 {
350+ if isAnalysisMode () {
351+ runBenchmarkSingle (b )
352+ } else if b .benchTime .n > 0 {
352353 // We already ran a single iteration in run1.
353354 // If -benchtime=1x was requested, use that result.
354355 // See https://golang.org/issue/32051.
@@ -421,7 +422,9 @@ func (b *B) loopSlowPath() bool {
421422
422423 if b .loop .n == 0 {
423424 // It's the first call to b.Loop() in the benchmark function.
424- if b .benchTime .n > 0 {
425+ if isAnalysisMode () {
426+ b .loop .n = 1
427+ } else if b .benchTime .n > 0 {
425428 // Fixed iteration count.
426429 b .loop .n = uint64 (b .benchTime .n )
427430 } else {
@@ -442,7 +445,9 @@ func (b *B) loopSlowPath() bool {
442445
443446 // Should we keep iterating?
444447 var more bool
445- if b .benchTime .n > 0 {
448+ if isAnalysisMode () {
449+ more = false
450+ } else if b .benchTime .n > 0 {
446451 // The iteration count is fixed, so we should have run this many and now
447452 // be done.
448453 if b .loop .i != uint64 (b .benchTime .n ) {
0 commit comments