linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org,
	Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Hendrik Brueckner <brueckner@linux.vnet.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Sasha Levin <alexander.levin@verizon.com>
Subject: [PATCH 3.18 08/26] perf test attr: Fix ignored test case result
Date: Thu,  7 Dec 2017 13:48:21 +0100	[thread overview]
Message-ID: <20171207124655.779332185@linuxfoundation.org> (raw)
In-Reply-To: <20171207124654.669583826@linuxfoundation.org>

3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Thomas Richter <tmricht@linux.vnet.ibm.com>


[ Upstream commit 22905582f6dd4bbd0c370fe5732c607452010c04 ]

Command perf test -v 16 (Setup struct perf_event_attr test) always
reports success even if the test case fails.  It works correctly if you
also specify -F (for don't fork).

   root@s35lp76 perf]# ./perf test -v 16
   15: Setup struct perf_event_attr               :
   --- start ---
   running './tests/attr/test-record-no-delay'
   [ perf record: Woken up 1 times to write data ]
   [ perf record: Captured and wrote 0.002 MB /tmp/tmp4E1h7R/perf.data
     (1 samples) ]
   expected task=0, got 1
   expected precise_ip=0, got 3
   expected wakeup_events=1, got 0
   FAILED './tests/attr/test-record-no-delay' - match failure
   test child finished with 0
   ---- end ----
   Setup struct perf_event_attr: Ok

The reason for the wrong error reporting is the return value of the
system() library call. It is called in run_dir() file tests/attr.c and
returns the exit status, in above case 0xff00.

This value is given as parameter to the exit() function which can only
handle values 0-0xff.

The child process terminates with exit value of 0 and the parent does
not detect any error.

This patch corrects the error reporting and prints the correct test
result.

Signed-off-by: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
LPU-Reference: 20170913081209.39570-2-tmricht@linux.vnet.ibm.com
Link: http://lkml.kernel.org/n/tip-rdube6rfcjsr1nzue72c7lqn@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 tools/perf/tests/attr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/tools/perf/tests/attr.c
+++ b/tools/perf/tests/attr.c
@@ -150,7 +150,7 @@ static int run_dir(const char *d, const
 	snprintf(cmd, 3*PATH_MAX, PYTHON " %s/attr.py -d %s/attr/ -p %s %.*s",
 		 d, d, perf, vcnt, v);
 
-	return system(cmd);
+	return system(cmd) ? TEST_FAIL : TEST_OK;
 }
 
 int test__attr(void)

  parent reply	other threads:[~2017-12-07 12:49 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07 12:48 [PATCH 3.18 00/26] 3.18.87-stable review Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 01/26] bcache: only permit to recovery read error when cache device is clean Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 02/26] bcache: recover data from backing when data " Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 03/26] serial: 8250_fintek: Fix rs485 disablement on invalid ioctl() Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 04/26] spi: sh-msiof: Fix DMA transfer size check Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 05/26] EDAC, sb_edac: Fix missing break in switch Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 06/26] sysrq : fix Show Regs call trace on ARM Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 07/26] usbip: tools: Install all headers needed for libusbip development Greg Kroah-Hartman
2017-12-07 12:48 ` Greg Kroah-Hartman [this message]
2017-12-07 12:48 ` [PATCH 3.18 09/26] ARM: OMAP1: DMA: Correct the number of logical channels Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 10/26] vti6: fix device register to report IFLA_INFO_KIND Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 11/26] net/appletalk: Fix kernel memory disclosure Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 12/26] nfs: Dont take a reference on fl->fl_file for LOCK operation Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 13/26] NFSv4: Fix client recovery when server reboots multiple times Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 14/26] net: sctp: fix array overrun read on sctp_timer_tbl Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 15/26] tipc: fix cleanup at module unload Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 16/26] mm: avoid returning VM_FAULT_RETRY from ->page_mkwrite handlers Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 17/26] net: fec: fix multicast filtering hardware setup Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 18/26] ima: fix hash algorithm initialization Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 19/26] uas: Always apply US_FL_NO_ATA_1X quirk to Seagate devices Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 20/26] usb: quirks: Add no-lpm quirk for KY-688 USB 3.1 Type-C Hub Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 21/26] serial: 8250_pci: Add Amazon PCI serial device ID Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 22/26] usb: hub: Cycle HUB power when initialization fails Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 23/26] USB: Increase usbfs transfer limit Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 24/26] USB: devio: Prevent integer overflow in proc_do_submiturb() Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 25/26] USB: usbfs: Filter flags passed in from user space Greg Kroah-Hartman
2017-12-07 12:48 ` [PATCH 3.18 26/26] usb: host: fix incorrect updating of offset Greg Kroah-Hartman
2017-12-07 20:54 ` [PATCH 3.18 00/26] 3.18.87-stable review Guenter Roeck
2017-12-08  0:06 ` Shuah Khan

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=20171207124655.779332185@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=acme@redhat.com \
    --cc=alexander.levin@verizon.com \
    --cc=brueckner@linux.vnet.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=stable@vger.kernel.org \
    --cc=tmricht@linux.vnet.ibm.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).