Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756717AbdGCOyg (ORCPT ); Mon, 3 Jul 2017 10:54:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60142 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756553AbdGCOui (ORCPT ); Mon, 3 Jul 2017 10:50:38 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A872D80469 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=none smtp.mailfrom=jolsa@kernel.org DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A872D80469 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Peter Zijlstra , Namhyung Kim , David Ahern , Thomas Richter Subject: [PATCH 02/15] perf tests attr: Do not store failed events Date: Mon, 3 Jul 2017 16:50:17 +0200 Message-Id: <20170703145030.12903-3-jolsa@kernel.org> In-Reply-To: <20170703145030.12903-1-jolsa@kernel.org> References: <20170703145030.12903-1-jolsa@kernel.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 03 Jul 2017 14:50:38 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 764 Lines: 24 Do not mess up our temp space with files we don't need - failed event open attempts. Link: http://lkml.kernel.org/n/tip-gfmm0o2bidc41umvecbtsf36@git.kernel.org Signed-off-by: Jiri Olsa --- 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 0e77b2cf61ec..08b1d5ce9020 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); } -- 2.9.4