[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YXAM31HKzS4/qJw/@krava>
Date: Wed, 20 Oct 2021 14:34:39 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Ian Rogers <irogers@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Namhyung Kim <namhyung@...nel.org>,
Jin Yao <yao.jin@...ux.intel.com>,
John Garry <john.garry@...wei.com>,
"Paul A . Clarke" <pc@...ibm.com>,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
Brendan Higgins <brendanhiggins@...gle.com>,
Daniel Latypov <dlatypov@...gle.com>,
David Gow <davidgow@...gle.com>, eranian@...gle.com
Subject: Re: [PATCH v2 06/22] perf test: Add helper functions for abstraction.
On Wed, Oct 13, 2021 at 10:45:48AM -0700, Ian Rogers wrote:
SNIP
> else
> pr_debug("%s subtest %d:", t->desc, subtest + 1);
> @@ -218,11 +257,10 @@ static int test_and_print(struct test_suite *t, bool force_skip, int subtest)
> pr_info(" Ok\n");
> break;
> case TEST_SKIP: {
> - const char *skip_reason = NULL;
> - if (t->subtest.skip_reason)
> - skip_reason = t->subtest.skip_reason(subtest);
> - if (skip_reason)
> - color_fprintf(stderr, PERF_COLOR_YELLOW, " Skip (%s)\n", skip_reason);
> + const char *reason = skip_reason(t, subtest);
> +
> + if (reason)
> + color_fprintf(stderr, PERF_COLOR_YELLOW, " Skip (%s)\n", reason);
> else
> color_fprintf(stderr, PERF_COLOR_YELLOW, " Skip\n");
> }
> @@ -397,7 +435,7 @@ static int __cmd_test(int argc, const char *argv[], struct intlist *skiplist)
> int width = shell_tests__max_desc_width();
>
> for_each_test(j, k, t) {
> - int len = strlen(t->desc);
> + int len = strlen(test_description(t, -1));
>
> if (width < len)
> width = len;
> @@ -407,17 +445,15 @@ static int __cmd_test(int argc, const char *argv[], struct intlist *skiplist)
> int curr = i++, err;
> int subi;
>
> - if (!perf_test__matches(t->desc, curr, argc, argv)) {
> + if (!perf_test__matches(test_description(t, -1), curr, argc, argv)) {
> bool skip = true;
> int subn;
>
> - if (!t->subtest.get_nr)
> - continue;
> -
> - subn = t->subtest.get_nr();
> + subn = num_subtests(t);
should you call continue on !subn ?
jirka
>
> for (subi = 0; subi < subn; subi++) {
> - if (perf_test__matches(t->subtest.get_desc(subi), curr, argc, argv))
> + if (perf_test__matches(test_description(t, subi),
> + curr, argc, argv))
> skip = false;
> }
>
> @@ -425,22 +461,23 @@ static int __cmd_test(int argc, const char *argv[], struct intlist *skiplist)
> continue;
> }
>
SNIP
Powered by blists - more mailing lists