linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jin, Yao" <yao.jin@linux.intel.com>
To: Jiri Olsa <jolsa@redhat.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: Wed, 24 Jan 2018 08:12:33 +0800	[thread overview]
Message-ID: <b3bfad9f-8c57-745c-b4ea-258733d9d740@linux.intel.com> (raw)
In-Reply-To: <20180123144033.GA24739@krava>



On 1/23/2018 10:40 PM, Jiri Olsa wrote:
> 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
> 

OK, I will put this comment in v2. I will send v2 soon.

Thanks
Jin Yao

  reply	other threads:[~2018-01-24  0:13 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
2018-01-24  0:12       ` Jin, Yao [this message]
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=b3bfad9f-8c57-745c-b4ea-258733d9d740@linux.intel.com \
    --to=yao.jin@linux.intel.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=jolsa@redhat.com \
    --cc=kan.liang@intel.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=yao.jin@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;
as well as URLs for NNTP newsgroup(s).