public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: "Jin, Yao" <yao.jin@linux.intel.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	jolsa@kernel.org, Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Linux-kernel@vger.kernel.org, Andi Kleen <ak@linux.intel.com>,
	kan.liang@intel.com, yao.jin@intel.com
Subject: Re: [PATCH] perf util: Use target->per_thread and target->system_wide flags
Date: Tue, 23 Jan 2018 15:40:33 +0100	[thread overview]
Message-ID: <20180123144033.GA24739@krava> (raw)
In-Reply-To: <06929c28-6431-29f2-340e-6dbc2302c78b@linux.intel.com>

On Tue, Jan 23, 2018 at 07:02:44AM +0800, Jin, Yao wrote:

SNIP

> > >          threads = thread_map__new_str(target->pid, target->tid, target->uid,
> > > -                                     target->per_thread);
> > > +                                     target->per_thread && target->system_wide);
> > 
> > At first glance I thought your solution would do the trick but perf
> > record does use target->system_wide when the '-a' switch is used.
> > Moreover specifying the '-a' switch doesn't prevent the '--per-thread'
> > option from being used as well, making both target->perf_thread and
> > target_system_wide equal to true (and that is not good).
> > 
> > Although not a fan of adding more to struct target, the advantage of
> > having target->all_threads is that we are guaranteed that it isn't
> > used anywhere else.
> > 
> > Let me know what you think,
> > Mathieu
> > 
> 
> If we specify both '-a' and '--per-thread' to perf record, perf record will
> override'--per-thread'. So now target->per_thread = false, and
> target->system_wide = true.
> 
> If we specify '--per-thread' only to perf record, target->per_thread = true,
> and target->system_wide = false.
> 
> So whatever for any case, target->per_thread && target->system_wide is
> false.
> 
> Since the parameter is false, in thread_map__new_str(), it will not execute
> the thread_map__new_all_cpus(). So that will not change perf record previous
> behavior.
> 
> In perf stat, it allows the case that target->per_thread and
> target->system_wide are all true. That means we want to collect system-wide
> per-thread metrics.

could you please put this description into comment
before the thread_map__new_str is called?

thanks,
jirka

  parent reply	other threads:[~2018-01-23 14:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-22 22:15 [PATCH] perf util: Use target->per_thread and target->system_wide flags Jin Yao
2018-01-22 21:10 ` Mathieu Poirier
2018-01-22 23:02   ` Jin, Yao
2018-01-22 23:55     ` Mathieu Poirier
2018-01-23 14:40     ` Jiri Olsa [this message]
2018-01-24  0:12       ` Jin, Yao
2018-01-22 23:56 ` Mathieu Poirier
2018-01-23  1:08   ` Jin, Yao

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=20180123144033.GA24739@krava \
    --to=jolsa@redhat.com \
    --cc=Linux-kernel@vger.kernel.org \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@intel.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=yao.jin@intel.com \
    --cc=yao.jin@linux.intel.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