From 792cbc06de41f226f76f55a828dfcfad9b8fb16e Mon Sep 17 00:00:00 2001 From: Zach Koopmans Date: Tue, 10 Nov 2020 21:18:57 -0800 Subject: Add debug logs to startup benchmark. PiperOrigin-RevId: 341757694 --- test/benchmarks/harness/util.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/benchmarks/harness/util.go') 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...) + } +} -- cgit v1.2.3