linux-stable/include
Jin Yao eb0baf8a0d perf/core: Define the common branch type classification
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.

Change log:

v10: Not changed.

v9: Not changed.

v8: Change PERF_BR_NONE to PERF_BR_UNKNOWN.
    No other change.

v7: Just keep the most common branch types.
    Others are removed.

v6: Not changed.

v5: Not changed. The v5 patch series just change the userspace.

v4: Comparing to previous version, the major changes are:

1. Remove the PERF_BR_JCC_FWD/PERF_BR_JCC_BWD, they will be
   computed later in userspace.

2. Remove the "cross" field in perf_branch_entry. The cross page
   computing will be done later in userspace.

Signed-off-by: Yao Jin <yao.jin@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Kan Liang <kan.liang@intel.com>
Link: http://lkml.kernel.org/r/1500379995-6449-2-git-send-email-yao.jin@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2017-07-18 23:14:38 -03:00
..
acpi UUID/GUID updates: 2017-07-03 09:55:26 -07:00
asm-generic clocksource/drivers: Rename CLKSRC_OF to TIMER_OF 2017-06-14 12:01:03 +02:00
clocksource
crypto
drm drm/dp: start a DPCD based DP sink/branch device quirk database 2017-05-29 13:43:26 +03:00
dt-bindings Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-07-03 16:50:31 -07:00
keys
kvm KVM: arm/arm64: Fix bug when registering redist iodevs 2017-05-18 11:18:12 +02:00
linux kprobes: Rename [arch_]function_offset_within_entry() to [arch_]kprobe_on_func_entry() 2017-07-08 11:05:34 +02:00
math-emu
media [media] media/cec.h: use IS_REACHABLE instead of IS_ENABLED 2017-06-08 16:52:28 -03:00
memory
misc
net Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-07-03 13:08:04 -07:00
pcmcia
ras
rdma RDMA/SA: Fix kernel panic in CMA request handler flow 2017-06-01 17:20:14 -04:00
rxrpc
scsi block: Change argument type of scsi_req_init() 2017-06-20 19:27:14 -06:00
soc
sound
target iscsi-target: Fix initial login PDU asynchronous socket close OOPs 2017-05-31 15:12:31 -07:00
trace rcu: Prevent rcu_barrier() from starting needless grace periods 2017-06-08 08:25:22 -07:00
uapi perf/core: Define the common branch type classification 2017-07-18 23:14:38 -03:00
video
xen