From: "Jin, Yao" <yao.jin@linux.intel.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org,
mingo@redhat.com, alexander.shishkin@linux.intel.com,
Linux-kernel@vger.kernel.org, ak@linux.intel.com,
kan.liang@intel.com, yao.jin@intel.com
Subject: Re: [PATCH v2] perf stat: Append to default list if use -e +event
Date: Thu, 21 Jan 2021 13:05:36 +0800 [thread overview]
Message-ID: <0691a3ff-76fe-eee8-9f44-2b3b276edb84@linux.intel.com> (raw)
In-Reply-To: <20210120212553.GA1798087@krava>
Hi Jiri,
On 1/21/2021 5:25 AM, Jiri Olsa wrote:
> On Mon, Jan 18, 2021 at 12:54:37PM +0800, Jin, Yao wrote:
>> Hi Jiri,
>>
>> On 1/12/2021 6:08 PM, Jiri Olsa wrote:
>>> On Mon, Jan 04, 2021 at 10:18:37AM +0800, Jin Yao wrote:
>>>> The default event list includes the most common events which are widely
>>>> used by users. But with -e option, the current perf only counts the events
>>>> assigned by -e option. Users may want to collect some extra events with
>>>> the default list. For this case, users have to manually add all the events
>>>> from the default list. It's inconvenient. Also, users may don't know how to
>>>> get the default list.
>>>>
>>>> Now it supports a simple syntax: -e +event
>>>>
>>>> The prefix '+' tells perf to append this event (or event list) to default
>>>> event list.
>>>>
>>>> Before:
>>>>
>>>> root@kbl-ppc:~# ./perf stat -e power/energy-pkg/ -a -- sleep 1
>>>>
>>>> Performance counter stats for 'system wide':
>>>>
>>>> 2.04 Joules power/energy-pkg/
>>>>
>>>> 1.000863884 seconds time elapsed
>>>>
>>>> After:
>>>>
>>>> root@kbl-ppc:~# ./perf stat -e +power/energy-pkg/ -a -- sleep 1
>>>>
>>>> Performance counter stats for 'system wide':
>>>>
>>>> 2.11 Joules +power/energy-pkg/ # 0.000 K/sec
>>>
>>> I dont think we should print the extra '+' prefix
>>>
>>> jirka
>>>
>>>> 8,007.17 msec cpu-clock # 7.993 CPUs utilized
>>>> 125 context-switches # 0.016 K/sec
>>>> 8 cpu-migrations # 0.001 K/sec
>>>> 2 page-faults # 0.000 K/sec
>>>> 8,520,084 cycles # 0.001 GHz
>>>> 2,808,302 instructions # 0.33 insn per cycle
>>>> 555,427 branches # 0.069 M/sec
>>>> 59,005 branch-misses # 10.62% of all branches
>>>>
>>>> 1.001832003 seconds time elapsed
>>>>
>>>> Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
>>>
>>
>> Printing '+' prefix is the original behavior.
>>
>> Without this patch,
>>
>> root@kbl-ppc:# ./perf stat -e +power/energy-pkg/ -a -- sleep 1
>>
>> Performance counter stats for 'system wide':
>>
>> 2.02 Joules +power/energy-pkg/
>>
>> 1.000859434 seconds time elapsed
>>
>> The '+' prefix is printed. So I finally decide not to remove the '+' prefix
>> in order to keep original behavior.
>
> hm, originaly there's no purpose for the '+', right?
> it seems it's more like bug then anything else
>
Yes, I also don't understand what's the purpose for the '+'. Just a bug is possible.
> you added function to the '+' to add default events to specified event,
> which I think is good idea, but I don't think we should display the
> extra '+' in output
>
I'm OK to remove the extra '+' in output.
Thanks
Jin Yao
> thanks,
> jirka
>
prev parent reply other threads:[~2021-01-21 5:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-04 2:18 [PATCH v2] perf stat: Append to default list if use -e +event Jin Yao
2021-01-12 10:08 ` Jiri Olsa
2021-01-18 4:54 ` Jin, Yao
2021-01-20 21:25 ` Jiri Olsa
2021-01-21 0:03 ` Arnaldo Carvalho de Melo
2021-01-21 6:08 ` Jin, Yao
2021-01-21 13:02 ` Arnaldo Carvalho de Melo
2021-01-22 1:43 ` Jin, Yao
2021-01-23 23:14 ` Jiri Olsa
2021-01-21 5:05 ` Jin, Yao [this message]
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=0691a3ff-76fe-eee8-9f44-2b3b276edb84@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=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