Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752206AbdIVJEV (ORCPT ); Fri, 22 Sep 2017 05:04:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54206 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752095AbdIVJDH (ORCPT ); Fri, 22 Sep 2017 05:03:07 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 70544C074F11 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jolsa@redhat.com Date: Fri, 22 Sep 2017 11:03:04 +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 4/4] Replace printf with fprintf for all the output functions Message-ID: <20170922090304.GD15856@krava> References: <1505714122-39141-1-git-send-email-yuzhoujian@didichuxing.com> <1505714122-39141-5-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-5-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.31]); Fri, 22 Sep 2017 09:03:07 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 795 Lines: 29 On Mon, Sep 18, 2017 at 01:55:22PM +0800, yuzhoujian wrote: SNIP > static void process_event(struct perf_script *script, > @@ -1389,21 +1389,30 @@ static void process_event(struct perf_script *script, > struct perf_event_attr *attr = &evsel->attr; > unsigned int type = output_type(attr->type); > > + const char *evname; > + char *file_name; > if (output[type].fields == 0) > return; > > + evname = perf_evsel__name(evsel); > + if (script->tool.per_event_dump == true) { > + if (asprintf(&file_name, "%s%s", evname, ".stack") < 0) what's the 'stack' suffix for? It's text dump, should we use .txt? Also I think it should be more than 'cycles.stack', more like: -script-dump-cycles.txt or something like this Arnaldo, thoughts? thanks, jirka