Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752163AbdIVJDd (ORCPT ); Fri, 22 Sep 2017 05:03:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51494 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751808AbdIVJDa (ORCPT ); Fri, 22 Sep 2017 05:03:30 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6BFDE4A6E8 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jolsa@redhat.com Date: Fri, 22 Sep 2017 11:03:27 +0200 From: Jiri Olsa To: yuzhoujian Cc: peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, dsahern@gmail.com, namhyung@kernel.org, milian.wolff@kdab.com, arnaldo.melo@gmail.com, yuzhoujian@didichuxing.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/4] Add the fp_selection_helper function to set the file pointer for the related functions Message-ID: <20170922090327.GG15856@krava> References: <1505714122-39141-1-git-send-email-yuzhoujian@didichuxing.com> <1505714122-39141-4-git-send-email-yuzhoujian@didichuxing.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1505714122-39141-4-git-send-email-yuzhoujian@didichuxing.com> User-Agent: Mutt/1.9.0 (2017-09-02) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 22 Sep 2017 09:03:30 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 753 Lines: 24 On Mon, Sep 18, 2017 at 01:55:21PM +0800, yuzhoujian wrote: > Signed-off-by: yuzhoujian > --- > tools/perf/builtin-script.c | 24 ++++++++++++++++-------- > 1 file changed, 16 insertions(+), 8 deletions(-) > > diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c > index f709f6f..89bab68 100644 > --- a/tools/perf/builtin-script.c > +++ b/tools/perf/builtin-script.c > @@ -1527,6 +1527,13 @@ static int cleanup_scripting(void) > return scripting_ops ? scripting_ops->stop_script() : 0; > } > > +static FILE *fp_selection_helper(bool per_event_dump) > +{ > + if (per_event_dump == false) > + return stdout; > + else > + return per_event_dump_file; when's the per_event_dump_file ever set? jirka