summaryrefslogtreecommitdiffhomepage
path: root/test/benchmarks/harness/util.go
diff options
context:
space:
mode:
authorZach Koopmans <zkoopmans@google.com>2020-11-10 21:18:57 -0800
committergVisor bot <gvisor-bot@google.com>2020-11-10 21:20:52 -0800
commit792cbc06de41f226f76f55a828dfcfad9b8fb16e (patch)
tree64b37ecff27afb83ad0b0533085308ea0c3239bb /test/benchmarks/harness/util.go
parent7f2183df9c529790cd99d31a185ae4ddd5f355c6 (diff)
Add debug logs to startup benchmark.
PiperOrigin-RevId: 341757694
Diffstat (limited to 'test/benchmarks/harness/util.go')
-rw-r--r--test/benchmarks/harness/util.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/benchmarks/harness/util.go b/test/benchmarks/harness/util.go
index 86b863f78..aeac7ebff 100644
--- a/test/benchmarks/harness/util.go
+++ b/test/benchmarks/harness/util.go
@@ -18,6 +18,7 @@ import (
"context"
"fmt"
"net"
+ "testing"
"gvisor.dev/gvisor/pkg/test/dockerutil"
"gvisor.dev/gvisor/pkg/test/testutil"
@@ -46,3 +47,11 @@ func DropCaches(machine Machine) error {
}
return nil
}
+
+// DebugLog prints debug messages if the debug flag is set.
+func DebugLog(b *testing.B, msg string, args ...interface{}) {
+ b.Helper()
+ if *debug {
+ b.Logf(msg, args...)
+ }
+}