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


Groups > linux.kernel > #1684824 > unrolled thread

[PATCH v7 0/7] perf report: Show branch type

Started byJin Yao <yao.jin@linux.intel.com>
First post2017-07-11 09:10 +0200
Last post2017-07-11 09:10 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH v7 0/7] perf report: Show branch type Jin Yao <yao.jin@linux.intel.com> - 2017-07-11 09:10 +0200
    [PATCH v7 3/7] perf record: Create a new option save_type in --branch-filter Jin Yao <yao.jin@linux.intel.com> - 2017-07-11 09:10 +0200

#1684824 — [PATCH v7 0/7] perf report: Show branch type

FromJin Yao <yao.jin@linux.intel.com>
Date2017-07-11 09:10 +0200
Subject[PATCH v7 0/7] perf report: Show branch type
Message-ID<u1XsZ-7CX-3@gated-at.bofh.it>
v7:
---
   Redefine the common branch types according to review comments from
   Michael Ellerman <mpe@ellerman.id.au>

   Now the patch series just defines a minimum but more common set of
   branch types.

   PERF_BR_NONE            : 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
 

v6:
---
   Update according to the review comments from
   Jiri Olsa <jolsa@redhat.com>. Major modifications are:

   1. Move that multiline conditional code inside {} brackets.

   2. Move branch_type_stat_display() from builtin-report.c to
      branch.c. Move branch_type_str() from callchain.c to
      branch.c.

   3. Keep the original branch info display order, that is:
      predicted, abort, cycles, iterations

v5:
---
   Mainly the v5 patch series are updated according to
   comments from Jiri Olsa <jolsa@redhat.com>.

   The kernel part doesn't have functional change. It just
   solve the merge issue.

   In userspace, the functions of branch type counting and
   branch type name resolving are moved to the new files:
   util/branch.c, util/branch.h.

   And refactor the branch info printing code for better
   maintenance.

Not changed (or just fix merge issue):
  perf/core: Define the common branch type classification
  perf/x86/intel: Record branch type
  perf record: Create a new option save_type in --branch-filter

New patches:
  perf report: Refactor the branch info printing code
  perf util: Create branch.c/.h for common branch functions

Changed:
  perf report: Show branch type statistics for stdio mode
  perf report: Show branch type in callchain entry

v4:
---
1. Describe the major changes in patch description.
   Thanks for Peter Zijlstra's reminding.

2. Initialize branch type to 0 in intel_pmu_lbr_read_32 and
   intel_pmu_lbr_read_64. Remove the invalid else code in
   intel_pmu_lbr_filter.

v3:
---
1. Move the JCC forward/backward and cross page computing from
   kernel to userspace.

2. Use lookup table to replace original switch/case processing.

Changed:
  perf/core: Define the common branch type classification
  perf/x86/intel: Record branch type
  perf report: Show branch type statistics for stdio mode
  perf report: Show branch type in callchain entry

Not changed:
  perf record: Create a new option save_type in --branch-filter

v2:
---
1. Use 4 bits in perf_branch_entry to record branch type.

2. Pull out some common branch types from FAR_BRANCH. Now the branch
   types defined in perf_event.h:

Jin Yao (7):
  perf/core: Define the common branch type classification
  perf/x86/intel: Record branch type
  perf record: Create a new option save_type in --branch-filter
  perf report: Refactor the branch info printing code
  perf util: Create branch.c/.h for common branch functions
  perf report: Show branch type statistics for stdio mode
  perf report: Show branch type in callchain entry

 arch/x86/events/intel/lbr.c              |  53 +++++++++-
 include/uapi/linux/perf_event.h          |  27 ++++-
 tools/include/uapi/linux/perf_event.h    |  27 ++++-
 tools/perf/Documentation/perf-record.txt |   1 +
 tools/perf/builtin-report.c              |  25 +++++
 tools/perf/util/Build                    |   1 +
 tools/perf/util/branch.c                 | 166 +++++++++++++++++++++++++++++++
 tools/perf/util/branch.h                 |  25 +++++
 tools/perf/util/callchain.c              | 140 ++++++++++++++------------
 tools/perf/util/callchain.h              |   5 +-
 tools/perf/util/event.h                  |   3 +-
 tools/perf/util/hist.c                   |   5 +-
 tools/perf/util/machine.c                |  26 +++--
 tools/perf/util/parse-branch-options.c   |   1 +
 14 files changed, 421 insertions(+), 84 deletions(-)
 create mode 100644 tools/perf/util/branch.c
 create mode 100644 tools/perf/util/branch.h

-- 
2.7.4

[toc] | [next] | [standalone]


#1684825 — [PATCH v7 3/7] perf record: Create a new option save_type in --branch-filter

FromJin Yao <yao.jin@linux.intel.com>
Date2017-07-11 09:10 +0200
Subject[PATCH v7 3/7] perf record: Create a new option save_type in --branch-filter
Message-ID<u1Xt0-7CX-25@gated-at.bofh.it>
In reply to#1684824
The option indicates the kernel to save branch type during sampling.

One example:
perf record -g --branch-filter any,save_type <command>

Change log
----------
v7: Not changed.

v6: Not changed.

v5: Not changed.

Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
---
 tools/perf/Documentation/perf-record.txt | 1 +
 tools/perf/util/parse-branch-options.c   | 1 +
 2 files changed, 2 insertions(+)

diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt
index b0e9e92..9bdea04 100644
--- a/tools/perf/Documentation/perf-record.txt
+++ b/tools/perf/Documentation/perf-record.txt
@@ -332,6 +332,7 @@ following filters are defined:
 	- no_tx: only when the target is not in a hardware transaction
 	- abort_tx: only when the target is a hardware transaction abort
 	- cond: conditional branches
+	- save_type: save branch type during sampling in case binary is not available later
 
 +
 The option requires at least one branch type among any, any_call, any_ret, ind_call, cond.
diff --git a/tools/perf/util/parse-branch-options.c b/tools/perf/util/parse-branch-options.c
index 38fd115..e71fb5f 100644
--- a/tools/perf/util/parse-branch-options.c
+++ b/tools/perf/util/parse-branch-options.c
@@ -28,6 +28,7 @@ static const struct branch_mode branch_modes[] = {
 	BRANCH_OPT("cond", PERF_SAMPLE_BRANCH_COND),
 	BRANCH_OPT("ind_jmp", PERF_SAMPLE_BRANCH_IND_JUMP),
 	BRANCH_OPT("call", PERF_SAMPLE_BRANCH_CALL),
+	BRANCH_OPT("save_type", PERF_SAMPLE_BRANCH_TYPE_SAVE),
 	BRANCH_END
 };
 
-- 
2.7.4

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web