From: Robin Murphy <robin.murphy@arm.com>
To: Eugeniy Paltsev <eugeniy.paltsev@synopsys.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-snps-arc@lists.infradead.org"
<linux-snps-arc@lists.infradead.org>
Cc: "mark.rutland@arm.com" <mark.rutland@arm.com>,
"peterz@infradead.org" <peterz@infradead.org>,
Vineet Gupta <vineet.gupta1@synopsys.com>,
Alexey Brodkin <alexey.brodkin@synopsys.com>,
"will.deacon@arm.com" <will.deacon@arm.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"acme@kernel.org" <acme@kernel.org>,
"alexander.shishkin@linux.intel.com"
<alexander.shishkin@linux.intel.com>,
"mingo@redhat.com" <mingo@redhat.com>,
"namhyung@kernel.org" <namhyung@kernel.org>,
"jolsa@redhat.com" <jolsa@redhat.com>
Subject: Re: 'branches' perf event mapping differs on ARC and ARM
Date: Tue, 27 Nov 2018 15:28:25 +0000 [thread overview]
Message-ID: <48cfcbf3-0084-7b17-f30d-371bbb5cbdde@arm.com> (raw)
In-Reply-To: <1543329386.13651.13.camel@synopsys.com>
On 27/11/2018 14:36, Eugeniy Paltsev wrote:
> Hi,
>
> While playing with perf tool on ARMv7 and ARCv2 processors and profiling the
> same application I got interesting results. Even if we got pretty
> similar total
> execution time and instructions number the number of branches on ARC is about
> three times more then on ARM.
>
> I dug into architecture
> specific perf sources and found that we map different
> HW counters into generic 'branches' event on ARC and ARM.
> - We use "ijmp" event on ARC which
> counts all jump and branch instructions (regardless
> of real execution flow - even if no real jump happens)
> - We use "pc_write_retired" event on ARM
> which counts only taken branches (Instruction
> architecturally executed, condition check pass - software change of the PC)
>
> So I was wondering do you know
> which approach is correct?
>
>
>
> I guess counting all jump and branch instructions is correct because we use
> 'branches' event value to calculate relative value of 'branch-misses' using
>
> following formula:
> ----------------------------8----------------------------
> branch-misses-ration = 'branch-misses' / 'branches' * 100.0
> ----------------
> ------------8----------------------------
> And using only taken branches here is incorrect IMHO. So I guess we should
> map 'br_immed_retired' instead of
> "pc_write_retired" into generic 'branches'
> event on ARM.
But register branches (including procedure returns) are also branches,
so only counting immediate branches would be just as, if not more,
misleading.
Robin.
next prev parent reply other threads:[~2018-11-27 15:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-27 14:36 Eugeniy Paltsev
2018-11-27 15:28 ` Robin Murphy [this message]
2018-11-27 17:06 ` Vineet Gupta
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=48cfcbf3-0084-7b17-f30d-371bbb5cbdde@arm.com \
--to=robin.murphy@arm.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=alexey.brodkin@synopsys.com \
--cc=eugeniy.paltsev@synopsys.com \
--cc=jolsa@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-snps-arc@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=vineet.gupta1@synopsys.com \
--cc=will.deacon@arm.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®