linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: Clark Williams <williams@redhat.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Sandipan Das <sandipan@linux.ibm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Hendrik Brueckner <brueckner@linux.ibm.com>,
	Jiri Olsa <jolsa@redhat.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	"Naveen N . Rao" <naveen.n.rao@linux.vnet.ibm.com>,
	Ravi Bangoria <ravi.bangoria@linux.ibm.com>,
	Thomas Richter <tmricht@linux.ibm.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 09/21] perf tests: Fix indexing when invoking subtests
Date: Wed,  1 Aug 2018 18:36:36 -0300	[thread overview]
Message-ID: <20180801213648.4814-10-acme@kernel.org> (raw)
In-Reply-To: <20180801213648.4814-1-acme@kernel.org>

From: Sandipan Das <sandipan@linux.ibm.com>

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 <sandipan@linux.ibm.com>
Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Hendrik Brueckner <brueckner@linux.ibm.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Thomas Richter <tmricht@linux.ibm.com>
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 <acme@redhat.com>
---
 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

  parent reply	other threads:[~2018-08-01 21:36 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-01 21:36 [GIT PULL 00/21] perf/core improvements and fixes Arnaldo Carvalho de Melo
2018-08-01 21:36 ` [PATCH 01/21] perf trace beauty: Default header_dir to cwd to work without parms Arnaldo Carvalho de Melo
2018-08-01 21:36 ` [PATCH 02/21] perf evlist: Fix error out while applying initial delay and LBR Arnaldo Carvalho de Melo
2018-08-01 21:36 ` [PATCH 03/21] perf tests: Fix complex event name parsing Arnaldo Carvalho de Melo
2018-08-01 21:36 ` [PATCH 04/21] tools include uapi: Grab a copy of linux/in.h Arnaldo Carvalho de Melo
2018-08-01 21:36 ` [PATCH 05/21] perf beauty: Add a generator for IPPROTO_ socket's protocol constants Arnaldo Carvalho de Melo
2018-08-01 21:36 ` [PATCH 06/21] perf trace beauty: Do not print NULL strarray entries Arnaldo Carvalho de Melo
2018-08-01 21:36 ` [PATCH 07/21] perf trace beauty: Add beautifiers for 'socket''s 'protocol' arg Arnaldo Carvalho de Melo
2018-08-01 21:36 ` [PATCH 08/21] perf trace: Beautify the AF_INET & AF_INET6 'socket' syscall 'protocol' args Arnaldo Carvalho de Melo
2018-08-01 21:36 ` Arnaldo Carvalho de Melo [this message]
2018-08-01 21:36 ` [PATCH 10/21] perf c2c report: Fix crash for empty browser Arnaldo Carvalho de Melo
2018-08-01 21:36 ` [PATCH 11/21] perf build: Fix installation directory for eBPF Arnaldo Carvalho de Melo
2018-08-01 21:36 ` [PATCH 12/21] perf cs-etm: Fix start tracing packet handling Arnaldo Carvalho de Melo
2018-08-01 21:36 ` [PATCH 13/21] perf cs-etm: Support dummy address value for CS_ETM_TRACE_ON packet Arnaldo Carvalho de Melo
2018-08-01 21:36 ` [PATCH 14/21] perf cs-etm: Generate branch sample when receiving a " Arnaldo Carvalho de Melo
2018-08-01 21:36 ` [PATCH 15/21] perf cs-etm: Generate branch sample for " Arnaldo Carvalho de Melo
2018-08-01 21:36 ` [PATCH 16/21] perf vendor events arm64: Update ThunderX2 implementation defined pmu core events Arnaldo Carvalho de Melo
2018-08-01 21:36 ` [PATCH 17/21] perf list: Unify metric group description format with PMU event description Arnaldo Carvalho de Melo
2018-08-01 21:36 ` [PATCH 18/21] perf bpf: Show better message when failing to load an object Arnaldo Carvalho de Melo
2018-08-01 21:36 ` [PATCH 19/21] perf tools: Allow overriding MAX_NR_CPUS at compile time Arnaldo Carvalho de Melo
2018-08-01 21:36 ` [PATCH 20/21] perf bpf: Include uapi/linux/bpf.h from the 'perf trace' script's bpf.h Arnaldo Carvalho de Melo
2018-08-01 21:36 ` [PATCH 21/21] perf trace: Do not require --no-syscalls to suppress strace like output Arnaldo Carvalho de Melo
2018-08-02  8:03 ` [GIT PULL 00/21] perf/core improvements and fixes Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180801213648.4814-10-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=brueckner@linux.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --cc=ravi.bangoria@linux.ibm.com \
    --cc=sandipan@linux.ibm.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=tmricht@linux.ibm.com \
    --cc=williams@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).