From 5d08a59813201143d3efe103c2265c56ff6270c8 Mon Sep 17 00:00:00 2001 From: Etienne Perot Date: Tue, 16 Aug 2022 17:03:48 -0700 Subject: [PATCH] Makefile: Add option to not benchmark `runc`. This is useful when wanting to run benchmarks in a way where the output can be captured to a file, such that this file only contains one platform's specific performance data. PiperOrigin-RevId: 468061772 --- Makefile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 21b19933d..a0e4dd1ab 100644 --- a/Makefile +++ b/Makefile @@ -366,6 +366,7 @@ containerd-tests: containerd-test-1.6.0 ## BENCHMARKS_OFFICIAL - marks the data as official. ## BENCHMARKS_PLATFORMS - if set, only run the benchmarks for this ## space-separated list of platform names. +## BENCHMARKS_RUNC - if true, also benchmark runc performance. ## BENCHMARKS_FILTER - filter to be applied to the test suite. ## BENCHMARKS_OPTIONS - options to be passed to the test. ## BENCHMARKS_PROFILE - profile options to be passed to the test. @@ -376,12 +377,13 @@ BENCHMARKS_TABLE ?= benchmarks BENCHMARKS_SUITE ?= ffmpeg BENCHMARKS_UPLOAD ?= false BENCHMARKS_OFFICIAL ?= false -BENCHMARKS_TARGETS := //test/benchmarks/media:ffmpeg_test +BENCHMARKS_TARGETS ?= //test/benchmarks/media:ffmpeg_test BENCHMARKS_PLATFORMS ?= -BENCHMARKS_FILTER := . -BENCHMARKS_OPTIONS := -test.benchtime=30s -BENCHMARKS_ARGS := -test.v -test.bench=$(BENCHMARKS_FILTER) $(BENCHMARKS_OPTIONS) -BENCHMARKS_PROFILE := -pprof-dir=/tmp/profile -pprof-cpu -pprof-heap -pprof-block -pprof-mutex +BENCHMARKS_RUNC ?= true +BENCHMARKS_FILTER ?= . +BENCHMARKS_OPTIONS ?= -test.benchtime=30s +BENCHMARKS_ARGS ?= -test.v -test.bench=$(BENCHMARKS_FILTER) $(BENCHMARKS_OPTIONS) +BENCHMARKS_PROFILE ?= -pprof-dir=/tmp/profile -pprof-cpu -pprof-heap -pprof-block -pprof-mutex init-benchmark-table: ## Initializes a BigQuery table with the benchmark schema. @$(call run,//tools/parsers:parser,init --project=$(BENCHMARKS_PROJECT) --dataset=$(BENCHMARKS_DATASET) --table=$(BENCHMARKS_TABLE)) @@ -413,7 +415,9 @@ benchmark-platforms: load-benchmarks $(RUNTIME_BIN) ## Runs benchmarks for runc $(call run_benchmark,$${PLATFORM}); \ done; \ fi - @$(call run_benchmark,runc) + @set -xe; if test "$(BENCHMARKS_RUNC)" == true; then \ + $(call run_benchmark,runc); \ + fi .PHONY: benchmark-platforms run-benchmark: load-benchmarks ## Runs single benchmark and optionally sends data to BigQuery.