linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Wangnan (F)" <wangnan0@huawei.com>
To: Adrian Hunter <adrian.hunter@intel.com>, <acme@kernel.org>,
	<ast@plumgrid.com>
Cc: <linux-kernel@vger.kernel.org>, <pi3orama@163.com>,
	<lizefan@huawei.com>, Arnaldo Carvalho de Melo <acme@redhat.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [RFC PATCH v2 1/2] perf tools: Set evsel->system_wide field for global system wide recording
Date: Mon, 26 Oct 2015 20:39:07 +0800	[thread overview]
Message-ID: <562E1EEB.2030703@huawei.com> (raw)
In-Reply-To: <562E1B6F.2020202@intel.com>



On 2015/10/26 20:24, Adrian Hunter wrote:
> On 26/10/15 13:41, Wang Nan wrote:
>> evsel->system_wide is introduced by commit bf8e8f4b832972c76d64ab2e2837
>> (perf evlist: Add 'system_wide' option), which is used for mixing evsels
>> that aren't system-wide with ones that are [1]. However, for global
>> system wide recording (perf record -a ...), evsel->system_wide is set
>> to false, which is confusion.
>>
>> This patch set evsel->system_wide to true if the target.system_wide is
>> set, which makes evsel->system_wide a reliable way to describe whether
>> itself is system_wide or not.
>>
>> [1] http://lkml.kernel.org/r/562DF19B.2080608@intel.com
>>
>> Signed-off-by: Wang Nan <wangnan0@huawei.com>
>> Cc: Adrian Hunter <adrian.hunter@intel.com>
>> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
>> Cc: Alexei Starovoitov <ast@plumgrid.com>
>> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
>> Cc: Li Zefan <lizefan@huawei.com>
>> Cc: pi3orama@163.com
>> Link: http://lkml.kernel.org/n/ebpf-qm3gtwidc1o5ktjd9tgjex25@git.kernel.org
>> ---
>>   tools/perf/util/evsel.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
>> index 3ac4ee9c..36ecf0e 100644
>> --- a/tools/perf/util/evsel.c
>> +++ b/tools/perf/util/evsel.c
>> @@ -734,6 +734,7 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts)
>>   	int track = evsel->tracking;
>>   	bool per_cpu = opts->target.default_per_cpu && !opts->target.per_thread;
>>   
>> +	evsel->system_wide = opts->target.system_wide;
> Well that breaks the way evsel->system_wide is used i.e. it is a parameter
> to the evsel and here you just overwrote it.

Currently the only user of evsel->system_wide is IPT:

auxtrace_record__options -> intel_pt_recording_options

and it only set it to true.

So I think changing to this should make it safe:

evsel->system_wide = (evsel->system_wide || opt->target.system_wide);

Thought?

If we want to add further config terms we can put it to 
apply_config_terms(),
where we can implement something like:

  # perf record -e cycles/system-wide/ -e instruction/no-system-wide/ ...

But currently I don't have such requirement.

Thank you.


  reply	other threads:[~2015-10-26 12:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-26 11:41 [RFC PATCH v2 0/2] perf tools: Don't set inherit bit for system wide evsel Wang Nan
2015-10-26 11:41 ` [RFC PATCH v2 1/2] perf tools: Set evsel->system_wide field for global system wide recording Wang Nan
2015-10-26 12:24   ` Adrian Hunter
2015-10-26 12:39     ` Wangnan (F) [this message]
2015-10-26 13:02       ` Adrian Hunter
2015-10-27  3:23         ` Wangnan (F)
2015-10-26 11:42 ` [RFC PATCH v2 2/2] perf tools: Don't set inherit bit for system wide evsel Wang Nan

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=562E1EEB.2030703@huawei.com \
    --to=wangnan0@huawei.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=ast@plumgrid.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=pi3orama@163.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).