Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1686480

Re: [PATCH v8 1/7] perf/core: Define the common branch type classification

From Michael Ellerman <mpe@ellerman.id.au>
Newsgroups linux.kernel
Subject Re: [PATCH v8 1/7] perf/core: Define the common branch type classification
Date 2017-07-13 14:10 +0200
Message-ID <u2L6p-5tf-5@gated-at.bofh.it> (permalink)
References <u2DBT-G9-1@gated-at.bofh.it> <u2DBT-G9-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Jin Yao <yao.jin@linux.intel.com> writes:

> It is often useful to know the branch types while analyzing branch
> data. For example, a call is very different from a conditional branch.
>
> Currently we have to look it up in binary while the binary may later
> not be available and even the binary is available but user has to take
> some time. It is very useful for user to check it directly in perf
> report.
>
> Perf already has support for disassembling the branch instruction
> to get the x86 branch type.
>
> To keep consistent on kernel and userspace and make the classification
> more common, the patch adds the common branch type classification
> in perf_event.h.
>
> The patch only defines a minimum but most common set of branch types.
>
> PERF_BR_UNKNOWN         : unknown
> PERF_BR_COND            :conditional
> PERF_BR_UNCOND          : unconditional
> PERF_BR_IND             : indirect
> PERF_BR_CALL            : function call
> PERF_BR_IND_CALL        : indirect function call
> PERF_BR_RET             : function return
> PERF_BR_SYSCALL         : syscall
> PERF_BR_SYSRET          : syscall return
> PERF_BR_COND_CALL       : conditional function call
> PERF_BR_COND_RET        : conditional function return
>
> The patch also adds a new field type (4 bits) in perf_branch_entry
> to record the branch type.
>
> Since the disassembling of branch instruction needs some overhead,
> a new PERF_SAMPLE_BRANCH_TYPE_SAVE is introduced to indicate if it
> needs to disassemble the branch instruction and record the branch
> type.

Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)

If you like.

cheers

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v8 0/7] perf report: Show branch type Jin Yao <yao.jin@linux.intel.com> - 2017-07-13 06:10 +0200
  [PATCH v8 5/7] perf util: Create branch.c/.h for common branch functions Jin Yao <yao.jin@linux.intel.com> - 2017-07-13 06:10 +0200
  [PATCH v8 3/7] perf record: Create a new option save_type in --branch-filter Jin Yao <yao.jin@linux.intel.com> - 2017-07-13 06:10 +0200
  [PATCH v8 6/7] perf report: Show branch type statistics for stdio mode Jin Yao <yao.jin@linux.intel.com> - 2017-07-13 06:10 +0200
  [PATCH v8 2/7] perf/x86/intel: Record branch type Jin Yao <yao.jin@linux.intel.com> - 2017-07-13 06:10 +0200
    Re: [PATCH v8 2/7] perf/x86/intel: Record branch type Peter Zijlstra <peterz@infradead.org> - 2017-07-13 16:40 +0200
      Re: [PATCH v8 2/7] perf/x86/intel: Record branch type "Jin, Yao" <yao.jin@linux.intel.com> - 2017-07-13 17:00 +0200
      Re: [PATCH v8 2/7] perf/x86/intel: Record branch type "Jin, Yao" <yao.jin@linux.intel.com> - 2017-07-13 17:10 +0200
        Re: [PATCH v8 2/7] perf/x86/intel: Record branch type "Jin, Yao" <yao.jin@linux.intel.com> - 2017-07-13 17:20 +0200
  [PATCH v8 7/7] perf report: Show branch type in callchain entry Jin Yao <yao.jin@linux.intel.com> - 2017-07-13 06:10 +0200
  [PATCH v8 1/7] perf/core: Define the common branch type classification Jin Yao <yao.jin@linux.intel.com> - 2017-07-13 06:10 +0200
    Re: [PATCH v8 1/7] perf/core: Define the common branch type classification Michael Ellerman <mpe@ellerman.id.au> - 2017-07-13 14:10 +0200
      Re: [PATCH v8 1/7] perf/core: Define the common branch type  classification "Jin, Yao" <yao.jin@linux.intel.com> - 2017-07-13 14:40 +0200
  [PATCH v8 4/7] perf report: Refactor the branch info printing code Jin Yao <yao.jin@linux.intel.com> - 2017-07-13 06:10 +0200

csiph-web