diff options
Diffstat (limited to 'test/benchmarks/harness/util.go')
-rw-r--r-- | test/benchmarks/harness/util.go | 9 |
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...) + } +} |