Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB231C433EF for ; Fri, 13 May 2022 04:05:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376936AbiEMEFd (ORCPT ); Fri, 13 May 2022 00:05:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376929AbiEMEFb (ORCPT ); Fri, 13 May 2022 00:05:31 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1D3329B01D for ; Thu, 12 May 2022 21:05:28 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id g26-20020a25b11a000000b0064984a4ffb7so6266330ybj.7 for ; Thu, 12 May 2022 21:05:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=eQLC4xvJjx0IxiV0N/NcBewb/ng8rVX8YxuFDVrzqJ4=; b=XH9POhPcsHh4jg4xxmYN8TGVRB/U7SkOA3DVDNu8P65CflDZqAA7Y+crfFelRDSjJD SpPa7TZMucTLUXd80n0haYz8edAh5pZOJHGfDq4a2u6Cy6RL1lYDgN/pUkD827TAyWwv pL/Z39Ifo7YgGaqxWGuHtCCbO5oRsiDGXTcHa/sxPFTAcbntiJxqcTd37hqdT53tdS7v S96OdTM3CKeG341lz3+Ff33aDILA8kLpUhgV+4unE7cZaBynbHDrGxGLDl1xSkfWgZAJ 5v4o/k1WOVkQ1WJsuBFdby2ThuixYWMGLSlHPifYxZBy+f5Dbdcsv3a68oKZra9JnMWS cwfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=eQLC4xvJjx0IxiV0N/NcBewb/ng8rVX8YxuFDVrzqJ4=; b=JNA/7as9I9mGcZqoE5ysK5H1IDdZ785xVqtJEGXShhAqGyS0qtGxtECCJzREhb9MRN 2p2nfXDMUK1tePPZq/ZhlSjG/oh/Thy3xfpSW8SOwxm3RgkaduLa0e3ld0KDUZopw6jD 9DY/4xjjvFUhKy1ePYzSJ7eaFGsnb783+zS6bm9sA083UgHLexL+PU9aRFgkyte4WjdD iEK8Ey959eBPThDJGlKePVJm2ri9AswTcQz0GjI7YgRR5xdTjIgOF1f/bV4ca5lJBUg6 RtvnoArYAN/w4YHjFK82ffIVBHRh8b/PrUoEsdkkYZHUuPeqGQDDIya9PIj5iyPkraTY ZlCw== X-Gm-Message-State: AOAM533mQR6msf2zDx0FDOtpXgJZEbTkdrNy1lDH1fqVJTG3KRfhmlvC s8DJ7hL0txm72wjblS0+FJD1MPdbSbpZ X-Google-Smtp-Source: ABdhPJzyGskPGkpPISS9h8ZWQklnv7XS0yI+qMgu8OSSe6Pf2ExA8jQP6cgqgcYEZ70BN0ziUPOhyo4wrv9b X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:9b61:c91f:ca29:ae54]) (user=irogers job=sendgmr) by 2002:a81:23d8:0:b0:2f8:be91:f46f with SMTP id j207-20020a8123d8000000b002f8be91f46fmr3701717ywj.131.1652414727907; Thu, 12 May 2022 21:05:27 -0700 (PDT) Date: Thu, 12 May 2022 21:05:13 -0700 In-Reply-To: <20220513040519.1499333-1-irogers@google.com> Message-Id: <20220513040519.1499333-2-irogers@google.com> Mime-Version: 1.0 References: <20220513040519.1499333-1-irogers@google.com> X-Mailer: git-send-email 2.36.0.550.gb090851708-goog Subject: [PATCH 1/7] perf test: Skip reason for suites with 1 test From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Riccardo Mancini , Sohaib Mohamed , Carsten Haitzler , Marco Elver , John Garry , Michael Petlan , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Stephane Eranian , Ian Rogers Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org When a suite has just 1 subtest, the subtest number is given as -1 to avoid indented printing. When this subtest number is seen for the skip reason, use the reason of the first test. Signed-off-by: Ian Rogers --- tools/perf/tests/builtin-test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c index fac3717d9ba1..33fcafa0fa79 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c @@ -137,10 +137,10 @@ static bool has_subtests(const struct test_suite *t) static const char *skip_reason(const struct test_suite *t, int subtest) { - if (t->test_cases && subtest >= 0) - return t->test_cases[subtest].skip_reason; + if (!t->test_cases) + return NULL; - return NULL; + return t->test_cases[subtest >= 0 ? subtest : 0].skip_reason; } static const char *test_description(const struct test_suite *t, int subtest) -- 2.36.0.550.gb090851708-goog