Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935206AbdGTIxb (ORCPT ); Thu, 20 Jul 2017 04:53:31 -0400 Received: from terminus.zytor.com ([65.50.211.136]:40797 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935321AbdGTIx0 (ORCPT ); Thu, 20 Jul 2017 04:53:26 -0400 Date: Thu, 20 Jul 2017 01:51:11 -0700 From: tip-bot for Jiri Olsa Message-ID: Cc: namhyung@kernel.org, dsahern@gmail.com, tglx@linutronix.de, jolsa@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, acme@redhat.com, a.p.zijlstra@chello.nl, tmricht@linux.vnet.ibm.com, mingo@kernel.org Reply-To: tmricht@linux.vnet.ibm.com, mingo@kernel.org, acme@redhat.com, a.p.zijlstra@chello.nl, linux-kernel@vger.kernel.org, hpa@zytor.com, tglx@linutronix.de, jolsa@kernel.org, namhyung@kernel.org, dsahern@gmail.com In-Reply-To: <20170703145030.12903-3-jolsa@kernel.org> References: <20170703145030.12903-3-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tests attr: Do not store failed events Git-Commit-ID: d78ada4a767a744cad5efa210b8acf57748b91d7 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 Content-Length: 1326 Lines: 36 Commit-ID: d78ada4a767a744cad5efa210b8acf57748b91d7 Gitweb: http://git.kernel.org/tip/d78ada4a767a744cad5efa210b8acf57748b91d7 Author: Jiri Olsa AuthorDate: Mon, 3 Jul 2017 16:50:17 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 18 Jul 2017 23:14:14 -0300 perf tests attr: Do not store failed events Do not mess up our temp space with files we don't need - failed event open attempts. Signed-off-by: Jiri Olsa Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Link: http://lkml.kernel.org/r/20170703145030.12903-3-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/tests/attr.c b/tools/perf/tests/attr.c index 0e77b2c..08b1d5c 100644 --- a/tools/perf/tests/attr.c +++ b/tools/perf/tests/attr.c @@ -136,7 +136,7 @@ void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu, { int errno_saved = errno; - if (store_event(attr, pid, cpu, fd, group_fd, flags)) { + if ((fd != -1) && store_event(attr, pid, cpu, fd, group_fd, flags)) { pr_err("test attr FAILED"); exit(128); }