All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] perf report: Implement visual marker for macro fusion in annotate
@ 2017-06-20 12:22 Jin Yao
  2017-06-20 12:22 ` [PATCH v3 1/2] perf util: Check for fused instruction Jin Yao
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jin Yao @ 2017-06-20 12:22 UTC (permalink / raw)
  To: acme, jolsa, peterz, mingo, alexander.shishkin
  Cc: Linux-kernel, ak, kan.liang, yao.jin, Jin Yao

Macro fusion merges two instructions to a single micro-op. Intel
core platform performs this hardware optimization under limited
circumstances. For example, CMP + JCC can be "fused" and executed
/retired together. While with sampling this can result in the
sample sometimes being on the JCC and sometimes on the CMP.
So for the fused instruction pair, they could be considered
together.

On Nehalem, fused instruction pairs:
cmp/test + jcc.

On other new CPU:
cmp/test/add/sub/and/inc/dec + jcc.

This patch series marks the case clearly by joining the fused
instruction pair in the arrow of the jump.

For example:

       │   ┌──cmpl   $0x0,argp_program_version_hook
 81.93 │   ├──je     20
       │   │  lock   cmpxchg %esi,0x38a9a4(%rip)
       │   │↓ jne    29
       │   │↓ jmp    43
 11.47 │20:└─→cmpxch %esi,0x38a999(%rip)

Change-log:
-----------
v3: 1.  Add checking for Nehalem (CMP, TEST). For other newer
        Intel CPUs just check it by default (CMP, TEST, ADD,
        SUB, AND, INC, DEC).

    2.  Use Arnaldo's fix to let the display be better

v2: According to Arnaldo's comments, remove the weak function and
    use an arch-specific function instead to check fused instruction
    pair.

v1: Inital post

Jin Yao (2):
  perf util: Check for fused instruction
  perf report: Implement visual marker for macro fusion in annotate

 tools/perf/arch/x86/annotate/instructions.c | 37 +++++++++++++++++++++++++++++
 tools/perf/ui/browser.c                     | 29 ++++++++++++++++++++++
 tools/perf/ui/browser.h                     |  2 ++
 tools/perf/ui/browsers/annotate.c           | 32 +++++++++++++++++++++++++
 tools/perf/util/annotate.c                  | 17 +++++++++++++
 tools/perf/util/annotate.h                  |  3 +++
 6 files changed, 120 insertions(+)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-07-07  1:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-20 12:22 [PATCH v3 0/2] perf report: Implement visual marker for macro fusion in annotate Jin Yao
2017-06-20 12:22 ` [PATCH v3 1/2] perf util: Check for fused instruction Jin Yao
2017-07-06 16:24   ` Arnaldo Carvalho de Melo
2017-07-07  1:09     ` Jin, Yao
2017-06-20 12:22 ` [PATCH v3 2/2] perf report: Implement visual marker for macro fusion in annotate Jin Yao
2017-07-06  0:42 ` [PATCH v3 0/2] " Jin, Yao

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.