Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp776685imm; Thu, 26 Jul 2018 11:48:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcRlwFxtq2WIRH8PdF678HPZRK2WFQXbNI5Yfh10OBckavf+iIqOi3WmcC4pWdURSFDgbUs X-Received: by 2002:a63:f919:: with SMTP id h25-v6mr2912207pgi.401.1532630904181; Thu, 26 Jul 2018 11:48:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532630904; cv=none; d=google.com; s=arc-20160816; b=elAua/jyQvWuavpyM0YlM7l6SZVj5YhHgG/AHawKIumjcJyYVqkXXBUkRNagBWEoae 0m5akvoM6PtbmSacYZ/o6dMFQyJR+pJlISM1IxlAfGmZZsWwe/m0GeEZOV1G3lOOfc6Q b3NSVsYGmBl2oucQiEcvzjWsNRSVFmCBC6t/eZW5IYgpCxKwT1PeJGkwh7hLVRPEknbi /qELntRcy3RsO8C/VRyV+nMzMl8c1jJX+embDMlauSjx/UT4r2rA3v1qU4/8qsq6qsQm IhQtk4EdNWF+c2AnXAe6fL8C2yU7t+aRTuI9QGeY1d4LANbm3Ewdd/63aua8X5pU/1qZ Agaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=tZngqrQCYCgu+fBQyPH6m+PuvQQ8u2Q8jd4DwHwMroA=; b=fyux9WmmWswhwa9AT2tSrBi+aaYL3B234aFC+pUqbeF+g/LlQXmeQ1SdCWOXEGjVP2 rSSHH1X7cBrBjNUv1fH3za4SixnlsfVIX1L15NjapCfRKaDvVBpjUi1l+QNFIB5ZEkEs cu0HusEIXfph9+99pJ1uW8S+903LxRz+Jmjf1PUJXU8JaC7q1oq6uN2CdERjaNI94rgw yyOdwZXdoxkJ47HCVL9Wsqy/mPBeFfVngyGNHdk2vivGf0wM+tqj/Oq+T+ZIr63y15Kb qIiEoHIFLCP3R9I5zjQvFXK+jqjf3uctaFeeYZDMMgNHyv+q2eJS2DE+X5KOtuwYET8D FqoA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w126-v6si2002475pgb.11.2018.07.26.11.48.09; Thu, 26 Jul 2018 11:48:24 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388754AbeGZSf0 (ORCPT + 99 others); Thu, 26 Jul 2018 14:35:26 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:34282 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730269AbeGZSf0 (ORCPT ); Thu, 26 Jul 2018 14:35:26 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6QHE9fO064716 for ; Thu, 26 Jul 2018 13:17:40 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2kfg297abu-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 26 Jul 2018 13:17:40 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 26 Jul 2018 18:17:38 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 26 Jul 2018 18:17:37 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w6QHHZmA41746548 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 26 Jul 2018 17:17:35 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 57401AE045; Thu, 26 Jul 2018 20:17:42 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3CBC6AE056; Thu, 26 Jul 2018 20:17:41 +0100 (BST) Received: from localhost.localdomain (unknown [9.195.22.129]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 26 Jul 2018 20:17:41 +0100 (BST) From: Sandipan Das To: acme@kernel.org Cc: linux-kernel@vger.kernel.org, tmricht@linux.ibm.com, jolsa@redhat.com, ravi.bangoria@linux.ibm.com, naveen.n.rao@linux.vnet.ibm.com Subject: [PATCH] perf tests: Fix indexing when invoking subtests Date: Thu, 26 Jul 2018 22:47:33 +0530 X-Mailer: git-send-email 2.14.4 X-TM-AS-GCONF: 00 x-cbid: 18072617-0012-0000-0000-0000028F3D6B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18072617-0013-0000-0000-000020C12C3A Message-Id: <20180726171733.33208-1-sandipan@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-26_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807260177 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Fixes: 9ef0112442bd ("perf test: Fix subtest number when showing results") Signed-off-by: Sandipan Das --- 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; } -- 2.14.4