Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1455718pxb; Wed, 20 Oct 2021 05:36:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+BOvdxDilAUE+dvXLUfbeUGWYBthHzfDQCO8KYajWre5Pvjwgve6gSepw2D3CWGoUG8nE X-Received: by 2002:a17:902:7783:b0:13d:fee6:8095 with SMTP id o3-20020a170902778300b0013dfee68095mr38763647pll.7.1634733368540; Wed, 20 Oct 2021 05:36:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634733368; cv=none; d=google.com; s=arc-20160816; b=ybL1OcXa+KJLDndpBM2wZtp171O+oCUSqkQXAM2tfbM3WaCI74egqwv+5EUR3lxsu0 7Z0K9QDeBpq/6tXgJXJieianaTffcfry8iWHETNxA1TMhPQLmXK5/gg2TjHTCx8DVoE3 3vh2AiPKYk2lAt2FhtbbIeEKOisSgbSFA9pLTGxR5RWOSwGfDs07LOyivJft0gzlPiO/ 2FnS7KKR/jzEao14YFihiZaTLjd6ujzUj1shi5e5VfEojacfLW9QiiK5qoB9uxfpK5fL N5ZVzFI3nKw8CrsmzKsLvzQ3l9DbjkchAjdCZV7P5iCyLNc5Cz+6Uh7XXNxBEID1uaym 4ggA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=CWo7Mu1LgbVcoVhIHgDtxt4QkLrq2mjDYhM5i0I36Fc=; b=EZmNWJMaMsDDdd/D8+zox6oJ02jb9bdRTGVL+6vhcmb0n2RajqU7exFrlC+FtIZJUW QjBDG5+sU5r99fAUXsj+MsTZl+xhbuh0AFIaCxtJJX/iiR8rEpsEJlA7v1gUggEAFHY8 jsGoDaXtWx2XsAYYMxOqtbONolaPEwhrrNpP80BQ734NGxCslCBEpRuCnkSQFFPWuY9e EEKac9M1zPqjb5d5ze4+bdI7DffjIEdgRW9tQVYvuQoQG5+pLeIGHy0Hn9/Sgp3HNvCZ WD3MA5EQddS/FPvqe8FtEOuoTZ37gSbO4PO84yro0m/wbbtKVTjby/BdGp83MKpSqgns JDyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=e0gesUVf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t63si2696695pgd.159.2021.10.20.05.35.55; Wed, 20 Oct 2021 05:36:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=e0gesUVf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230202AbhJTMg7 (ORCPT + 99 others); Wed, 20 Oct 2021 08:36:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:24933 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229702AbhJTMg6 (ORCPT ); Wed, 20 Oct 2021 08:36:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634733284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CWo7Mu1LgbVcoVhIHgDtxt4QkLrq2mjDYhM5i0I36Fc=; b=e0gesUVfogu4tFKfpY/wY1LcTlGOOwj4MsrSrCtFZ27zwr2LY8Qe4pj59qHg5fg+CZ/PSd kFWjYPeOYqjZOLh1P6HXsBOwckk3yFYlN+itOi/Iar1RYaJ5KAJSH1e6jaCyUGOrH927gc XRZE8K1hBaDW8RHT9yYUTpSTxmsYaR4= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-18-4oGB7FUkP9atzaJ-4UzPRA-1; Wed, 20 Oct 2021 08:34:42 -0400 X-MC-Unique: 4oGB7FUkP9atzaJ-4UzPRA-1 Received: by mail-ed1-f72.google.com with SMTP id x5-20020a50f185000000b003db0f796903so20843466edl.18 for ; Wed, 20 Oct 2021 05:34:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=CWo7Mu1LgbVcoVhIHgDtxt4QkLrq2mjDYhM5i0I36Fc=; b=5+OEGlEq/q+8sCkjyo1fseZ45gdd2H527L2X8PjHOXbn/FJNk9fKawBycGGh3gHRzJ E83E2JDO2NbrgOirQrTU1p3BDSKDytVDUV6xkX346/ya8MDI77XhCyQLw73mj33tqqoH bxfGNi3h64ThCwRNC5iKEdpXwUSDhi/8XxIadvNclzf0w7HILsSMPZtodO0kTDNew2z4 maFdfntozF7WuAWyE+9vdJQeSZwFUqYojn7HjDmbUFj7wmi8JwklxstuRf7d6ECveXRy PcO6rrKZxbycGojx8/Sq2PumgazFy7A3GpcOJLrOtzSMPFjOCx9aokDR1ZOGCzsr53er ozjw== X-Gm-Message-State: AOAM533BReRuVCecdpogZgLdXqAHS8lL5RoWP0V0uCscNGebrIcd6fd/ ZmL7Bp7Zsm52XEeXKfA0SHLoNd8OvNlYY3f6heoPbFa/2YPKKI7A5YbsQHHNxmsvt+E2BIsAyEx w3xbYxs2XTENqPeTXZhijCJ4P X-Received: by 2002:a17:907:c22:: with SMTP id ga34mr43230108ejc.380.1634733281429; Wed, 20 Oct 2021 05:34:41 -0700 (PDT) X-Received: by 2002:a17:907:c22:: with SMTP id ga34mr43230087ejc.380.1634733281247; Wed, 20 Oct 2021 05:34:41 -0700 (PDT) Received: from krava ([83.240.63.48]) by smtp.gmail.com with ESMTPSA id e30sm987114ejl.117.2021.10.20.05.34.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Oct 2021 05:34:40 -0700 (PDT) Date: Wed, 20 Oct 2021 14:34:39 +0200 From: Jiri Olsa To: Ian Rogers Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Namhyung Kim , Jin Yao , John Garry , "Paul A . Clarke" , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Brendan Higgins , Daniel Latypov , David Gow , eranian@google.com Subject: Re: [PATCH v2 06/22] perf test: Add helper functions for abstraction. Message-ID: References: <20211013174604.747276-1-irogers@google.com> <20211013174604.747276-7-irogers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211013174604.747276-7-irogers@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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