From: Michael Ellerman <mpe@ellerman.id.au>
To: Segher Boessenkool <segher@kernel.crashing.org>, "Jin\,
Yao" <yao.jin@linux.intel.com>
Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org,
mingo@redhat.com, alexander.shishkin@linux.intel.com,
kan.liang@intel.com, ak@linux.intel.com,
linuxppc-dev@lists.ozlabs.org, Linux-kernel@vger.kernel.org,
yao.jin@intel.com
Subject: Re: [PATCH v6 1/7] perf/core: Define the common branch type classification
Date: Tue, 11 Jul 2017 12:13:46 +1000 [thread overview]
Message-ID: <87vamz7mat.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <20170710131049.GA13471@gate.crashing.org>
Segher Boessenkool <segher@kernel.crashing.org> writes:
> Hi!
>
> On Mon, Jul 10, 2017 at 07:46:17PM +0800, Jin, Yao wrote:
>> 1. We all agree these definitions:
>>
>> + PERF_BR_COND = 1, /* conditional */
>> + PERF_BR_UNCOND = 2, /* unconditional */
>> + PERF_BR_IND = 3, /* indirect */
>> + PERF_BR_CALL = 4, /* call */
>> + PERF_BR_IND_CALL = 5, /* indirect call */
>> + PERF_BR_RET = 6, /* return */
>> + PERF_BR_SYSCALL = 7, /* syscall */
>> + PERF_BR_SYSRET = 8, /* syscall return */
>> + PERF_BR_IRET = 11, /* return from interrupt */
>
> Do we? It does not map very well to PowerPC branch types.
I think they map well enough to the types of branches that are actually
used in practice.
To represent the full range of possibilities we'd need to switch to a
bitmap of flags, ie. COND, IND, CALL, RET, SYSCALL, INT, etc. But it
would need more than 4 bits and I don't think there's that much added
value in being able to represent all the bizarre combinations.
But maybe that is the best option as it makes the API more flexible and
means we don't have to get the list of branches correct up front?
I ran some quick numbers on a kernel I had here (powernv w/gcc 7):
Type Percent
-----------------
cond 40.92% beq (79166) bne (57379) ble (10411) bgt (9587) blt (6248) bge (3704) bdnz (1251) bdz (353) bns (30) bdnzf (2) bdnzt (1)
uncond 14.89% b (61182)
indirect 0.10% bctr (418)
call 33.33% bl (136926)
ind call 1.44% bctrl (5912)
return 9.23% blr (37943)
= 99.91%
If we add cond call/return that covers another 0.08% taking us to 99.99%
of branches.
I know future compilers and or different code might use a different
distribution, but I doubt it will change all that much.
Maybe cond could be broken down further, but the only really meaningful
sub category I can think of is the decrementing type, and those are
quite rare.
cheers
next prev parent reply other threads:[~2017-07-11 2:13 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-20 12:07 [PATCH v6 0/7] perf report: Show branch type Jin Yao
2017-04-20 9:36 ` Jiri Olsa
2017-04-23 8:36 ` Jin, Yao
2017-06-02 8:02 ` Jin, Yao
2017-06-26 6:24 ` Jin, Yao
2017-07-06 1:47 ` Jin, Yao
2017-04-20 12:07 ` [PATCH v6 1/7] perf/core: Define the common branch type classification Jin Yao
2017-07-07 8:42 ` Peter Zijlstra
2017-07-10 5:19 ` Michael Ellerman
2017-07-10 6:05 ` Michael Ellerman
2017-07-10 8:16 ` Jin, Yao
2017-07-10 10:32 ` Michael Ellerman
2017-07-10 11:46 ` Jin, Yao
2017-07-10 13:10 ` Segher Boessenkool
2017-07-10 13:28 ` Jin, Yao
2017-07-10 13:46 ` Peter Zijlstra
2017-07-10 14:06 ` Jin, Yao
2017-07-11 2:28 ` Michael Ellerman
2017-07-11 3:00 ` Jin, Yao
2017-07-10 14:37 ` Segher Boessenkool
2017-07-11 2:13 ` Michael Ellerman [this message]
2017-04-20 12:07 ` [PATCH v6 2/7] perf/x86/intel: Record branch type Jin Yao
2017-04-23 13:55 ` Jiri Olsa
2017-04-24 0:47 ` Jin, Yao
2017-05-08 0:49 ` Jin, Yao
2017-05-09 8:26 ` Jiri Olsa
2017-05-09 11:57 ` Jin, Yao
2017-05-09 12:39 ` Jiri Olsa
2017-05-10 0:18 ` Jin, Yao
2017-04-20 12:07 ` [PATCH v6 3/7] perf record: Create a new option save_type in --branch-filter Jin Yao
2017-04-20 12:07 ` [PATCH v6 4/7] perf report: Refactor the branch info printing code Jin Yao
2017-04-20 12:07 ` [PATCH v6 5/7] perf util: Create branch.c/.h for common branch functions Jin Yao
2017-04-20 12:07 ` [PATCH v6 6/7] perf report: Show branch type statistics for stdio mode Jin Yao
2017-04-20 12:07 ` [PATCH v6 7/7] perf report: Show branch type in callchain entry Jin Yao
2017-07-07 8:09 ` [PATCH v6 0/7] perf report: Show branch type Jiri Olsa
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=87vamz7mat.fsf@concordia.ellerman.id.au \
--to=mpe@ellerman.id.au \
--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=linuxppc-dev@lists.ozlabs.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=segher@kernel.crashing.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
all inboxes | Powered by JetHome®