[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <74097816-3f36-abea-1eaa-8942aedd7322@linux.intel.com>
Date: Wed, 12 Aug 2020 21:02:10 +0800
From: Like Xu <like.xu@...ux.intel.com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>,
Jin Yao <yao.jin@...ux.intel.com>
Cc: jolsa@...nel.org, peterz@...radead.org, mingo@...hat.com,
alexander.shishkin@...ux.intel.com, Linux-kernel@...r.kernel.org,
ak@...ux.intel.com, kan.liang@...el.com, yao.jin@...el.com
Subject: Re: [PATCH] perf parse-events: Set exclude_guest for user-space
counting
On 2020/8/12 20:15, Arnaldo Carvalho de Melo wrote:
> Em Wed, Aug 12, 2020 at 02:59:53PM +0800, Jin Yao escreveu:
>> Currently if we run 'perf record -e cycles:u', exclude_guest is 0.
>>
>> But it doesn't make sense that we request for user-space counting
>> but we also get the guest report.
>>
Please hold the horse and allow this possibility.
Some authorized perf users on the host may
only want to count (KVM) guest user space events.
Thanks,
Like Xu
>> To keep perf semantics consistent and clear, this patch sets
>> exclude_guest for user-space counting.
>
> Applied, and also added this, that you should consider doing in the
> future (modulo the "Committer testing:" header :) ):
>
> Committer testing:
>
> Before:
>
> # perf record -e cycles:u
> ^C[ perf record: Woken up 1 times to write data ]
> [ perf record: Captured and wrote 1.231 MB perf.data (91 samples) ]
> #
> # perf evlist -v
> cycles:u: size: 120, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|ID|CPU|PERIOD, read_format: ID, disabled: 1, inherit: 1, exclude_kernel: 1, exclude_hv: 1, freq: 1, sample_id_all: 1
> <SNIP>
> #
>
> After:
>
> # perf record -e cycles:u
> ^C[ perf record: Woken up 1 times to write data ]
> [ perf record: Captured and wrote 1.263 MB perf.data (403 samples) ]
> #
> # perf evlist -v
> cycles:u: size: 120, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|ID|CPU|PERIOD, read_format: ID, disabled: 1, inherit: 1, exclude_kernel: 1, exclude_hv: 1, freq: 1, sample_id_all: 1, exclude_guest: 1
> #
>
> ----
>
> I.e. show actual command output before and after that demonstrates the
> problem and then the solution.
>
>> Signed-off-by: Jin Yao <yao.jin@...ux.intel.com>
>> ---
>> tools/perf/util/parse-events.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
>> index 9f7260e69113..4d809f1fe269 100644
>> --- a/tools/perf/util/parse-events.c
>> +++ b/tools/perf/util/parse-events.c
>> @@ -1794,6 +1794,8 @@ static int get_event_modifier(struct event_modifier *mod, char *str,
>> if (*str == 'u') {
>> if (!exclude)
>> exclude = eu = ek = eh = 1;
>> + if (!exclude_GH)
>> + eG = 1;
>> eu = 0;
>> } else if (*str == 'k') {
>> if (!exclude)
>> --
>> 2.17.1
>>
>
Powered by blists - more mailing lists