Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2466800imd; Fri, 2 Nov 2018 11:54:57 -0700 (PDT) X-Google-Smtp-Source: AJdET5dlkGmOyE4FeQf46c/HlQX7sSkDevvBV5gqPye/3CeYoC5jXYulLDXj6g/TK9UksmzS9YKW X-Received: by 2002:a17:902:bc8c:: with SMTP id bb12-v6mr12252162plb.275.1541184897792; Fri, 02 Nov 2018 11:54:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184897; cv=none; d=google.com; s=arc-20160816; b=l2xkJfOGha9QnPHMg2VjJyD0Mg0+2t4XZ464UsMe309JK5IPXDrs32l2ubrCca2Nn8 QkfHQ/3IAughrn+FOjvuK7/wo5heInbjawzq8kKmzvbc4bJ+0aqPTTpFmvH00aFTmx6H Qm9CXq4e8mQ35KyWEKYgSo0uIze+52laD+dNyLGW4kKxRu2EiuEUStdOjcAZTyKd+o4O QMs+HowxTbJWTgK5S23TRr9VrX/b6pg0h6U17eW3DmPwnnPo12QssjsWZaNWV2QqADtj 6vLGEz7PcVbvHO6Yq6E/kv5TmW3MN6n7Km++2t/fmiwGAd8wtsaSNU/c6igascMS62q6 W1Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TVa1tpJVyOTb4ARn2PTicgTQMS7vcLoBCcPQGCItazU=; b=fSt/fy8/VEWzmlXSrSF+IMzlpTdRJ7UnaN2s8p38LQSLmtz6dGsmbBvaH/IB9HeqgM y4eLqMfL+tz2a3h+sc/KK0vRq3tAn1RZzF3UqOczeruU6nkY5egkwir+Y+kBFFrJZdHB UYUVwDGKH2gJ4J+audj1rQ57GboXWZMlJXZkbx5j75fEQoz5FFPa78Ba60fF83CKEKRL Xob8xgjQpbd6pGMrUX5ml9C504UOlL58qRAmzXODoN8wm6/0Mc9+eUADdFLhN0LcN2S6 5yMrwabkUw7KZj7oDcLc+0vNbQuJSXpTZ1abLbb9ROol2T+K/gfy/EZUMkpzn6DOI6P2 ibOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qBRmym91; 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 z67-v6si36619497pfz.5.2018.11.02.11.54.43; Fri, 02 Nov 2018 11:54:57 -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; dkim=pass header.i=@kernel.org header.s=default header.b=qBRmym91; 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 S1730810AbeKCEBQ (ORCPT + 99 others); Sat, 3 Nov 2018 00:01:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:57178 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbeKCEBQ (ORCPT ); Sat, 3 Nov 2018 00:01:16 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 743FD2084A; Fri, 2 Nov 2018 18:52:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541184780; bh=/CQwX9J7SmNqr07KY1ODgXPvi5oX5UDufa02epeGmzA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qBRmym91aH9d1M0CFo7JF3+i+WB7oTp2t4Jn+a8/solg+711yjO2v16CRNlYcfJJ+ VWmdH/VfYQS7xt+95OvH8Va/VhWjuwNa8QKzt6oGIBPBryelPumqyRktwasAvYHE8K Q2knfxNe+T8pv9d7VcQhGnvomPxJQwCARhN6S79Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sandipan Das , Arnaldo Carvalho de Melo , Heiko Carstens , Hendrik Brueckner , Jiri Olsa , Martin Schwidefsky , "Naveen N. Rao" , Ravi Bangoria , Thomas Richter , Sasha Levin Subject: [PATCH 4.14 095/143] perf tests: Fix indexing when invoking subtests Date: Fri, 2 Nov 2018 19:34:40 +0100 Message-Id: <20181102182905.501056788@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182857.064326086@linuxfoundation.org> References: <20181102182857.064326086@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit aa90f9f9554616d5738f7bedb4a8f0e5e14d1bc6 ] 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 Signed-off-by: Sasha Levin --- 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 5966f1f9b160..1c9bc3516f8b 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c @@ -375,7 +375,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: @@ -589,7 +589,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.17.1