lkml.org 
[lkml]   [2017]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v1 1/5] perf/core: Define the common branch type classification
From
Date


On 4/6/2017 5:25 PM, Peter Zijlstra wrote:
> On Thu, Apr 06, 2017 at 04:21:06PM +0800, Jin, Yao wrote:
>> Hi, otherwise we have to maintain 2 branch type copies between kernel and
>> user-space.
>>
>> For example, currently X86_BR_* are defined in lbr.c. To display the branch
>> type in user-space, the user-space has to maintain the same copy for
>> X86_BR_*. I didn't get a better idea.
> I still don't understand what you want; or why it would matter.
>
> Those specific macros are for hardware LBR filter emulation/fixup. What
> does that have to do with any userspace crud?

I just want to provide a new feature that the user can directly check
branch type
in perf report, instead of looking it up in the binary. Binary could be
not available
later, so it's possible that userspace can't get the branch type.

The X86_BR are generated when disassembling the branch instruction in
kernel.
They can be considered as the x86 branch types.

It's easy to let kernel return the x86 branch types to userspace, and
then userspace
shows the branch type in perf report.

While kernel and userspace have to maintain the X86_BR definitions. One
copy is in
kernel and the other copy is in userspace. To avoid the duplicate
definitions , I define
the common branch type in perf_event.h to share between kernel and
userspace.
That's why I do that.

Thanks
Jin Yao

\
 
 \ /
  Last update: 2017-04-06 16:44    [W:0.059 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site