public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/9] perf diff: diff cycles at basic block level
@ 2019-05-20 13:27 Jin Yao
  2019-05-20 13:27 ` [PATCH v1 1/9] perf util: Create block_info structure Jin Yao
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Jin Yao @ 2019-05-20 13:27 UTC (permalink / raw)
  To: acme, jolsa, peterz, mingo, alexander.shishkin
  Cc: Linux-kernel, ak, kan.liang, yao.jin, Jin Yao

In some cases small changes in hot loops can show big differences.
But it's difficult to identify these differences.

perf diff currently can only diff symbols (functions). We can also expand
it to diff cycles of individual programs blocks as reported by timed LBR.
This would allow to identify changes in specific code accurately.

With this patch set, for example,

    perf record -b ./div
    perf record -b ./div
    perf diff --basic-block

     # Cycles diff  Basic block (start:end)
     # ...........  .......................
     #
              -20   native_write_msr (7fff9a069900:7fff9a06990b)
               -3   __indirect_thunk_start (7fff9ac02ca0:7fff9ac02ca0)
                1   __indirect_thunk_start (7fff9ac02cac:7fff9ac02cb0)
                0   rand@plt (490:490)
                0   rand (3af60:3af64)
                0   rand (3af69:3af6d)
                0   main (4e8:4ea)
                0   main (4ef:500)
                0   main (4ef:535)
                0   compute_flag (640:644)
                0   compute_flag (649:659)
                0   __random_r (3ac40:3ac76)
                0   __random_r (3ac40:3ac88)
                0   __random_r (3ac90:3ac9c)
                0   __random (3aac0:3aad2)
                0   __random (3aae0:3aae7)
                0   __random (3ab03:3ab0f)
                0   __random (3ab14:3ab1b)
                0   __random (3ab28:3ab2e)
                0   __random (3ab4a:3ab53)

The "basic-block" is a new perf-diff option, which enables the displaying
of cycles difference of same program basic block amongst two or more
perf.data. The program basic block is the code block between two branches
in a function.

Jin Yao (9):
  perf util: Create block_info structure
  perf util: Add block_info in hist_entry
  perf diff: Check if all data files with branch stacks
  perf diff: Get a list of symbols(functions)
  perf diff: Use hists to manage basic blocks
  perf diff: Link same basic blocks among different data files
  perf diff: Compute cycles diff of basic blocks
  perf diff: Print the basic block cycles diff
  perf diff: Documentation --basic-block option

 tools/perf/Documentation/perf-diff.txt |   5 +
 tools/perf/builtin-diff.c              | 521 ++++++++++++++++++++++++++++++++-
 tools/perf/util/hist.c                 |  24 +-
 tools/perf/util/hist.h                 |   6 +
 tools/perf/util/sort.h                 |   4 +
 tools/perf/util/symbol.c               |  22 ++
 tools/perf/util/symbol.h               |  23 ++
 7 files changed, 594 insertions(+), 11 deletions(-)

-- 
2.7.4


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

end of thread, other threads:[~2019-05-24  0:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-20 13:27 [PATCH v1 0/9] perf diff: diff cycles at basic block level Jin Yao
2019-05-20 13:27 ` [PATCH v1 1/9] perf util: Create block_info structure Jin Yao
2019-05-20 13:27 ` [PATCH v1 2/9] perf util: Add block_info in hist_entry Jin Yao
2019-05-20 13:27 ` [PATCH v1 3/9] perf diff: Check if all data files with branch stacks Jin Yao
2019-05-20 13:27 ` [PATCH v1 4/9] perf diff: Get a list of symbols(functions) Jin Yao
2019-05-20 13:27 ` [PATCH v1 5/9] perf diff: Use hists to manage basic blocks Jin Yao
2019-05-20 13:27 ` [PATCH v1 6/9] perf diff: Link same basic blocks among different data files Jin Yao
2019-05-20 13:27 ` [PATCH v1 7/9] perf diff: Compute cycles diff of basic blocks Jin Yao
2019-05-20 13:27 ` [PATCH v1 8/9] perf diff: Print the basic block cycles diff Jin Yao
2019-05-22 14:04   ` Jiri Olsa
2019-05-24  0:39     ` Jin, Yao
2019-05-20 13:27 ` [PATCH v1 9/9] perf diff: Documentation --basic-block option Jin Yao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox