diff options
author | Zach Koopmans <zkoopmans@google.com> | 2020-07-27 10:06:07 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-07-27 10:10:14 -0700 |
commit | 77552f1c770da7413c3c8212443328c9081901c0 (patch) | |
tree | 312b96012165958d9a0721aba07f5159127f7406 /test/benchmarks/harness | |
parent | 29e5609b228363bcc435a8828f9b6ee19018a525 (diff) |
Port ffmpeg benchmark
PiperOrigin-RevId: 323383320
Diffstat (limited to 'test/benchmarks/harness')
-rw-r--r-- | test/benchmarks/harness/util.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/benchmarks/harness/util.go b/test/benchmarks/harness/util.go index eda2eeffb..bc551c582 100644 --- a/test/benchmarks/harness/util.go +++ b/test/benchmarks/harness/util.go @@ -36,3 +36,11 @@ func WaitUntilServing(ctx context.Context, machine Machine, server net.IP, port }, "sh", "-c", cmd) return err } + +// DropCaches drops caches on the provided machine. Requires root. +func DropCaches(machine Machine) error { + if out, err := machine.RunCommand("/bin/sh", "-c", "sync | sysctl vm.drop_caches=3"); err != nil { + return fmt.Errorf("failed to drop caches: %v logs: %s", err, out) + } + return nil +} |