All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jin, Yao" <yao.jin@linux.intel.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>,
	linux-kernel@vger.kernel.org, ak@linux.intel.com,
	kan.liang@intel.com, yao.jin@intel.com,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH v1 1/5] perf/core: Define the common branch type classification
Date: Thu, 6 Apr 2017 22:43:19 +0800	[thread overview]
Message-ID: <57af142d-92d0-5d0f-1ddb-f27f122ae752@linux.intel.com> (raw)
In-Reply-To: <20170406092532.4zpuvqawrxjvadm6@hirez.programming.kicks-ass.net>



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

  reply	other threads:[~2017-04-06 14:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 15:18 [PATCH v1 0/5] perf report: Show branch type Jin Yao
2017-03-31 15:18 ` [PATCH v1 1/5] perf/core: Define the common branch type classification Jin Yao
2017-04-04 14:18   ` Arnaldo Carvalho de Melo
2017-04-04 15:52     ` Jin, Yao
2017-04-04 16:09       ` Arnaldo Carvalho de Melo
2017-04-06  0:09         ` Jin, Yao
2017-04-06  6:58     ` Peter Zijlstra
2017-04-06  8:21       ` Jin, Yao
2017-04-06  9:25         ` Peter Zijlstra
2017-04-06 14:43           ` Jin, Yao [this message]
2017-04-06 16:56             ` Peter Zijlstra
2017-04-07  2:14               ` Jin, Yao
2017-03-31 15:18 ` [PATCH v1 2/5] perf/x86/intel: Record branch type Jin Yao
2017-03-31 15:18 ` [PATCH v1 3/5] perf record: Create a new option save_type in --branch-filter Jin Yao
2017-03-31 15:18 ` [PATCH v1 4/5] perf report: Show branch type statistics for stdio mode Jin Yao
2017-03-31 15:18 ` [PATCH v1 5/5] perf report: Show branch type in callchain entry Jin Yao

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=57af142d-92d0-5d0f-1ddb-f27f122ae752@linux.intel.com \
    --to=yao.jin@linux.intel.com \
    --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=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.