From nobody Wed Nov 27 07:32:11 2024 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C16E81D1E63 for ; Fri, 11 Oct 2024 22:04:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728684250; cv=none; b=mp3fwbGRio0fzsHVuxlLBF/ZD4H5Tm+FqBNFrjmKBeO4XyP5BD1w5KQ4OMocDL4oYbPknUQCpfsuHy6iUgNWUa9QlYo4JiyqTpwNDjYkvA9pHmFpYAH6oUY+zBMwx4tVqJg5H1r5KF2Vpt1M6MhvEx6l9Ds5Iw/XZMfZ4uK5/fk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728684250; c=relaxed/simple; bh=32CmiUO1Nu2w18z0VnqAHZyV/SwfhR5oLEkO3QAxKfY=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=WholSniUe72frJP3/E/uZGdQwe2wZWKbF+iAxw5NtwPaETcjgDanqHEZBN0sf1hlQC8wfiwIzXet4UFhuxbo4p/fTZSyl6316NSjgmRZEbRbQ+7siImwNXhecqdTgkrIADP9lsGn1Mjv0dytYOd2SfWt9l1hwH/3imc5w/QcBiw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=XUYiItyV; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="XUYiItyV" Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-e02b5792baaso3507111276.2 for ; Fri, 11 Oct 2024 15:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1728684247; x=1729289047; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=pZqf2//xoOnb1H5/bkKLpMOcQ8vCY8XnITbcBJn/Kk0=; b=XUYiItyVexYmSCGBksEkVp7O9ddScH8lPGOrdlo/WY/drSzJY7RZ1+i1dD+F30A5vv NuTl4IAuwiJNrWnLwK6ZehbGOI5Z937VVkLOwXHrZ5YjKBF2bW6K4WxFSL14Vsj77a4/ ykO00OgomaDsC5r4fyMRpxHKf1jYbSoYawvI/zF6KfkfcDmT3K/qQ0fTiaINIyok3tKa P4tCQQ3glpir6OsLBPvZQGU5cfm8gCoWnnyMeSfFDUMiJkdDSgHIHaV+zFuHUwL3XBQC salC0cUGKhGf1HANZRTZdiukwcYNW5yqdsGJu+lSdFL6SSkjsUqRzzTn1x/COr7+p3oK y2xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728684247; x=1729289047; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pZqf2//xoOnb1H5/bkKLpMOcQ8vCY8XnITbcBJn/Kk0=; b=TebMuGtjteEZ6dBlA5Y9rCH9582bBxhee93tuJdna/oigwVaN0GA4Pd67G9CEfPXf2 p264cOM8r33fhbQifOqkfdR0ixpIasGF6r1N7p7p3ketRMSZEi/6j97zObYExoCqnhxY GP0YVVhz1/2vNbz5SOHdWCbt3Sp14sAaADnXx8/KQWW3XQv5Wrf3RYt70zDv+bBOP21q x/lE6LXDvzlLFOdzz8Wun8fRZRxfQ0xVIKponFqxWxzpckAESPw0R5kHtyc8snwIHHWa YuJ/udchMeL7x780xQwn2Qkvn/o1Cm/M/FKGmmnf6ZVd1lSg5aBu55COI1RLF7/bTz84 t90Q== X-Forwarded-Encrypted: i=1; AJvYcCXH00StyiDa0EG4JuLAQ1WMYw+jgNsCIWyadW+RA0SJX0xapCP6vjVmqTW5m1+cRnbA9bg/DS9pynyV8o0=@vger.kernel.org X-Gm-Message-State: AOJu0YxcCY9bRJTNIpPHLDTE4MVjZBeFOremB4whjNSO74Dv9yTTrBRh xLNkHsQTI2/xs1d7oZZc1IrF4yt/h3A/dFCZszsGXp+cKUApNa4t7bGOvZpA/Zql5lL5HrWy4X1 ycQkORA== X-Google-Smtp-Source: AGHT+IFnQwK3S6BS+70+ID2qAC5s213z8mYXWb6kgkgpvLhH25KIn26m/qM2zLiTiXCF/WTydr0Zy+VcCrx+ X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:8144:56f:2e1e:4db]) (user=irogers job=sendgmr) by 2002:a25:ae8c:0:b0:e25:d596:4847 with SMTP id 3f1490d57ef6-e2919ded25cmr12084276.6.1728684246675; Fri, 11 Oct 2024 15:04:06 -0700 (PDT) Date: Fri, 11 Oct 2024 15:03:47 -0700 In-Reply-To: <20241011220354.756798-1-irogers@google.com> Message-Id: <20241011220354.756798-2-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241011220354.756798-1-irogers@google.com> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog Subject: [PATCH v2 1/8] tools subcmd: Add non-waitpid check_if_command_finished() From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , James Clark , Howard Chu , Athira Jajeev , Michael Petlan , Veronika Molnarova , Dapeng Mi , Thomas Richter , Ilya Leoshkevich , Colin Ian King , Weilin Wang , Andi Kleen , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Using waitpid can cause stdout/stderr of the child process to be lost. Use Linux's /prod//status file to determine if the process has reached the zombie state. Use the 'status' file rather than 'stat' to avoid issues around skipping the process name. Tested-by: James Clark Signed-off-by: Ian Rogers --- tools/lib/subcmd/run-command.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tools/lib/subcmd/run-command.c b/tools/lib/subcmd/run-command.c index 4e3a557a2f37..0a764c25c384 100644 --- a/tools/lib/subcmd/run-command.c +++ b/tools/lib/subcmd/run-command.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -217,8 +218,40 @@ static int wait_or_whine(struct child_process *cmd, bo= ol block) =20 int check_if_command_finished(struct child_process *cmd) { +#ifdef __linux__ + char filename[FILENAME_MAX + 12]; + char status_line[256]; + FILE *status_file; + + /* + * Check by reading /proc//status as calling waitpid causes + * stdout/stderr to be closed and data lost. + */ + sprintf(filename, "/proc/%d/status", cmd->pid); + status_file =3D fopen(filename, "r"); + if (status_file =3D=3D NULL) { + /* Open failed assume finish_command was called. */ + return true; + } + while (fgets(status_line, sizeof(status_line), status_file) !=3D NULL) { + char *p; + + if (strncmp(status_line, "State:", 6)) + continue; + + fclose(status_file); + p =3D status_line + 6; + while (isspace(*p)) + p++; + return *p =3D=3D 'Z' ? 1 : 0; + } + /* Read failed assume finish_command was called. */ + fclose(status_file); + return 1; +#else wait_or_whine(cmd, /*block=3D*/false); return cmd->finished; +#endif } =20 int finish_command(struct child_process *cmd) --=20 2.47.0.rc1.288.g06298d1525-goog From nobody Wed Nov 27 07:32:11 2024 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF7791D1F77 for ; Fri, 11 Oct 2024 22:04:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728684252; cv=none; b=Ee+mTtajkYC9SLO0xMWgLll3v56EMrssACrM2QwY6BeHJVWHqCVyl8PqHdszuiqzHHjwS+ml/FIjL5W0BEt/iCenwqYyJ8tYbeizZzMgb25m6gKRCTA1uX3ima5Wm3lhdMGNpGWh5X96NtFubfoLLXxuFFO7nQUmwDyXsmr95kU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728684252; c=relaxed/simple; bh=cVFHyHnq6TrMxc5fZUbBCZHrcp12iOBhqisVsG/m8d0=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=ulYxvrXQN/X+Zo1AS9Mo6iSZiNrHkRK+xwkTMKQKeD6a8xZvT3qHcMOJQoADIcOhEKimrwNfPjNIhICHZQyeZsqiIQM95qIUoVMxY06SZAg0xnQjQWyuzssisDu8Ei0LdR9cFIKtIlJEIksA2cUrAa9BNUygMc4G9kePHBrsEJo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=eHsHb9tf; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="eHsHb9tf" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e29205f6063so1479209276.1 for ; Fri, 11 Oct 2024 15:04:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1728684250; x=1729289050; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=ddlbx8whXmomEW8ZV85yTS+anC+8hSMDj9tPf/FCtxQ=; b=eHsHb9tfBK7cHtljo+eWgA7OYjqoCa8kSmIvltN1aLBI1DMBAfVyikCkHJpQEFUGfM HMQJtFSkUAzVPQMI7eQqwtreKUM/DPEuBce333bmmk6dnSiynKdAM/zKQIXQ0gAboNMe oZDniB2Pjn/lQxihPBKlHspzGnjYI5djsUrqJYv2kTw4cOpG2t6Qx/6l/02NMhaiEdzG GxKlrxqpid2z0s/Ba/+7OiWJpnyQuZDKYDpiHhk4QyCtdRURUirMxizOe7SETsIYQ+Bo sd6WcvOvrQLPVR6gCemHpZy3vJfvohXIt2vVIltOzN9fMGvv4OZP1LEeZCga1RApsIEE GmuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728684250; x=1729289050; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ddlbx8whXmomEW8ZV85yTS+anC+8hSMDj9tPf/FCtxQ=; b=AbEGGjGuBSSGESayg0eWRE0TeA0Esk5XAVvjPsSeOY5xG3hggpyCJNKMEDfb+vklUE IgkJGjZxdrnQPqxKrZtfq1XB7ATlxKw5SmgvAoAZhPuFdggEjr30599ATch5K6eKnMbo KpaxJbhOs+XhLWF0a9bM9iGwKMHC/i9y750HIcQ/emy2vhdA6QzoG/Wm7w+zzFWtSneT zaJlHLIOuS79IBYVwCwiDmJJAI6H3HZRFLRWKm+RH+dr1fiNum3N87fdYmuLLt9YhE/7 sO6S7wvpbssKBEv4+XiBU0BULGejowFR6h+143Gn56XNFbE0VN1+HS/qaGoMPMSr82Nc +Uiw== X-Forwarded-Encrypted: i=1; AJvYcCVuI9AZaHDnU7kZ7HIzWkio+qsEGruB3mEkpsKBzztviLaDffIR1P5MHPkaE9PHzC976Dgk9s8r5N/SVgQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yzjj6zEQRlH/aoDZx3PREByLngYMYdVDcXHcB1hTl8gkDLEQ6Xj 1nalHQ9UNOXazJyVtwOj7IfnUa10l4vsRmbyC5pmQzRnjBUFfLJ+HeIIRc+RJ28y0Y5jFBqVVHk t60KSLA== X-Google-Smtp-Source: AGHT+IGICUHaZFxM7wOjXnnLZ5hyhXGYPt16hW/X1bKliAAyX+svgNa1tBgHEBUYgRaGMen2Agvxfbh+ivDW X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:8144:56f:2e1e:4db]) (user=irogers job=sendgmr) by 2002:a25:ae60:0:b0:e28:f8e6:f4c6 with SMTP id 3f1490d57ef6-e2919dbf049mr14115276.2.1728684248890; Fri, 11 Oct 2024 15:04:08 -0700 (PDT) Date: Fri, 11 Oct 2024 15:03:48 -0700 In-Reply-To: <20241011220354.756798-1-irogers@google.com> Message-Id: <20241011220354.756798-3-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241011220354.756798-1-irogers@google.com> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog Subject: [PATCH v2 2/8] perf test: Display number of active running tests From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , James Clark , Howard Chu , Athira Jajeev , Michael Petlan , Veronika Molnarova , Dapeng Mi , Thomas Richter , Ilya Leoshkevich , Colin Ian King , Weilin Wang , Andi Kleen , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Before polling or sleeping to wait for a test to complete, print out ": Running ( active)" where the number of active tests is determined by iterating over the tests and seeing which return false for check_if_command_finished. The line erasing and printing out only occur if the number of runnings tests changes to avoid the line flickering excessively. Knowing tests are running allows a user to know a test is running and in parallel mode how many of the tests are waiting to complete. If color mode is disabled then avoid displaying the "Running" message as deleting the line isn't reliable. Tested-by: James Clark Signed-off-by: Ian Rogers --- tools/perf/tests/builtin-test.c | 93 ++++++++++++++++++++++----------- tools/perf/util/color.h | 1 + 2 files changed, 63 insertions(+), 31 deletions(-) diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-tes= t.c index 470a9709427d..bf03fb42420b 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c @@ -242,7 +242,10 @@ static int run_test_child(struct child_process *proces= s) return -err; } =20 -static int print_test_result(struct test_suite *t, int i, int subtest, int= result, int width) +#define TEST_RUNNING -3 + +static int print_test_result(struct test_suite *t, int i, int subtest, int= result, int width, + int running) { if (has_subtests(t)) { int subw =3D width > 2 ? width - 2 : width; @@ -252,6 +255,9 @@ static int print_test_result(struct test_suite *t, int = i, int subtest, int resul pr_info("%3d: %-*s:", i + 1, width, test_description(t, subtest)); =20 switch (result) { + case TEST_RUNNING: + color_fprintf(stderr, PERF_COLOR_YELLOW, " Running (%d active)\n", runni= ng); + break; case TEST_OK: pr_info(" Ok\n"); break; @@ -273,14 +279,17 @@ static int print_test_result(struct test_suite *t, in= t i, int subtest, int resul return 0; } =20 -static int finish_test(struct child_test *child_test, int width) +static int finish_test(struct child_test **child_tests, int running_test, = int child_test_num, + int width) { + struct child_test *child_test =3D child_tests[running_test]; struct test_suite *t =3D child_test->test; int i =3D child_test->test_num; int subi =3D child_test->subtest; int err =3D child_test->process.err; - bool err_done =3D err <=3D 0; + bool err_done =3D false; struct strbuf err_output =3D STRBUF_INIT; + int last_running =3D -1; int ret; =20 /* @@ -294,7 +303,7 @@ static int finish_test(struct child_test *child_test, i= nt width) * Busy loop reading from the child's stdout/stderr that are set to be * non-blocking until EOF. */ - if (!err_done) + if (err > 0) fcntl(err, F_SETFL, O_NONBLOCK); if (verbose > 1) { if (has_subtests(t)) @@ -308,38 +317,60 @@ static int finish_test(struct child_test *child_test,= int width) .events =3D POLLIN | POLLERR | POLLHUP | POLLNVAL, }, }; - char buf[512]; - ssize_t len; - - /* Poll to avoid excessive spinning, timeout set for 100ms. */ - poll(pfds, ARRAY_SIZE(pfds), /*timeout=3D*/100); - if (!err_done && pfds[0].revents) { - errno =3D 0; - len =3D read(err, buf, sizeof(buf) - 1); - - if (len <=3D 0) { - err_done =3D errno !=3D EAGAIN; - } else { - buf[len] =3D '\0'; - if (verbose > 1) - fprintf(stdout, "%s", buf); - else + if (perf_use_color_default) { + int running =3D 0; + + for (int y =3D running_test; y < child_test_num; y++) { + if (check_if_command_finished(&child_tests[y]->process) =3D=3D 0) + running++; + } + if (running !=3D last_running) { + if (last_running !=3D -1) { + /* + * Erase "Running (.. active)" line + * printed before poll/sleep. + */ + fprintf(debug_file(), PERF_COLOR_DELETE_LINE); + } + print_test_result(t, i, subi, TEST_RUNNING, width, running); + last_running =3D running; + } + } + + err_done =3D true; + if (err <=3D 0) { + /* No child stderr to poll, sleep for 10ms for child to complete. */ + usleep(10 * 1000); + } else { + /* Poll to avoid excessive spinning, timeout set for 100ms. */ + poll(pfds, ARRAY_SIZE(pfds), /*timeout=3D*/100); + if (pfds[0].revents) { + char buf[512]; + ssize_t len; + + len =3D read(err, buf, sizeof(buf) - 1); + + if (len > 0) { + err_done =3D false; + buf[len] =3D '\0'; strbuf_addstr(&err_output, buf); + } } } + if (err_done) + err_done =3D check_if_command_finished(&child_test->process); + } + if (perf_use_color_default && last_running !=3D -1) { + /* Erase "Running (.. active)" line printed before poll/sleep. */ + fprintf(debug_file(), PERF_COLOR_DELETE_LINE); } /* Clean up child process. */ ret =3D finish_command(&child_test->process); - if (verbose =3D=3D 1 && ret =3D=3D TEST_FAIL) { - /* Add header for test that was skipped above. */ - if (has_subtests(t)) - pr_info("%3d.%1d: %s:\n", i + 1, subi + 1, test_description(t, subi)); - else - pr_info("%3d: %s:\n", i + 1, test_description(t, -1)); + if (verbose > 1 || (verbose =3D=3D 1 && ret =3D=3D TEST_FAIL)) fprintf(stderr, "%s", err_output.buf); - } + strbuf_release(&err_output); - print_test_result(t, i, subi, ret, width); + print_test_result(t, i, subi, ret, width, /*running=3D*/0); if (err > 0) close(err); return 0; @@ -355,7 +386,7 @@ static int start_test(struct test_suite *test, int i, i= nt subi, struct child_tes pr_debug("--- start ---\n"); err =3D test_function(test, subi)(test, subi); pr_debug("---- end ----\n"); - print_test_result(test, i, subi, err, width); + print_test_result(test, i, subi, err, width, /*running=3D*/0); return 0; } =20 @@ -380,7 +411,7 @@ static int start_test(struct test_suite *test, int i, i= nt subi, struct child_tes err =3D start_command(&(*child)->process); if (err || !sequential) return err; - return finish_test(*child, width); + return finish_test(child, /*running_test=3D*/0, /*child_test_num=3D*/1, w= idth); } =20 #define for_each_test(j, k, t) \ @@ -465,7 +496,7 @@ static int __cmd_test(int argc, const char *argv[], str= uct intlist *skiplist) } for (i =3D 0; i < child_test_num; i++) { if (!sequential) { - int ret =3D finish_test(child_tests[i], width); + int ret =3D finish_test(child_tests, i, child_test_num, width); =20 if (ret) return ret; diff --git a/tools/perf/util/color.h b/tools/perf/util/color.h index 01f7bed21c9b..4b9f8d5d4439 100644 --- a/tools/perf/util/color.h +++ b/tools/perf/util/color.h @@ -22,6 +22,7 @@ #define MIN_GREEN 0.5 #define MIN_RED 5.0 =20 +#define PERF_COLOR_DELETE_LINE "\033[A\33[2K\r" /* * This variable stores the value of color.ui */ --=20 2.47.0.rc1.288.g06298d1525-goog From nobody Wed Nov 27 07:32:11 2024 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14D611D31AF for ; Fri, 11 Oct 2024 22:04:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728684255; cv=none; b=GVLVtB+K7zEbjG/hHZDLVc73kMsoFwvQO57aOOJB6hRGo48kwIcv6jU+kyvK76e+jXXXGgcQ6ckt1Sa79DZk5ZXpXsa1Ezt2hBnX/EwbqgzwqvMKCmJyuAYqzUcQ6P6TFbVbfMfDZj42v1GbBXAJ4m2P4o2c8KBwer0M1iApl7A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728684255; c=relaxed/simple; bh=ayFLEkZZxvRFtfh6rbDKgn18fu4jJI/W7wgdr0IoZZA=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=AVfmGL3yCEsAewWA7HOESWwhrSF7QxNF0clIBx0I7dQjFaXzxgNZxrEH8taXvPxxm65//TR21Bd4/vgyMAFvMNw6h2tYC043zK+skLXoeeUI7I/gawKGYN5IEkrJAWeYzXTj6cimo9+GOAUpgr6IuDuPuaiFnRXDBFsjL3fvoGo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=EhONqIVL; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="EhONqIVL" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-6e294f38bddso42509717b3.3 for ; Fri, 11 Oct 2024 15:04:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1728684252; x=1729289052; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=lNrioubmXeLjE0G20Z4Gp3VHKZoRwxqkvbcLs4LSREQ=; b=EhONqIVLt+wav07/C3dbXenSbGmuaCdlXrHKR/be8tEXk//9oBtdBfrE84Ak0DgAZ0 37bcXHwqWE4WWK3F/3duEmOKmbzpd2EFbt3OoJTagJ81axm6CJuqZ07n45f3OjFX9dC0 oseFVsA/uAZ/obsCD1CdpVc3bFVoODhBsGxlduIL0wTqu7zQMV7/5dm/jqYUSb+bT8R4 KJzGXjox5tyU9Y6r0SsN7EwFVJh9lksT+Bv8/Kt516hH8iymBnEOjFZwNZ97ChvHeHsv gs9l2qmU6KYmMSzp6Fz9J96nRjlCMCGiYNyLDLy3Z/V5rFBw+AoUSv3qPhd1Peu8h9uu hSOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728684252; x=1729289052; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lNrioubmXeLjE0G20Z4Gp3VHKZoRwxqkvbcLs4LSREQ=; b=Am+LHfT35nSVW6EuhEVnAC7x3/mWyJA+5V6fqxAWkr2RRTMPBW4i6APo3ZeTFBS17e eQGigaBPSZ+ppmT/Gd+8HuI51IU68d1hRCU8YqdmeqFTWXuy+CDzABcikqj0lSDX5jvZ GEd1obm4e6ouu9hD93f3X9d39AaoJsB5cx/3k7xbV6K0VYk0xbfV885uASdZMxsEliEL JD6UkD5D0dJWNQEf0KVn3CQKMUMQ8nWIc09MuNLkasvbQVnLRFJcE0ahfPSW4SNeanbx eAETBJ6uZMljPgxo/qDqkSgz5ySvzogk2EusvIeLNswMT0jZRdDUPVYoGCWcfVW6fNlp zkEQ== X-Forwarded-Encrypted: i=1; AJvYcCU1OAZl9Hk0e5Tk29bPIC1561QJ8TjOpVm54Cmv4hPE9nFB1qDh5tp6JGzxqC4UvOJFaKnUpPFBUqAUslM=@vger.kernel.org X-Gm-Message-State: AOJu0YzPL7B6TM2fSOnC5bqxYC/YDDm7/NPIZmseG5KL33/8kayKXA+J /yPqn7/aJKtXypHpncH61sXrZ5Bb9KkG2fKyDIeqUpLDxz2UI+k9KSl+TEAb/ibaw62gfj7y1WG lZq17jw== X-Google-Smtp-Source: AGHT+IH0cp7lEpJ+EU1fmq4BdA4UVq+vSksmc8806woiaMmF0NZBEKmS+zYZPslDPH3bhtxl8VmxpOa34DTG X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:8144:56f:2e1e:4db]) (user=irogers job=sendgmr) by 2002:a05:690c:906:b0:6e3:189a:ad65 with SMTP id 00721157ae682-6e347c71baamr1540377b3.5.1728684251913; Fri, 11 Oct 2024 15:04:11 -0700 (PDT) Date: Fri, 11 Oct 2024 15:03:49 -0700 In-Reply-To: <20241011220354.756798-1-irogers@google.com> Message-Id: <20241011220354.756798-4-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241011220354.756798-1-irogers@google.com> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog Subject: [PATCH v2 3/8] perf test: Reduce scope of parallel variable From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , James Clark , Howard Chu , Athira Jajeev , Michael Petlan , Veronika Molnarova , Dapeng Mi , Thomas Richter , Ilya Leoshkevich , Colin Ian King , Weilin Wang , Andi Kleen , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The variable duplicates sequential but is only used for command line argument processing. Reduce scope to make the behavior clearer. Tested-by: James Clark Signed-off-by: Ian Rogers --- tools/perf/tests/builtin-test.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-tes= t.c index bf03fb42420b..88ffc0feb51e 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c @@ -41,9 +41,6 @@ static bool dont_fork; /* Don't fork the tests in parallel and wait for their completion. */ static bool sequential =3D true; -/* Do it in parallel, lacks infrastructure to avoid running tests that cla= sh for resources, - * So leave it as the developers choice to enable while working on the nee= ded infra */ -static bool parallel; const char *dso_to_test; const char *test_objdump_path =3D "objdump"; =20 @@ -565,6 +562,12 @@ int cmd_test(int argc, const char **argv) }; const char *skip =3D NULL; const char *workload =3D NULL; + /* + * Run tests in parallel, lacks infrastructure to avoid running tests + * that clash for resources, So leave it as the developers choice to + * enable while working on the needed infra. + */ + bool parallel =3D false; const struct option test_options[] =3D { OPT_STRING('s', "skip", &skip, "tests", "tests to skip"), OPT_INCR('v', "verbose", &verbose, --=20 2.47.0.rc1.288.g06298d1525-goog From nobody Wed Nov 27 07:32:11 2024 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4917E1DC182 for ; Fri, 11 Oct 2024 22:04:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728684256; cv=none; b=IC3hbVzEJKXNRx345TvAHYlbNQLGyGGDuvV3h6rewd6J19odv9xgOI4EkrfB5soxs75zaNkLNbHBZQNsBzT4nFQ6y3OB+AmFhg/G0J8itgaUCRfH6DAtxkP4TASm+m6XknrDC1xkQxDpkHMTG/ip4uG2MIK3vFKWH21KPmLSK8Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728684256; c=relaxed/simple; bh=U1UusGBDoXz2VQik++HD585jShgBarpm5ySs1yN9FYM=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=aj2pq96QiRH2YPZMCgej6gibpIaB5yo/d+u3tSGQZT7K+E1lNWdBghYusB92DAGwsOxqiIE1tIZknOWmCKVWPxj7vFe3+Op0Vm0ZU5NdVPGJoX1ZUL3PXiLFyVMwlMA7I4IBzfaZtVQCUCyz5HscoF7HijCKH/3WEaa5y3SPelA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=IluXIpsN; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="IluXIpsN" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-6e2e5e376fcso54195077b3.2 for ; Fri, 11 Oct 2024 15:04:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1728684254; x=1729289054; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=13Gb0Qczu+RyP7NVli2dbJnILTUtWcNY3mpZFWZWiz0=; b=IluXIpsNeoZChxzimRLGOo2rvjb9/u1dxATObwn6M+RWX3+L4+ENQo1HFurxRZi6gR uYjH+PCRmq0N5/X9hwH6wMtzQOT6GXm+N4AhKW9PDlwmdCpzJQUBLG0b2zD3ywBTTDcY tMuFw2lXFNAjUFB/zJpb6tkmhJI+eoN7SCJ5Qbrn8Zfcr5w9WrvArlMqqZGuYoJXedQq 5xt8Q31pqiJfkx381JQsj+WU4z6k6vNj7PRGaTJd525xNLEXD49QEfM03YrElMcknXUJ 8U625p6NoldD48QYaKYVfmRxTy8lZqBMujgKxjKMoxJGe4jhFZRSorpZKYSeYrEkerpS YUnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728684254; x=1729289054; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=13Gb0Qczu+RyP7NVli2dbJnILTUtWcNY3mpZFWZWiz0=; b=RkVz48EYb1IF9kmD/askQ9rXfbukX7Wklupi8pYYlxZrP82+vqyYK5pazzU8tG48hf BadLjwhvt71kFVvtoaTPu7Ik5IbS1MJ/S0tYGq+M9ktl8NBnbCCfPFJxm+B8kdvKC813 WgY/TocCJOS8a/Y6HYQDA/uxoXnL3Hmg3Gerdd2QttHAmVqXSuuThVPWZqAj2edL4ztN rnYqXOSQ0ihAr6UbQPnscDkwFCeVlzkQYIQltgz7EH1ouNkm77NfTVQH/S1Pvs56r/8U o6BkqVcZnOE0mQE/tDD2uyexijU85fLh4WYdmGMqvz+mDjpHptqC5hEhm2awviFJme/K tw1A== X-Forwarded-Encrypted: i=1; AJvYcCUZEd7MKLNKZvrfB5ddLTT58lnQGzfxL24DclSqhgMY304KEZJEIfFTUu/yjxUdYOJ8GWPwWvk5y8P0T9c=@vger.kernel.org X-Gm-Message-State: AOJu0Yyn4wwdimaLoyW+I5TDkR3JmepfCvRU35ziNrwrIEA7g2e4ZXSk +ChqwCWgPgEhHKlNGKDQQGy73yPbwqDtRvKP4N8pGEoQaUWRmeRnUTMDXW5bFmbN09Z0B+mDw2d 6GmHLDQ== X-Google-Smtp-Source: AGHT+IE11H1f4e98EhsItbxbwHzB0EO6S8fZPPSaM5oenhtdfB16Jd4EVSiiCREhHL4t6gwxg6GG+jPU2FUi X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:8144:56f:2e1e:4db]) (user=irogers job=sendgmr) by 2002:a25:fc13:0:b0:e24:a28e:9399 with SMTP id 3f1490d57ef6-e2919d828f7mr2137276.4.1728684253996; Fri, 11 Oct 2024 15:04:13 -0700 (PDT) Date: Fri, 11 Oct 2024 15:03:50 -0700 In-Reply-To: <20241011220354.756798-1-irogers@google.com> Message-Id: <20241011220354.756798-5-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241011220354.756798-1-irogers@google.com> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog Subject: [PATCH v2 4/8] perf test: Avoid list test blocking on writing to stdout From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , James Clark , Howard Chu , Athira Jajeev , Michael Petlan , Veronika Molnarova , Dapeng Mi , Thomas Richter , Ilya Leoshkevich , Colin Ian King , Weilin Wang , Andi Kleen , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Python's json.tool will output the input json to stdout. Redirect to /dev/null to avoid blocking on stdout writes. Tested-by: James Clark Signed-off-by: Ian Rogers --- tools/perf/tests/shell/list.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/perf/tests/shell/list.sh b/tools/perf/tests/shell/list.sh index 8a868ae64560..76a9846cff22 100755 --- a/tools/perf/tests/shell/list.sh +++ b/tools/perf/tests/shell/list.sh @@ -24,8 +24,11 @@ trap trap_cleanup EXIT TERM INT =20 test_list_json() { echo "Json output test" + # Generate perf list json output into list_output file. perf list -j -o "${list_output}" - $PYTHON -m json.tool "${list_output}" + # Validate the json using python, redirect the json copy to /dev/null as + # otherwise the test may block writing to stdout. + $PYTHON -m json.tool "${list_output}" /dev/null echo "Json output test [Success]" } =20 --=20 2.47.0.rc1.288.g06298d1525-goog From nobody Wed Nov 27 07:32:11 2024 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEBDA1E47DF for ; Fri, 11 Oct 2024 22:04:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728684259; cv=none; b=MtbviyMgv1CaF4mZB2e3U7Q4EY2wrV6s6bIuZRnE9bstaNL7eDoOX8XE8J6KHB0CaUhfJ56HwnFo8ZNirap+59/xnFgWIfkG7YkUQIAhK+AAgvPbx8/UEMejDqS2VNfrABz2+XaydOFztlQgPabsudDg2Vzy8IynKPS8iPVQsPA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728684259; c=relaxed/simple; bh=7GwxBquywU+IxTcpxM3Ko+Upc2nLVpDtM+WJFJ40q0Y=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=jbmgc9oDjAYMkGqbrbhiNLi+Bzj06358amqq4PNIFklRne5ggiI9ceN8lPZzxhV8S7iKjsLuT2zEyhfzJrZwBeh+naVZeQ60LZ1EHI2Q94hQKkhcQINsz2XqgRrHTK5NNyW6qKyK97/yvLRRT4hW+pp40PHgxyB/38OAfB3BLgU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=t9gq/BxR; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="t9gq/BxR" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-6e0082c1dd0so48951997b3.3 for ; Fri, 11 Oct 2024 15:04:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1728684257; x=1729289057; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=AAeyMobsK3znaJpVmaZIUJ4+zYiQ3C3XAxpS99a1TIk=; b=t9gq/BxR1EOptrdQQFdKHhWj6Dxl6XNTARAL755RXzrJ5NYeo0a0DwsB+JWSo9ZGeq Uz4L+K5j76LzHPjpmnJ1RtSDuip+GKO75T74R7cpHrNgPTGvCANnFw7zuRp294jKgTGl p+AyoANPr1UCfJ/q/+NPV5C0G7V+Cf9W0RcS9CmUjl2a0BU4Z+oYtITf4U0BBATYVgT4 USpOKAYE3Fd2ZUeCcbCbzyvTnhbmNVQDlh4fidhi817gFshURnk9LIn1w2L0YWW+oeDW NoZ5NCq9jPrxFrVz3MFX9F4RZCSIAwPq6AoDwXrKLXSi0Nt8FfwTN3o3b3uB2dVoUjmm 5X8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728684257; x=1729289057; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AAeyMobsK3znaJpVmaZIUJ4+zYiQ3C3XAxpS99a1TIk=; b=oZHfkEqOKqc4lsyHQx478580hy5Jc6Z3KiBKfAWpe4tsqAuaw2w4zifWCK1IyWgzw1 C61m+NVhAVibpTRvaOVhnf/5hH6Hrp2VhmWkQ3JVI5mZLv1/mk8pOb6uDBh9RvjJXslq u+R34KQh7KUq611xZAT2X3ukoUGsMEoBDMAH20opqaR53Vlz8MnZ/eUfCon3wCwrC++g t+fgI7NiCAKcxSYR6HhI5IboWUrM2yRRNtwMnI5L7fnI5MFFxDFawKBgyNPnvvSDvjbf HzcioCOHjH8vVlYk54q/tw83diyup+RokKIH0SMQvVUXDPYdtP8IJWjjo7geVq2xLEYB orkQ== X-Forwarded-Encrypted: i=1; AJvYcCXBQt7QVgd09Ij+TqlRojy24wg8DAIKuH1sCQXelGybVbgoB1tKIIZe2BASKlyiEOPaJgRN0pA8upCcmYg=@vger.kernel.org X-Gm-Message-State: AOJu0YzJnpbup9OJCYvQCAcNpnJyeRgaeObQqWq9Nxl0A0zHHR6QB2Oi B7vaM8GkzysAStqYpybwHSSZ6uITnMt56K9ZclHzOkgfRl8CTfdikSLGSCB6/fG7YSUiGi3vZqM 19AALEw== X-Google-Smtp-Source: AGHT+IEy4jaHEPHR3h1zcaYnMrqHXdROnQ6I3DL6+yTRDe+apB0CnaL9fg9TdbjBBA0NNdROjg8t50+X9jOl X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:8144:56f:2e1e:4db]) (user=irogers job=sendgmr) by 2002:a05:690c:6085:b0:6db:54ae:fd0f with SMTP id 00721157ae682-6e347c6b7edmr1468017b3.7.1728684256349; Fri, 11 Oct 2024 15:04:16 -0700 (PDT) Date: Fri, 11 Oct 2024 15:03:51 -0700 In-Reply-To: <20241011220354.756798-1-irogers@google.com> Message-Id: <20241011220354.756798-6-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241011220354.756798-1-irogers@google.com> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog Subject: [PATCH v2 5/8] perf test: Tag parallel failing shell tests with "(exclusive)" From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , James Clark , Howard Chu , Athira Jajeev , Michael Petlan , Veronika Molnarova , Dapeng Mi , Thomas Richter , Ilya Leoshkevich , Colin Ian King , Weilin Wang , Andi Kleen , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Some shell tests compete for resources and so can't run with other tests, tag such tests. The "(exclusive)" stems from shared/exclusive to describe how the tests run as if holding a lock. For ARM/coresight tests: Suggested-by: James Clark Tested-by: James Clark Signed-off-by: Ian Rogers --- tools/perf/tests/shell/coresight/asm_pure_loop.sh | 2 +- tools/perf/tests/shell/coresight/memcpy_thread_16k_10.sh | 2 +- tools/perf/tests/shell/coresight/thread_loop_check_tid_10.sh | 2 +- tools/perf/tests/shell/coresight/thread_loop_check_tid_2.sh | 2 +- tools/perf/tests/shell/coresight/unroll_loop_thread_10.sh | 2 +- tools/perf/tests/shell/perftool-testsuite_report.sh | 2 +- tools/perf/tests/shell/record.sh | 2 +- tools/perf/tests/shell/record_lbr.sh | 2 +- tools/perf/tests/shell/record_offcpu.sh | 2 +- tools/perf/tests/shell/stat_all_pmu.sh | 2 +- tools/perf/tests/shell/test_arm_coresight.sh | 2 +- tools/perf/tests/shell/test_arm_coresight_disasm.sh | 2 +- tools/perf/tests/shell/test_arm_spe.sh | 2 +- tools/perf/tests/shell/test_intel_pt.sh | 2 +- tools/perf/tests/shell/test_stat_intel_tpebs.sh | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tools/perf/tests/shell/coresight/asm_pure_loop.sh b/tools/perf= /tests/shell/coresight/asm_pure_loop.sh index 2d65defb7e0f..c63bc8c73e26 100755 --- a/tools/perf/tests/shell/coresight/asm_pure_loop.sh +++ b/tools/perf/tests/shell/coresight/asm_pure_loop.sh @@ -1,5 +1,5 @@ #!/bin/sh -e -# CoreSight / ASM Pure Loop +# CoreSight / ASM Pure Loop (exclusive) =20 # SPDX-License-Identifier: GPL-2.0 # Carsten Haitzler , 2021 diff --git a/tools/perf/tests/shell/coresight/memcpy_thread_16k_10.sh b/too= ls/perf/tests/shell/coresight/memcpy_thread_16k_10.sh index ddcc9bb850f5..8e29630957c8 100755 --- a/tools/perf/tests/shell/coresight/memcpy_thread_16k_10.sh +++ b/tools/perf/tests/shell/coresight/memcpy_thread_16k_10.sh @@ -1,5 +1,5 @@ #!/bin/sh -e -# CoreSight / Memcpy 16k 10 Threads +# CoreSight / Memcpy 16k 10 Threads (exclusive) =20 # SPDX-License-Identifier: GPL-2.0 # Carsten Haitzler , 2021 diff --git a/tools/perf/tests/shell/coresight/thread_loop_check_tid_10.sh b= /tools/perf/tests/shell/coresight/thread_loop_check_tid_10.sh index 2ce5e139b2fd..0c4c82a1c8e1 100755 --- a/tools/perf/tests/shell/coresight/thread_loop_check_tid_10.sh +++ b/tools/perf/tests/shell/coresight/thread_loop_check_tid_10.sh @@ -1,5 +1,5 @@ #!/bin/sh -e -# CoreSight / Thread Loop 10 Threads - Check TID +# CoreSight / Thread Loop 10 Threads - Check TID (exclusive) =20 # SPDX-License-Identifier: GPL-2.0 # Carsten Haitzler , 2021 diff --git a/tools/perf/tests/shell/coresight/thread_loop_check_tid_2.sh b/= tools/perf/tests/shell/coresight/thread_loop_check_tid_2.sh index 3ad9498753d7..d3aea9fc6ced 100755 --- a/tools/perf/tests/shell/coresight/thread_loop_check_tid_2.sh +++ b/tools/perf/tests/shell/coresight/thread_loop_check_tid_2.sh @@ -1,5 +1,5 @@ #!/bin/sh -e -# CoreSight / Thread Loop 2 Threads - Check TID +# CoreSight / Thread Loop 2 Threads - Check TID (exclusive) =20 # SPDX-License-Identifier: GPL-2.0 # Carsten Haitzler , 2021 diff --git a/tools/perf/tests/shell/coresight/unroll_loop_thread_10.sh b/to= ols/perf/tests/shell/coresight/unroll_loop_thread_10.sh index 4fbb4a29aad3..7429d3a2ae43 100755 --- a/tools/perf/tests/shell/coresight/unroll_loop_thread_10.sh +++ b/tools/perf/tests/shell/coresight/unroll_loop_thread_10.sh @@ -1,5 +1,5 @@ #!/bin/sh -e -# CoreSight / Unroll Loop Thread 10 +# CoreSight / Unroll Loop Thread 10 (exclusive) =20 # SPDX-License-Identifier: GPL-2.0 # Carsten Haitzler , 2021 diff --git a/tools/perf/tests/shell/perftool-testsuite_report.sh b/tools/pe= rf/tests/shell/perftool-testsuite_report.sh index 973012ce92a7..a8cf75b4e77e 100755 --- a/tools/perf/tests/shell/perftool-testsuite_report.sh +++ b/tools/perf/tests/shell/perftool-testsuite_report.sh @@ -1,5 +1,5 @@ #!/bin/bash -# perftool-testsuite_report +# perftool-testsuite_report (exclusive) # SPDX-License-Identifier: GPL-2.0 =20 test -d "$(dirname "$0")/base_report" || exit 2 diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/reco= rd.sh index 8d6366d96883..f7d8c5b243a4 100755 --- a/tools/perf/tests/shell/record.sh +++ b/tools/perf/tests/shell/record.sh @@ -1,5 +1,5 @@ #!/bin/bash -# perf record tests +# perf record tests (exclusive) # SPDX-License-Identifier: GPL-2.0 =20 set -e diff --git a/tools/perf/tests/shell/record_lbr.sh b/tools/perf/tests/shell/= record_lbr.sh index 32314641217e..8d750ee631f8 100755 --- a/tools/perf/tests/shell/record_lbr.sh +++ b/tools/perf/tests/shell/record_lbr.sh @@ -1,5 +1,5 @@ #!/bin/bash -# perf record LBR tests +# perf record LBR tests (exclusive) # SPDX-License-Identifier: GPL-2.0 =20 set -e diff --git a/tools/perf/tests/shell/record_offcpu.sh b/tools/perf/tests/she= ll/record_offcpu.sh index 67c925f3a15a..678947fe69ee 100755 --- a/tools/perf/tests/shell/record_offcpu.sh +++ b/tools/perf/tests/shell/record_offcpu.sh @@ -1,5 +1,5 @@ #!/bin/sh -# perf record offcpu profiling tests +# perf record offcpu profiling tests (exclusive) # SPDX-License-Identifier: GPL-2.0 =20 set -e diff --git a/tools/perf/tests/shell/stat_all_pmu.sh b/tools/perf/tests/shel= l/stat_all_pmu.sh index 42456d89c5da..8b148b300be1 100755 --- a/tools/perf/tests/shell/stat_all_pmu.sh +++ b/tools/perf/tests/shell/stat_all_pmu.sh @@ -1,5 +1,5 @@ #!/bin/bash -# perf all PMU test +# perf all PMU test (exclusive) # SPDX-License-Identifier: GPL-2.0 =20 set -e diff --git a/tools/perf/tests/shell/test_arm_coresight.sh b/tools/perf/test= s/shell/test_arm_coresight.sh index 3302ea0b9672..534145778d7b 100755 --- a/tools/perf/tests/shell/test_arm_coresight.sh +++ b/tools/perf/tests/shell/test_arm_coresight.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Check Arm CoreSight trace data recording and synthesized samples +# Check Arm CoreSight trace data recording and synthesized samples (exclus= ive) =20 # Uses the 'perf record' to record trace data with Arm CoreSight sinks; # then verify if there have any branch samples and instruction samples diff --git a/tools/perf/tests/shell/test_arm_coresight_disasm.sh b/tools/pe= rf/tests/shell/test_arm_coresight_disasm.sh index af63e3757cb0..353d0a24f976 100755 --- a/tools/perf/tests/shell/test_arm_coresight_disasm.sh +++ b/tools/perf/tests/shell/test_arm_coresight_disasm.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Check Arm CoreSight disassembly script completes without errors +# Check Arm CoreSight disassembly script completes without errors (exclusi= ve) # SPDX-License-Identifier: GPL-2.0 =20 # The disassembly script reconstructs ranges of instructions and gives the= se to objdump to diff --git a/tools/perf/tests/shell/test_arm_spe.sh b/tools/perf/tests/shel= l/test_arm_spe.sh index 03d5c7d12ee5..be0fcdadeea8 100755 --- a/tools/perf/tests/shell/test_arm_spe.sh +++ b/tools/perf/tests/shell/test_arm_spe.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Check Arm SPE trace data recording and synthesized samples +# Check Arm SPE trace data recording and synthesized samples (exclusive) =20 # Uses the 'perf record' to record trace data of Arm SPE events; # then verify if any SPE event samples are generated by SPE with diff --git a/tools/perf/tests/shell/test_intel_pt.sh b/tools/perf/tests/she= ll/test_intel_pt.sh index 723ec501f99a..660991d17607 100755 --- a/tools/perf/tests/shell/test_intel_pt.sh +++ b/tools/perf/tests/shell/test_intel_pt.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Miscellaneous Intel PT testing +# Miscellaneous Intel PT testing (exclusive) # SPDX-License-Identifier: GPL-2.0 =20 set -e diff --git a/tools/perf/tests/shell/test_stat_intel_tpebs.sh b/tools/perf/t= ests/shell/test_stat_intel_tpebs.sh index 9a11f42d153c..f95fc64bf0a7 100755 --- a/tools/perf/tests/shell/test_stat_intel_tpebs.sh +++ b/tools/perf/tests/shell/test_stat_intel_tpebs.sh @@ -1,5 +1,5 @@ #!/bin/bash -# test Intel TPEBS counting mode +# test Intel TPEBS counting mode (exclusive) # SPDX-License-Identifier: GPL-2.0 =20 set -e --=20 2.47.0.rc1.288.g06298d1525-goog From nobody Wed Nov 27 07:32:11 2024 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA8F21E630D for ; Fri, 11 Oct 2024 22:04:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728684261; cv=none; b=He9jl+iC0BmXIpgu8kGik08dMvaoIamsFxdt28a0yoO4xL9RqiSBkVx7RvDTMOSeo1DrUj/i4DSTvvEWI4xxd1hXAOJQnT2O9vbRWG5SBxFpctSwWRH+r5HqSPDK7J5Hykqq5HBXi0lF6gKj1JOjz5Wnx8WjO2CQXJINQei8KFc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728684261; c=relaxed/simple; bh=9Cp0Yfo6BG+TyU+ZsosYSdQA+YPv9U8nc3gSHMMpOc0=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=duv3Rp4uJpKUsS9kfBZV7haciBA+cwnyHAdU8tQOE5gkT6EMcRVvZUUPtd+BpUplIXgCvVyHUvL8ZYE7sm7NdB0e3P9Ff85SabyG5DZq4Px2rmJ12X928T9WImE3Afb25vBm23+U26igdV6MoRLQWYVdQCDu+AQ+svdiNUxWTD0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=sP3dZpOM; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="sP3dZpOM" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-6e32b43e053so36116287b3.1 for ; Fri, 11 Oct 2024 15:04:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1728684259; x=1729289059; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=+mS/z99BEEiYdboIN11Xm9wOu4EbwK22EIzUA/5+qJ8=; b=sP3dZpOM2Nok48s0VKRjogTicGRsDg+ZrF6zv+q8+i4LJv1rYD7D50MLKthZhBNO43 t/ACnWgUMwdLp4EGmNNh9Isl/r+D6F+4KMrqEx3D/0CbRrk9agLXtLRZVwNVNCqETxRa sPctX6XAgxV5TzpOU4l/ZvGHuxeX7lvSuM/i8Elp+AA0eboBOjCN51v+Qi4eGetnjN67 tlqp0z9kvLzODqVPviwE7TH8XRdP1lQ2EPVdDfwmXjo4N1lcoeN32wVkwSEJArSUDi1e xifsRAiTAZi2GKgJJnoC+d4NzqSbUQ2YeouygGd+aTMGCk9RPP4aqNj3ccqWekCSD1Hg thyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728684259; x=1729289059; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+mS/z99BEEiYdboIN11Xm9wOu4EbwK22EIzUA/5+qJ8=; b=nu/Lq2IgN8EdYMsTIUwapow7dPhJUj7zGbnrO+mkfInwrhdk+n8Huq54LnexT0GVuh vunniuc5RU+Ir2X8KhM6nLZA6o7KkbnYwbx1xVSpgfQRYhqK11kCCNAO0ko0eObCL6BL sQ0KE8O68YUbDYQhkukBzabNj1OMY15ceCAc+ZPdqKN+3NYS+md6rzVDL4KjpFNXq/Uy r8JtAPys3hHQcFVo0w0PUJDqz2NEqK5HPRxULlP6qZR7gByHENdU48JbhL0/wbPD++GC p3cGT6HyJnXHpZ73DQ6N3aWh4knDhO3yI0Kd/Abl50DVYsPhy09kROBxhlyL7HkRrPd1 Prvw== X-Forwarded-Encrypted: i=1; AJvYcCVfdocnJnlnLW1e3w0dpHznjYMYEdNYdjiMS9DSFsGjogPmJXL9aPpxiS5rt0eRprxG1W++sUFPVt/JbgA=@vger.kernel.org X-Gm-Message-State: AOJu0YxcYvsCjcY5r9qmNiZej6qxcyduwKQMx70wqsoXxRBeDayHREXK TTeTZarDm+tmIbFS32tfR0NjDsGDjhzS+00/CpoYYE2CBAOIUmIO6OzABXzoEFRq4txC3swvICQ yb+uIFw== X-Google-Smtp-Source: AGHT+IH260dbXRg7ABxe5w92OeDs+i3LnrNLL6kFrsQZCcme1ZQcn3sfkUpQbKxTkVd6dNLYkk+tqhXPC72D X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:8144:56f:2e1e:4db]) (user=irogers job=sendgmr) by 2002:a05:690c:5c07:b0:6e3:189a:ad66 with SMTP id 00721157ae682-6e347c52ab6mr350497b3.5.1728684258753; Fri, 11 Oct 2024 15:04:18 -0700 (PDT) Date: Fri, 11 Oct 2024 15:03:52 -0700 In-Reply-To: <20241011220354.756798-1-irogers@google.com> Message-Id: <20241011220354.756798-7-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241011220354.756798-1-irogers@google.com> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog Subject: [PATCH v2 6/8] perf test: Add a signal handler around running a test From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , James Clark , Howard Chu , Athira Jajeev , Michael Petlan , Veronika Molnarova , Dapeng Mi , Thomas Richter , Ilya Leoshkevich , Colin Ian King , Weilin Wang , Andi Kleen , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add a signal handler around running a test. If a signal occurs during the test a siglongjmp unwinds the stack and output is flushed. The global run_test_jmp_buf is either unique per forked child or not shared during sequential execution. Tested-by: James Clark Signed-off-by: Ian Rogers --- tools/perf/tests/builtin-test.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-tes= t.c index 88ffc0feb51e..eca2e765beb5 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -226,16 +227,41 @@ struct child_test { int subtest; }; =20 +static jmp_buf run_test_jmp_buf; + +static void child_test_sig_handler(int sig) +{ + siglongjmp(run_test_jmp_buf, sig); +} + static int run_test_child(struct child_process *process) { - struct child_test *child =3D container_of(process, struct child_test, pro= cess); + const int signals[] =3D { + SIGABRT, SIGBUS, SIGFPE, SIGILL, SIGINT, SIGPIPE, SIGQUIT, SIGSEGV, SIGT= ERM, + }; + static struct child_test *child; int err; =20 + err =3D sigsetjmp(run_test_jmp_buf, 1); + if (err) { + fprintf(stderr, "\n---- unexpected signal (%d) ----\n", err); + err =3D err > 0 ? -err : -1; + goto err_out; + } + + child =3D container_of(process, struct child_test, process); + for (size_t i =3D 0; i < ARRAY_SIZE(signals); i++) + signal(signals[i], child_test_sig_handler); + pr_debug("--- start ---\n"); pr_debug("test child forked, pid %d\n", getpid()); err =3D test_function(child->test, child->subtest)(child->test, child->su= btest); pr_debug("---- end(%d) ----\n", err); + +err_out: fflush(NULL); + for (size_t i =3D 0; i < ARRAY_SIZE(signals); i++) + signal(signals[i], SIG_DFL); return -err; } =20 --=20 2.47.0.rc1.288.g06298d1525-goog From nobody Wed Nov 27 07:32:11 2024 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D74E91E7640 for ; Fri, 11 Oct 2024 22:04:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728684263; cv=none; b=SgcLvur6P5Pv0x9JxgaeeuRDCfHveE+NnEo616mIRXvJAAFcjkRhn3+zDw51HhQ3Kk778KU3gW2fb+F+JzGfKJ80mPgDB3QePXiUAoLuPQwxQr6sZ33Y4UGSWAuNTP27OFKZ0STO9UgXnt/SNqCyNg780FZE51wgeSFqZeYOyFw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728684263; c=relaxed/simple; bh=b6lezJfBzCD8mikmNiwkooKSN/JUBgiHKLdLa9Gwv3M=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=jFBUY4nZ1tpVv7CfesMKeAWJqb9okFDQzLdKcaAYmW864kSvY2483gwNFj+HLcb8wBN7l4X/CXPFmBmH14nEQDFBkF24BdeWi7+XsDb3qJ8MzbxYD4I83V2ExWQOZ9kbF2WEdeKwXXnUn6LiowXz3HexOLfr+9UGN1HQRoC/U10= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=UxFQFNky; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="UxFQFNky" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-6e30fe2a9feso31850037b3.3 for ; Fri, 11 Oct 2024 15:04:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1728684261; x=1729289061; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=tvkgXkIzl3gaJ2fixsfC2whuy+tm9G/xmYfeyZHZ1Js=; b=UxFQFNkycbwrk7wuCfGa9XsZTQnasmYSBHswEvQtvBUpvUJYuQ42ftBrbFRZxYi3u1 JpSM9JUMsyccZAko1t1qv6W1DqVfH8OfIBpKiA/HxGTSOrWat3pPXmEDc5xysF/ffnlv Q6oqy5G1tCcH7LGk/vUQzemyhzyQ9MQPmEFmC7K2mAH3EhovpDySqcylnkWA0uzqGgkS 2kuCtUIkKGSpolBbKhCkls8aGbL5QIniCzaeKjKhxRICQkLhswiCwyfqe9DD2FEKP3pQ LI1MJshlDrRXCPpa8zrnZtLDQ7CDGqplv2UNi7aPikvGvsef6Dpp/c+O8Zd3gu0UfzPO ujkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728684261; x=1729289061; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tvkgXkIzl3gaJ2fixsfC2whuy+tm9G/xmYfeyZHZ1Js=; b=lG0BfqEIkJVGwqOC+bRxDNE5LE8MvVteCmWt5LkcHzxtzhmKlQ2hn1wBp+d+//4r+6 FRXSPVemh7VZr4lwAbU7q3SB9V+mttawV7xObckH42m37FHSHXeJuqWRoRYsqVxHgws/ ghkvtCzejxtT4Knv8BtYCjn6zDTMX5QPuRDiTsLRjGnm2wN613Oah7Rd3F3U0HqbNaLF zqFwQeAwFp3AK+bJE6khjwWCWjJUanXRFgP+pIfxb+bz8ryahg2PFKDm4+LL/pzRK+Cz ksfL+DExlxeWmmDSH1GRj+S+oo3ZaL7uRNTbrR/UjjeF3Y2SUkOKdc1FZS77Z7JqGh7Z 9zUQ== X-Forwarded-Encrypted: i=1; AJvYcCVrM+WGZWbh44cYnYvjo+drCXTwRXN6GwqbfVXclXfdCkROeeaJb84TwimV6lo62gufy06mpA4YJUYUfxk=@vger.kernel.org X-Gm-Message-State: AOJu0YwNXWDnc++kyncjmKokEzGo9pE7XIaxKBKWJhlnN6eNrSO/L3c1 lDSG/GAE7v1Rc0IBQgFixGmu31zlS5M3pwgper096LeS3YjjQBRDtffMX571Hky1RfOtlHs93tY Dt73D/g== X-Google-Smtp-Source: AGHT+IExfK7AhAx0OuSW7hfx7X6Pwm/HYmENP66ya1xtEiGLnQnHWnzP48Ddi9f39sxAjfs/mQ9oPJl0WzZZ X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:8144:56f:2e1e:4db]) (user=irogers job=sendgmr) by 2002:a25:ae62:0:b0:e11:639b:6428 with SMTP id 3f1490d57ef6-e2918e5d500mr8555276.0.1728684260901; Fri, 11 Oct 2024 15:04:20 -0700 (PDT) Date: Fri, 11 Oct 2024 15:03:53 -0700 In-Reply-To: <20241011220354.756798-1-irogers@google.com> Message-Id: <20241011220354.756798-8-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241011220354.756798-1-irogers@google.com> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog Subject: [PATCH v2 7/8] perf test: Run parallel tests in two passes From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , James Clark , Howard Chu , Athira Jajeev , Michael Petlan , Veronika Molnarova , Dapeng Mi , Thomas Richter , Ilya Leoshkevich , Colin Ian King , Weilin Wang , Andi Kleen , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In pass 1 run all tests that succeed when run in parallel. In pass 2 sequentially run all remaining tests that are flagged as "exclusive". Sequential and dont_fork tests keep to run in pass 1. Read the exclusive flag from the shell test descriptions, but remove from display to avoid >100 characters. Add error handling to finish tests if starting a later test fails. Mark the task-exit test as exclusive due to issues reported-by James Clark. Tested-by: James Clark Signed-off-by: Ian Rogers --- tools/perf/tests/builtin-test.c | 157 +++++++++++++++++++------------ tools/perf/tests/task-exit.c | 9 +- tools/perf/tests/tests-scripts.c | 7 +- tools/perf/tests/tests.h | 9 ++ 4 files changed, 121 insertions(+), 61 deletions(-) diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-tes= t.c index eca2e765beb5..ba3797521d79 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c @@ -196,6 +196,14 @@ static test_fnptr test_function(const struct test_suit= e *t, int subtest) return t->test_cases[subtest].run_case; } =20 +static bool test_exclusive(const struct test_suite *t, int subtest) +{ + if (subtest <=3D 0) + return t->test_cases[0].exclusive; + + return t->test_cases[subtest].exclusive; +} + static bool perf_test__matches(const char *desc, int curr, int argc, const= char *argv[]) { int i; @@ -239,7 +247,7 @@ static int run_test_child(struct child_process *process) const int signals[] =3D { SIGABRT, SIGBUS, SIGFPE, SIGILL, SIGINT, SIGPIPE, SIGQUIT, SIGSEGV, SIGT= ERM, }; - static struct child_test *child; + struct child_test *child =3D container_of(process, struct child_test, pro= cess); int err; =20 err =3D sigsetjmp(run_test_jmp_buf, 1); @@ -249,7 +257,6 @@ static int run_test_child(struct child_process *process) goto err_out; } =20 - child =3D container_of(process, struct child_test, process); for (size_t i =3D 0; i < ARRAY_SIZE(signals); i++) signal(signals[i], child_test_sig_handler); =20 @@ -302,19 +309,25 @@ static int print_test_result(struct test_suite *t, in= t i, int subtest, int resul return 0; } =20 -static int finish_test(struct child_test **child_tests, int running_test, = int child_test_num, - int width) +static void finish_test(struct child_test **child_tests, int running_test,= int child_test_num, + int width) { struct child_test *child_test =3D child_tests[running_test]; - struct test_suite *t =3D child_test->test; - int i =3D child_test->test_num; - int subi =3D child_test->subtest; - int err =3D child_test->process.err; + struct test_suite *t; + int i, subi, err; bool err_done =3D false; struct strbuf err_output =3D STRBUF_INIT; int last_running =3D -1; int ret; =20 + if (child_test =3D=3D NULL) { + /* Test wasn't started. */ + return; + } + t =3D child_test->test; + i =3D child_test->test_num; + subi =3D child_test->subtest; + err =3D child_test->process.err; /* * For test suites with subtests, display the suite name ahead of the * sub test names. @@ -344,6 +357,8 @@ static int finish_test(struct child_test **child_tests,= int running_test, int ch int running =3D 0; =20 for (int y =3D running_test; y < child_test_num; y++) { + if (child_tests[y] =3D=3D NULL) + continue; if (check_if_command_finished(&child_tests[y]->process) =3D=3D 0) running++; } @@ -396,23 +411,32 @@ static int finish_test(struct child_test **child_test= s, int running_test, int ch print_test_result(t, i, subi, ret, width, /*running=3D*/0); if (err > 0) close(err); - return 0; + zfree(&child_tests[running_test]); } =20 static int start_test(struct test_suite *test, int i, int subi, struct chi= ld_test **child, - int width) + int width, int pass) { int err; =20 *child =3D NULL; if (dont_fork) { - pr_debug("--- start ---\n"); - err =3D test_function(test, subi)(test, subi); - pr_debug("---- end ----\n"); - print_test_result(test, i, subi, err, width, /*running=3D*/0); + if (pass =3D=3D 1) { + pr_debug("--- start ---\n"); + err =3D test_function(test, subi)(test, subi); + pr_debug("---- end ----\n"); + print_test_result(test, i, subi, err, width, /*running=3D*/0); + } + return 0; + } + if (pass =3D=3D 1 && !sequential && test_exclusive(test, subi)) { + /* When parallel, skip exclusive tests on the first pass. */ + return 0; + } + if (pass !=3D 1 && (sequential || !test_exclusive(test, subi))) { + /* Sequential and non-exclusive tests were run on the first pass. */ return 0; } - *child =3D zalloc(sizeof(**child)); if (!*child) return -ENOMEM; @@ -431,10 +455,14 @@ static int start_test(struct test_suite *test, int i,= int subi, struct child_tes (*child)->process.err =3D -1; } (*child)->process.no_exec_cmd =3D run_test_child; - err =3D start_command(&(*child)->process); - if (err || !sequential) - return err; - return finish_test(child, /*running_test=3D*/0, /*child_test_num=3D*/1, w= idth); + if (sequential || pass =3D=3D 2) { + err =3D start_command(&(*child)->process); + if (err) + return err; + finish_test(child, /*running_test=3D*/0, /*child_test_num=3D*/1, width); + return 0; + } + return start_command(&(*child)->process); } =20 #define for_each_test(j, k, t) \ @@ -444,12 +472,11 @@ static int start_test(struct test_suite *test, int i,= int subi, struct child_tes static int __cmd_test(int argc, const char *argv[], struct intlist *skipli= st) { struct test_suite *t; - unsigned int j, k; - int i =3D 0; int width =3D 0; + unsigned int j, k; size_t num_tests =3D 0; struct child_test **child_tests; - int child_test_num =3D 0; + int err =3D 0; =20 for_each_test(j, k, t) { int len =3D strlen(test_description(t, -1)); @@ -472,62 +499,73 @@ static int __cmd_test(int argc, const char *argv[], s= truct intlist *skiplist) if (!child_tests) return -ENOMEM; =20 - for_each_test(j, k, t) { - int curr =3D i++; - - if (!perf_test__matches(test_description(t, -1), curr, argc, argv)) { - bool skip =3D true; + /* + * In parallel mode pass 1 runs non-exclusive tests in parallel, pass 2 + * runs the exclusive tests sequentially. In other modes all tests are + * run in pass 1. + */ + for (int pass =3D 1; pass <=3D 2; pass++) { + int child_test_num =3D 0; + int i =3D 0; + + for_each_test(j, k, t) { + int curr =3D i++; + + if (!perf_test__matches(test_description(t, -1), curr, argc, argv)) { + /* + * Test suite shouldn't be run based on + * description. See if subtest should. + */ + bool skip =3D true; + + for (int subi =3D 0, subn =3D num_subtests(t); subi < subn; subi++) { + if (perf_test__matches(test_description(t, subi), + curr, argc, argv)) + skip =3D false; + } =20 - for (int subi =3D 0, subn =3D num_subtests(t); subi < subn; subi++) { - if (perf_test__matches(test_description(t, subi), - curr, argc, argv)) - skip =3D false; + if (skip) + continue; } =20 - if (skip) + if (intlist__find(skiplist, i)) { + pr_info("%3d: %-*s:", curr + 1, width, test_description(t, -1)); + color_fprintf(stderr, PERF_COLOR_YELLOW, " Skip (user override)\n"); continue; - } - - if (intlist__find(skiplist, i)) { - pr_info("%3d: %-*s:", curr + 1, width, test_description(t, -1)); - color_fprintf(stderr, PERF_COLOR_YELLOW, " Skip (user override)\n"); - continue; - } - - if (!has_subtests(t)) { - int err =3D start_test(t, curr, -1, &child_tests[child_test_num++], wid= th); + } =20 - if (err) { - /* TODO: if !sequential waitpid the already forked children. */ - free(child_tests); - return err; + if (!has_subtests(t)) { + err =3D start_test(t, curr, -1, &child_tests[child_test_num++], + width, pass); + if (err) + goto err_out; + continue; } - } else { for (int subi =3D 0, subn =3D num_subtests(t); subi < subn; subi++) { - int err; - if (!perf_test__matches(test_description(t, subi), curr, argc, argv)) continue; =20 err =3D start_test(t, curr, subi, &child_tests[child_test_num++], - width); + width, pass); if (err) - return err; + goto err_out; } } - } - for (i =3D 0; i < child_test_num; i++) { if (!sequential) { - int ret =3D finish_test(child_tests, i, child_test_num, width); - - if (ret) - return ret; + /* Parallel mode starts tests but doesn't finish them. Do that now. */ + for (size_t x =3D 0; x < num_tests; x++) + finish_test(child_tests, x, num_tests, width); } - free(child_tests[i]); + } +err_out: + if (err) { + pr_err("Internal test harness failure. Completing any started tests:\n:"= ); + for (size_t x =3D 0; x < num_tests; x++) + finish_test(child_tests, x, num_tests, width); } free(child_tests); - return 0; + return err; } =20 static int perf_test__list(int argc, const char **argv) @@ -637,6 +675,7 @@ int cmd_test(int argc, const char **argv) symbol_conf.priv_size =3D sizeof(int); symbol_conf.try_vmlinux_path =3D true; =20 + if (symbol__init(NULL) < 0) return -1; =20 diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c index d33d0952025c..8e328bbd509d 100644 --- a/tools/perf/tests/task-exit.c +++ b/tools/perf/tests/task-exit.c @@ -152,4 +152,11 @@ static int test__task_exit(struct test_suite *test __m= aybe_unused, int subtest _ return err; } =20 -DEFINE_SUITE("Number of exit events of a simple workload", task_exit); +struct test_case tests__task_exit[] =3D { + TEST_CASE_EXCLUSIVE("Number of exit events of a simple workload", task_ex= it), + { .name =3D NULL, } +}; +struct test_suite suite__task_exit =3D { + .desc =3D "Number of exit events of a simple workload", + .test_cases =3D tests__task_exit, +}; diff --git a/tools/perf/tests/tests-scripts.c b/tools/perf/tests/tests-scri= pts.c index ed114b044293..cf3ae0c1d871 100644 --- a/tools/perf/tests/tests-scripts.c +++ b/tools/perf/tests/tests-scripts.c @@ -175,6 +175,7 @@ static void append_script(int dir_fd, const char *name,= char *desc, struct test_suite *test_suite, **result_tmp; struct test_case *tests; size_t len; + char *exclusive; =20 snprintf(link, sizeof(link), "/proc/%d/fd/%d", getpid(), dir_fd); len =3D readlink(link, filename, sizeof(filename)); @@ -191,9 +192,13 @@ static void append_script(int dir_fd, const char *name= , char *desc, return; } tests[0].name =3D strdup_check(name); + exclusive =3D strstr(desc, " (exclusive)"); + if (exclusive !=3D NULL) { + tests[0].exclusive =3D true; + exclusive[0] =3D '\0'; + } tests[0].desc =3D strdup_check(desc); tests[0].run_case =3D shell_test__run; - test_suite =3D zalloc(sizeof(*test_suite)); if (!test_suite) { pr_err("Out of memory while building script test suite list\n"); diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h index 6ea2be86b7bf..ed66b704e438 100644 --- a/tools/perf/tests/tests.h +++ b/tools/perf/tests/tests.h @@ -36,6 +36,7 @@ struct test_case { const char *desc; const char *skip_reason; test_fnptr run_case; + bool exclusive; }; =20 struct test_suite { @@ -62,6 +63,14 @@ struct test_suite { .skip_reason =3D _reason, \ } =20 +#define TEST_CASE_EXCLUSIVE(description, _name) \ + { \ + .name =3D #_name, \ + .desc =3D description, \ + .run_case =3D test__##_name, \ + .exclusive =3D true, \ + } + #define DEFINE_SUITE(description, _name) \ struct test_case tests__##_name[] =3D { \ TEST_CASE(description, _name), \ --=20 2.47.0.rc1.288.g06298d1525-goog From nobody Wed Nov 27 07:32:11 2024 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD52F1E7670 for ; Fri, 11 Oct 2024 22:04:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728684265; cv=none; b=dPu/QY3wCR/dgkRRsX+80ENHPQa+dHAwYfRs50pr4+14QKOygEqWf7C/DXdNOA5clIrP1A0Uv2SRmIntQOV1jWXVaYR6lWas/sOThnhPuULk7Tv4dzFSttcg9TJICHCG20DmrYOVfwgY3wVEs3M+vaJccc/kEAEhjnBFBAm+qpM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728684265; c=relaxed/simple; bh=Ynefxe454usJyeyyMAcQNEBhGJRvDFG9Z+/0i2QGlHw=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=qqe2E22X6jDQgoVwzUmJebscD37dcHOdWx8kFcGOrDy3UEJoYOf/ocn+zb39T19xBhpMDEA78FPEyrr/T0zk4Ew4fgKVjWt2lPM/4afK/lG16IuTXKzvM2K1B2PU3RJ8QiTlrRUpUaDGiy6Hu0TQk9HXPm8/2r//HDJnU1LIzgs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=qJTucdHk; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="qJTucdHk" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e29135d1d0cso2933247276.1 for ; Fri, 11 Oct 2024 15:04:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1728684263; x=1729289063; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=SEuXgYPl/U2CWZEkVhwuy5Ym3mV6u0SmGmtbuxgYEPQ=; b=qJTucdHkSK+rA15RY+1hLCb+2K3FCdQg2+bKyzEwIsLOoa9qaHcZBbDiA6kyWDwEKN GrE11786stb5BbtQw3gOfebvLVw/SRxml092R2oE5EhAyOXy3+bCHFeeyIRCFOd0zIfT Xif5jJss8UjTZeR+W0Tot43+5zmT67VXgEyYqBMQ1Pp9/9yMpzDjoQbkYl1+uLwVqlR8 3mOCPl+H5Dcx87jbhzEJPdueS8YbVGCZ41xxortNBvavpIGqUGarCnnNrKNxVeZ//e0Z /gVWV+0+LpgN+VzftBMAMe3aBZWQk/qRpqn2vw8ScDFRtYYO4UCvsaA9YPvu6uV46/1B TJ/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728684263; x=1729289063; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SEuXgYPl/U2CWZEkVhwuy5Ym3mV6u0SmGmtbuxgYEPQ=; b=V6EJJtPa6O38YwU+v7gHvweOLnQuzY9WSiHObGabGNeCfWB9Z8c+hPzw2A+Y+T9t+O ekZuEoPYqUZ8/rzFHSO1jMoj3L1mahn98Rf0iNTs8hi76Pmm8Dbo+yvptZu3ew1k40hh kaXrGS2KmP/zskjo5/74P2R39gBIUFGhsD54qI4yOPKex4iIidgB97xqhJ+li3/Anr6P CZGviWtDzNGHmNuyeT9ydWC2yLd9wj36JKgPnbCXtNn3h3O5pww6wGP46waSFrT6GKd7 5NAv4NF4ByC1hzRr+OeLJrpj0t9fsQxEH+Rxud1xe81iN/O7tZ8VSFmZLRYM2dykTWa6 HFpg== X-Forwarded-Encrypted: i=1; AJvYcCVoXgxS5SXsTx2Z7PPlAMH3TPP8/PPMrO7ttAjd+yyUj4dVE05TLEBO6Jd519jzd3aoqCmzE5Kbg56m7Nw=@vger.kernel.org X-Gm-Message-State: AOJu0YwE3P88BPZpOhtdIOh5/d5PKlj5Z6gfx6/HFlXQMsqzyM7NPpeR F+pU7x2cblyEMHNdrBNdQexREnmFlWxkh/Z+10ElM5RE60RAMzQqkCimoj2mzUs/W3RzzL+tRhp c8X4FWw== X-Google-Smtp-Source: AGHT+IH9THODVVrpmCzbhLdv1fo6+IgLR2Fi1CErXBsI9e05aQFfRTQnK3sstlhPsF5ZWof0Cx+x1vnPEWw3 X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:8144:56f:2e1e:4db]) (user=irogers job=sendgmr) by 2002:a25:c593:0:b0:e28:ede2:d060 with SMTP id 3f1490d57ef6-e2919dd2c51mr2727276.4.1728684262837; Fri, 11 Oct 2024 15:04:22 -0700 (PDT) Date: Fri, 11 Oct 2024 15:03:54 -0700 In-Reply-To: <20241011220354.756798-1-irogers@google.com> Message-Id: <20241011220354.756798-9-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241011220354.756798-1-irogers@google.com> X-Mailer: git-send-email 2.47.0.rc1.288.g06298d1525-goog Subject: [PATCH v2 8/8] perf test: Make parallel testing the default From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , James Clark , Howard Chu , Athira Jajeev , Michael Petlan , Veronika Molnarova , Dapeng Mi , Thomas Richter , Ilya Leoshkevich , Colin Ian King , Weilin Wang , Andi Kleen , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Now C tests can have the "exclusive" flag to run without other tests, and shell tests can add "(exclusive)" to their description, run tests in parallel by default. Tests which flake when run in parallel can be marked exclusive to resolve the problem. Non-scientifically, the reduction on `perf test` execution time is from 8m35.890s to 3m55.115s on a Tigerlake laptop. So the tests complete in less than half the time. Tested-by: James Clark Signed-off-by: Ian Rogers --- tools/perf/tests/builtin-test.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-tes= t.c index ba3797521d79..09afe884a987 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c @@ -40,8 +40,8 @@ * making them easier to debug. */ static bool dont_fork; -/* Don't fork the tests in parallel and wait for their completion. */ -static bool sequential =3D true; +/* Fork the tests in parallel and wait for their completion. */ +static bool sequential; const char *dso_to_test; const char *test_objdump_path =3D "objdump"; =20 @@ -626,19 +626,12 @@ int cmd_test(int argc, const char **argv) }; const char *skip =3D NULL; const char *workload =3D NULL; - /* - * Run tests in parallel, lacks infrastructure to avoid running tests - * that clash for resources, So leave it as the developers choice to - * enable while working on the needed infra. - */ - bool parallel =3D false; const struct option test_options[] =3D { OPT_STRING('s', "skip", &skip, "tests", "tests to skip"), OPT_INCR('v', "verbose", &verbose, "be more verbose (show symbol address, etc)"), OPT_BOOLEAN('F', "dont-fork", &dont_fork, "Do not fork for testcase"), - OPT_BOOLEAN('p', "parallel", ¶llel, "Run the tests in parallel"), OPT_BOOLEAN('S', "sequential", &sequential, "Run the tests one after another rather than in parallel"), OPT_STRING('w', "workload", &workload, "work", "workload to run for testi= ng"), @@ -669,8 +662,6 @@ int cmd_test(int argc, const char **argv) =20 if (dont_fork) sequential =3D true; - else if (parallel) - sequential =3D false; =20 symbol_conf.priv_size =3D sizeof(int); symbol_conf.try_vmlinux_path =3D true; --=20 2.47.0.rc1.288.g06298d1525-goog