mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: yuzhoujian <ufo19890607@gmail.com>,
	peterz@infradead.org, mingo@redhat.com,
	alexander.shishkin@linux.intel.com, jolsa@kernel.org,
	namhyung@kernel.org, yuzhoujian@didichuxing.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] Makes all those related functions receive the FILE pointer
Date: Sat, 16 Sep 2017 09:23:32 -0600	[thread overview]
Message-ID: <3ebd97c7-2fbc-757d-f733-5edd901ccc60@gmail.com> (raw)
In-Reply-To: <1505315433-28437-3-git-send-email-yuzhoujian@didichuxing.com>

On 9/13/17 9:10 AM, yuzhoujian wrote:
> @@ -1621,8 +1634,12 @@ static int process_comm_event(struct perf_tool *tool,
>  		sample->tid = event->comm.tid;
>  		sample->pid = event->comm.pid;
>  	}
> -	print_sample_start(sample, thread, evsel);
> -	perf_event__fprintf(event, stdout);
> +	if (tool->orientation_output == false)
> +		fp = stdout;
> +	else
> +		fp = orientation_file;
> +	fprint_sample_start(sample, thread, evsel, fp);
> +	perf_event__fprintf(event, fp);
>  	ret = 0;
>  out:
>  	thread__put(thread);

The subject of this patch is replacing printf and stdout with fprintf
and a given fp. Please keep it to that one change. Meaning the above
setting of fp something other than stdout should be a separate patch.

And it would be best to have the fp selection in a helper, versus the
same change in so many places.

  reply	other threads:[~2017-09-16 15:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-13 15:10 [PATCH 0/3] perf script: Add script per-event-dump support yuzhoujian
2017-09-13 15:10 ` [PATCH 1/3] Add a new element for the struct perf_tool, and add the --per-event-dump option for perf script yuzhoujian
2017-09-16 15:18   ` David Ahern
2017-09-13 15:10 ` [PATCH 2/3] Makes all those related functions receive the FILE pointer yuzhoujian
2017-09-16 15:23   ` David Ahern [this message]
2017-09-13 15:10 ` [PATCH 3/3] Replace printf with fprintf for all the output functions yuzhoujian
2017-09-13 18:51 ` [PATCH 0/3] perf script: Add script per-event-dump support Milian Wolff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3ebd97c7-2fbc-757d-f733-5edd901ccc60@gmail.com \
    --to=dsahern@gmail.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=ufo19890607@gmail.com \
    --cc=yuzhoujian@didichuxing.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®