All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: 禹舟键 <ufo19890607@gmail.com>
Cc: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>,
	peterz@infradead.org, mingo@redhat.com,
	alexander.shishkin@linux.intel.com, jolsa@kernel.org,
	David Ahern <dsahern@gmail.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Milian Wolff <milian.wolff@kdab.com>,
	Wind Yu <yuzhoujian@didichuxing.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/4] Add fp argument to print functions
Date: Wed, 18 Oct 2017 09:22:09 -0300	[thread overview]
Message-ID: <20171018122209.GF3707@kernel.org> (raw)
In-Reply-To: <CAHCio2ggZapg7KvWOO3OonFTHq5CZ02c2sghTpP73QBJ0mi9jg@mail.gmail.com>

Em Wed, Oct 18, 2017 at 07:54:13PM +0800, 禹舟键 escreveu:
> Hi, Arnaldo
> I have done it as you said in v1 patch, but David had told me to separate
> the patch :"Makes all those related functions receive the FILE pointer"  to
> two patches. Below is his opinion.
> 
> 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.

I have done exactly as described in my and David's suggestion, this
"orientation_file" change is not in my patch.

> And it would be best to have the fp selection in a helper, versus the
> same change in so many places. "
> 
> So, what should I do??

Please consider continuing from the other suggestion I made in a recent
message, about how to use evsel->priv to store the perf evsel FILE
pointer.

- Arnaldo

  parent reply	other threads:[~2017-10-18 12:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-11 18:23 [PATCH v3 0/4] perf script: Add script per-event-dump support ufo19890607
2017-10-11 18:23 ` [PATCH v3 1/4] Add two elements for perf_tool struct, and add three elements for perf_evsel struct, and add the per-event-dump option for perf script ufo19890607
2017-10-11 18:23 ` [PATCH v3 2/4] Add fp argument to print functions ufo19890607
2017-10-17 14:01   ` Arnaldo Carvalho de Melo
     [not found]     ` <CAHCio2ggZapg7KvWOO3OonFTHq5CZ02c2sghTpP73QBJ0mi9jg@mail.gmail.com>
2017-10-18 12:22       ` Arnaldo Carvalho de Melo [this message]
2017-10-11 18:23 ` [PATCH v3 3/4] Replace printf with fprintf for all " ufo19890607
2017-10-11 18:24 ` [PATCH v3 4/4] Make all print functions receive the fp argument, open and close the dump_event file for each evsel, and calculate the dump_event file's size ufo19890607

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=20171018122209.GF3707@kernel.org \
    --to=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=arnaldo.melo@gmail.com \
    --cc=dsahern@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=milian.wolff@kdab.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.