From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752274AbdHNRr2 (ORCPT ); Mon, 14 Aug 2017 13:47:28 -0400 Received: from terminus.zytor.com ([65.50.211.136]:57403 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751520AbdHNRrZ (ORCPT ); Mon, 14 Aug 2017 13:47:25 -0400 Date: Mon, 14 Aug 2017 10:44:45 -0700 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: linux-kernel@vger.kernel.org, adrian.hunter@intel.com, dsahern@gmail.com, tglx@linutronix.de, tmricht@linux.vnet.ibm.com, namhyung@kernel.org, wangnan0@huawei.com, jolsa@kernel.org, mpetlan@redhat.com, mingo@kernel.org, acme@redhat.com, hpa@zytor.com, matt.fleming@intel.com Reply-To: dsahern@gmail.com, adrian.hunter@intel.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, tmricht@linux.vnet.ibm.com, mpetlan@redhat.com, wangnan0@huawei.com, jolsa@kernel.org, namhyung@kernel.org, acme@redhat.com, hpa@zytor.com, mingo@kernel.org, matt.fleming@intel.com To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf test: Make 'list' subcommand match main 'perf test' numbering/matching Git-Commit-ID: 28765bf263fcfef2f1508d603a7171b8263a3d68 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 28765bf263fcfef2f1508d603a7171b8263a3d68 Gitweb: http://git.kernel.org/tip/28765bf263fcfef2f1508d603a7171b8263a3d68 Author: Arnaldo Carvalho de Melo AuthorDate: Fri, 4 Aug 2017 11:16:40 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Fri, 11 Aug 2017 10:42:53 -0300 perf test: Make 'list' subcommand match main 'perf test' numbering/matching Before: # perf test Synth 39: Synthesize thread map : Ok 41: Synthesize cpu map : Ok 42: Synthesize stat config : Ok 43: Synthesize stat : Ok 44: Synthesize stat round : Ok 45: Synthesize attr update : Ok # # perf test list Synth 1: Synthesize thread map 2: Synthesize cpu map 3: Synthesize stat config 4: Synthesize stat 5: Synthesize stat round 6: Synthesize attr update # After: # perf test Synth 39: Synthesize thread map : Ok 41: Synthesize cpu map : Ok 42: Synthesize stat config : Ok 43: Synthesize stat : Ok 44: Synthesize stat round : Ok 45: Synthesize attr update : Ok # # perf test list Synth 39: Synthesize thread map 41: Synthesize cpu map 42: Synthesize stat config 43: Synthesize stat 44: Synthesize stat round 45: Synthesize attr update # Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Matt Fleming Cc: Michael Petlan Cc: Namhyung Kim Cc: Thomas Richter Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-pjhuhkphs7o3tkbqrukfv6bz@git.kernel.org Fixes: e8210cefb7e1 ("perf tests: Introduce iterator function for tests") Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/builtin-test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c index 3ccfd58..436e229 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c @@ -465,10 +465,12 @@ static int perf_test__list(int argc, const char **argv) int i = 0; for_each_test(j, t) { + ++i; + if (argc > 1 && !strstr(t->desc, argv[1])) continue; - pr_info("%2d: %s\n", ++i, t->desc); + pr_info("%2d: %s\n", i, t->desc); } return 0;