From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756889AbdIHSL5 (ORCPT ); Fri, 8 Sep 2017 14:11:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:43170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756671AbdIHSLz (ORCPT ); Fri, 8 Sep 2017 14:11:55 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 033B521D28 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org Date: Fri, 8 Sep 2017 15:11:52 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: lkml , Ingo Molnar , Namhyung Kim , David Ahern , Peter Zijlstra Subject: Re: [PATCH 2/3] perf tools: Open perf.data with O_CLOEXEC flag Message-ID: <20170908181152.GE10112@kernel.org> References: <20170908084621.31595-1-jolsa@kernel.org> <20170908084621.31595-2-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170908084621.31595-2-jolsa@kernel.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Sep 08, 2017 at 10:46:20AM +0200, Jiri Olsa escreveu: > Do not carry the perf.data file descriptor into > the workload process and close it when perf > executes the workload. Fails in some systems with: util/data.c: In function 'open_file_write': util/data.c:99: error: 'O_CLOEXEC' undeclared (first use in this function) util/data.c:99: error: (Each undeclared identifier is reported only once util/data.c:99: error: for each function it appears in.) mv: cannot stat `/tmp/build/perf/util/.data.o.tmp': No such file or directory just FYI, I'll get this fixed. Thanks, - Arnaldo > 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