git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Christian Couder <chriscool@tuxfamily.org>
To: git@vger.kernel.org
Subject: [PATCH v2 7/9] perf/run: add run_subsection()
Date: Sat, 23 Sep 2017 19:55:56 +0000	[thread overview]
Message-ID: <0102015eb04f8a12-84068e82-d13c-48d5-8147-3525b95a5481-000000@eu-west-1.amazonses.com> (raw)
In-Reply-To: <0102015eb04f8927-439213ae-a464-4638-affa-f0d6484086c0-000000@eu-west-1.amazonses.com>

Let's actually use the subsections we find in the config file
to run the perf tests separately for each subsection.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 t/perf/run | 47 +++++++++++++++++++++++++++++++++++------------
 1 file changed, 35 insertions(+), 12 deletions(-)

diff --git a/t/perf/run b/t/perf/run
index bd39398b9cc7d..cb8687bfcf98d 100755
--- a/t/perf/run
+++ b/t/perf/run
@@ -125,23 +125,46 @@ get_var_from_env_or_config () {
 	test -n "${4+x}" && eval "$env_var=\"$4\""
 }
 
-get_var_from_env_or_config "GIT_PERF_REPEAT_COUNT" "perf" "repeatCount" 3
-export GIT_PERF_REPEAT_COUNT
+run_subsection () {
+	get_var_from_env_or_config "GIT_PERF_REPEAT_COUNT" "perf" "repeatCount" 3
+	export GIT_PERF_REPEAT_COUNT
 
-get_var_from_env_or_config "GIT_PERF_DIRS_OR_REVS" "perf" "dirsOrRevs"
-set -- $GIT_PERF_DIRS_OR_REVS "$@"
+	get_var_from_env_or_config "GIT_PERF_DIRS_OR_REVS" "perf" "dirsOrRevs"
+	set -- $GIT_PERF_DIRS_OR_REVS "$@"
 
-get_var_from_env_or_config "GIT_PERF_MAKE_COMMAND" "perf" "makeCommand"
-get_var_from_env_or_config "GIT_PERF_MAKE_OPTS" "perf" "makeOpts"
+	get_var_from_env_or_config "GIT_PERF_MAKE_COMMAND" "perf" "makeCommand"
+	get_var_from_env_or_config "GIT_PERF_MAKE_OPTS" "perf" "makeOpts"
 
-GIT_PERF_AGGREGATING_LATER=t
-export GIT_PERF_AGGREGATING_LATER
+	GIT_PERF_AGGREGATING_LATER=t
+	export GIT_PERF_AGGREGATING_LATER
+
+	if test $# = 0 -o "$1" = -- -o -f "$1"; then
+		set -- . "$@"
+	fi
+
+	run_dirs "$@"
+	./aggregate.perl "$@"
+}
 
 cd "$(dirname $0)"
 . ../../GIT-BUILD-OPTIONS
 
-if test $# = 0 -o "$1" = -- -o -f "$1"; then
-	set -- . "$@"
+mkdir -p test-results
+get_subsections "perf" >test-results/run_subsections.names
+
+if test $(wc -l <test-results/run_subsections.names) -eq 0
+then
+	(
+		run_subsection "$@"
+	)
+else
+	while read -r subsec
+	do
+		(
+			GIT_PERF_SUBSECTION="$subsec"
+			export GIT_PERF_SUBSECTION
+			echo "======== Run for subsection '$GIT_PERF_SUBSECTION' ========"
+			run_subsection "$@"
+		)
+	done <test-results/run_subsections.names
 fi
-run_dirs "$@"
-./aggregate.perl "$@"

--
https://github.com/git/git/pull/408

  parent reply	other threads:[~2017-09-23 19:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAP8UFD3tG3fOgftFJAB4mKD2N+uAH0aac4RmFmdXZ=ORHmKzQQ@mail.gmail.com>
2017-09-23 19:55 ` [PATCH v2 1/9] perf/run: add '--config' option to the 'run' script Christian Couder
2017-09-23 19:55   ` [PATCH v2 8/9] perf/run: show name of rev being built Christian Couder
2017-09-23 19:55   ` [PATCH v2 5/9] perf/run: add get_subsections() Christian Couder
2017-09-23 19:55   ` [PATCH v2 3/9] perf/run: add GIT_PERF_DIRS_OR_REVS Christian Couder
2017-09-23 19:55   ` [PATCH v2 2/9] perf/run: add get_var_from_env_or_config() Christian Couder
2017-09-23 19:55   ` [PATCH v2 9/9] perf: store subsection results in "test-results/$GIT_PERF_SUBSECTION/" Christian Couder
2017-09-23 19:55   ` Christian Couder [this message]
2017-09-23 19:55   ` [PATCH v2 4/9] perf/run: add calls to get_var_from_env_or_config() Christian Couder
2017-09-23 19:55   ` [PATCH v2 6/9] perf/run: update get_var_from_env_or_config() for subsections Christian Couder
2017-10-16  5:25   ` [PATCH v2 1/9] perf/run: add '--config' option to the 'run' script Junio C Hamano
2017-11-17  7:58     ` Christian Couder
2017-11-24 10:28     ` Ævar Arnfjörð Bjarmason
2017-10-18 10:58   ` Kevin Daudt
2017-10-18 21:25     ` Christian Couder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0102015eb04f8a12-84068e82-d13c-48d5-8147-3525b95a5481-000000@eu-west-1.amazonses.com \
    --to=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).