Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1813672imm; Thu, 2 Aug 2018 01:13:12 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdl+tZ1QGK/N2gZL3wxMTEG29zWVIxn+scmhbJDlJwpitU/Ys49xjlG+guXtz5lKUTZ9jeh X-Received: by 2002:a17:902:9042:: with SMTP id w2-v6mr1485866plz.61.1533197592853; Thu, 02 Aug 2018 01:13:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533197592; cv=none; d=google.com; s=arc-20160816; b=ZSXX+1WZYZcyRSQzAjoPOYuoWMDMqOerTCvHLP7ka7XAuQV7Jl6ova8io9ajcioccp 0HLKbg+TAkibNHrsIB446mX4rljQ5GLSPiNbe7hBj/YHdf5XdMwciB2HvwmfK01BiUZm i4gaxuAzf8O3pH48jiLsA7FIDTE3jja20u1TEKCYq/8TvNyHcclG66dq9MWyQ8JK4GSB TPTewvxYI3sWVG8kpb/Dej7MAC9Nw8CWsy0ph4QX2SR8q9YnvzPEddYnA6DclXGDaVs2 gJs3C5JOtEXOaO6EAtC821/voBBZiG+miK9sQMjT5NNciLpg/8tSU4kfYUlnhpSouqRl nd+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=SxxIxtHAK4nTzpUVQE3vZIpoC2DxVXRCIpYoviDHr9g=; b=tO2Xvh2Lz9taDfi3oCN4kb/YsoM2gEfMl9pGAsqW0ZqpbOYBnAulVT8HwyuW8DVrg4 jR8FGjml5/XUInLIs+iDiR/fHxB9FhdV2BLB9bJhkIoKDmC9OYd2Ige6yXw8OIO2o9f3 EZKiTv5guCjQ7SlNNDQehY6kQxsz1uJSH6IWTjVq9Zceh2QPooE3k6mRXkyJG5hBOVLN SZShpf8qY9/ObxQcZ3IAzwpCYLHdVg2/1mAoBD5raXLi6tj78PUezsTJ5oW3NACxjGOq La72rP2GXQ0Mh6wS8MhXzr+JAgx5aNOrmNI6hZ5cPp7F7pd+3kA7He24ThH4sI+yWDI3 TQCA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y67-v6si1390493pfa.47.2018.08.02.01.12.58; Thu, 02 Aug 2018 01:13:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731812AbeHBKBj (ORCPT + 99 others); Thu, 2 Aug 2018 06:01:39 -0400 Received: from terminus.zytor.com ([198.137.202.136]:37473 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726739AbeHBKBj (ORCPT ); Thu, 2 Aug 2018 06:01:39 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w728BUQq3431037 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 2 Aug 2018 01:11:30 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w728BUEf3431034; Thu, 2 Aug 2018 01:11:30 -0700 Date: Thu, 2 Aug 2018 01:11:30 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Sandipan Das Message-ID: Cc: tglx@linutronix.de, ravi.bangoria@linux.ibm.com, naveen.n.rao@linux.vnet.ibm.com, jolsa@redhat.com, mingo@kernel.org, heiko.carstens@de.ibm.com, acme@redhat.com, hpa@zytor.com, schwidefsky@de.ibm.com, brueckner@linux.ibm.com, sandipan@linux.ibm.com, linux-kernel@vger.kernel.org, tmricht@linux.ibm.com Reply-To: naveen.n.rao@linux.vnet.ibm.com, jolsa@redhat.com, tglx@linutronix.de, ravi.bangoria@linux.ibm.com, heiko.carstens@de.ibm.com, hpa@zytor.com, acme@redhat.com, mingo@kernel.org, sandipan@linux.ibm.com, schwidefsky@de.ibm.com, brueckner@linux.ibm.com, tmricht@linux.ibm.com, linux-kernel@vger.kernel.org In-Reply-To: <20180726171733.33208-1-sandipan@linux.ibm.com> References: <20180726171733.33208-1-sandipan@linux.ibm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tests: Fix indexing when invoking subtests Git-Commit-ID: aa90f9f9554616d5738f7bedb4a8f0e5e14d1bc6 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_48_96 autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: aa90f9f9554616d5738f7bedb4a8f0e5e14d1bc6 Gitweb: https://git.kernel.org/tip/aa90f9f9554616d5738f7bedb4a8f0e5e14d1bc6 Author: Sandipan Das AuthorDate: Thu, 26 Jul 2018 22:47:33 +0530 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 31 Jul 2018 10:52:51 -0300 perf tests: Fix indexing when invoking subtests Recently, the subtest numbering was changed to start from 1. While it is fine for displaying results, this should not be the case when the subtests are actually invoked. Typically, the subtests are stored in zero-indexed arrays and invoked based on the index passed to the main test function. Since the index now starts from 1, the second subtest in the array (index 1) gets invoked instead of the first (index 0). This applies to all of the following subtests but for the last one, the subtest always fails because it does not meet the boundary condition of the subtest index being lesser than the number of subtests. This can be observed on powerpc64 and x86_64 systems running Fedora 28 as shown below. Before: # perf test "builtin clang support" 55: builtin clang support : 55.1: builtin clang compile C source to IR : Ok 55.2: builtin clang compile C source to ELF object : FAILED! # perf test "LLVM search and compile" 38: LLVM search and compile : 38.1: Basic BPF llvm compile : Ok 38.2: kbuild searching : Ok 38.3: Compile source for BPF prologue generation : Ok 38.4: Compile source for BPF relocation : FAILED! # perf test "BPF filter" 40: BPF filter : 40.1: Basic BPF filtering : Ok 40.2: BPF pinning : Ok 40.3: BPF prologue generation : Ok 40.4: BPF relocation checker : FAILED! After: # perf test "builtin clang support" 55: builtin clang support : 55.1: builtin clang compile C source to IR : Ok 55.2: builtin clang compile C source to ELF object : Ok # perf test "LLVM search and compile" 38: LLVM search and compile : 38.1: Basic BPF llvm compile : Ok 38.2: kbuild searching : Ok 38.3: Compile source for BPF prologue generation : Ok 38.4: Compile source for BPF relocation : Ok # perf test "BPF filter" 40: BPF filter : 40.1: Basic BPF filtering : Ok 40.2: BPF pinning : Ok 40.3: BPF prologue generation : Ok 40.4: BPF relocation checker : Ok Signed-off-by: Sandipan Das Reported-by: Arnaldo Carvalho de Melo Tested-by: Arnaldo Carvalho de Melo Cc: Heiko Carstens Cc: Hendrik Brueckner Cc: Jiri Olsa Cc: Martin Schwidefsky Cc: Naveen N. Rao Cc: Ravi Bangoria Cc: Thomas Richter Fixes: 9ef0112442bd ("perf test: Fix subtest number when showing results") Link: http://lkml.kernel.org/r/20180726171733.33208-1-sandipan@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/builtin-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c index 4f5de8245b32..d7a5e1b9aa6f 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c @@ -385,7 +385,7 @@ static int test_and_print(struct test *t, bool force_skip, int subtest) if (!t->subtest.get_nr) pr_debug("%s:", t->desc); else - pr_debug("%s subtest %d:", t->desc, subtest); + pr_debug("%s subtest %d:", t->desc, subtest + 1); switch (err) { case TEST_OK: @@ -599,7 +599,7 @@ static int __cmd_test(int argc, const char *argv[], struct intlist *skiplist) for (subi = 0; subi < subn; subi++) { pr_info("%2d.%1d: %-*s:", i, subi + 1, subw, t->subtest.get_desc(subi)); - err = test_and_print(t, skip, subi + 1); + err = test_and_print(t, skip, subi); if (err != TEST_OK && t->subtest.skip_if_fail) skip = true; }