From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756240AbdIHIqa (ORCPT ); Fri, 8 Sep 2017 04:46:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38338 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755012AbdIHIq2 (ORCPT ); Fri, 8 Sep 2017 04:46:28 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B16EC883AB Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=none smtp.mailfrom=jolsa@kernel.org DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B16EC883AB From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , David Ahern , Peter Zijlstra Subject: [PATCH 2/3] perf tools: Open perf.data with O_CLOEXEC flag Date: Fri, 8 Sep 2017 10:46:20 +0200 Message-Id: <20170908084621.31595-2-jolsa@kernel.org> In-Reply-To: <20170908084621.31595-1-jolsa@kernel.org> References: <20170908084621.31595-1-jolsa@kernel.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 08 Sep 2017 08:46:28 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Do not carry the perf.data file descriptor into the workload process and close it when perf executes the workload. Link: http://lkml.kernel.org/n/tip-j7qdp4ucreain1cqvy485wd4@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/util/data.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/data.c b/tools/perf/util/data.c index e84bbc8ec058..6b9d3ec2c276 100644 --- a/tools/perf/util/data.c +++ b/tools/perf/util/data.c @@ -96,7 +96,8 @@ static int open_file_write(struct perf_data_file *file) if (check_backup(file)) return -1; - fd = open(file->path, O_CREAT|O_RDWR|O_TRUNC, S_IRUSR|S_IWUSR); + fd = open(file->path, O_CREAT|O_RDWR|O_TRUNC|O_CLOEXEC, + S_IRUSR|S_IWUSR); if (fd < 0) pr_err("failed to open %s : %s\n", file->path, -- 2.9.5