1
0
Fork 0
Commit Graph

110 Commits (redonkable)

Author SHA1 Message Date
Jiri Olsa 600a8cf45b perf c2c report: Add header macros
Adding helping macros to define header objects.  It will be used in
following patches, that add new dimensions.

The c2c report will support 2 line headers, hence we only define
line[0/1] in macros.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1474558645-19956-20-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-10-19 13:18:31 -03:00
Jiri Olsa b2252ae67b perf c2c report: Decode c2c_stats for hist entries
Decoding and storing c2c_stats for each hist entry.  Changing related
function to work with c2c_* objects.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1474558645-19956-19-git-send-email-jolsa@kernel.org
[ Add '.nr_entries = 0' to the c2c_stats initialization to fix the build on older distros ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-10-19 13:18:31 -03:00
Jiri Olsa ec06f9b9b2 perf c2c report: Add cacheline hists processing
Store cacheline related entries in nested hist object for each cacheline
data. Nested entries are sorted by 'offset' within related cacheline.

We will allow specific sort keys to be configured for nested cacheline
data entries in following patches.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1474558645-19956-18-git-send-email-jolsa@kernel.org
[ he__get_hists() should return NULL when c2c_hists__init() fails ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-10-19 13:18:31 -03:00
Jiri Olsa 78b2754378 perf c2c report: Add sample processing
Adding basic sample processing specific hist_entry allocation callbacks
(via hists__add_entry_ops).

Overloading 'struct hist_entry' object with new 'struct c2c_hist_entry'.
The new hist entry object will carry specific stats and nested hists
objects.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1474558645-19956-17-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-10-19 13:18:31 -03:00
Jiri Olsa 5f2eca833c perf c2c report: Fallback to standard dimensions
Fallback to standard dimensions in case we don't find the dimension
within c2c ones.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1474558645-19956-16-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-10-19 13:18:31 -03:00
Jiri Olsa 8d3f938dc7 perf c2c report: Add sort_entry dimension support
Allow to reuse 'struct sort_entry' objects within c2c dimension support.

In case the 'struct sort_entry' object meets the need of c2c report we
will use it directly in following patches.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1474558645-19956-15-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-10-19 13:18:31 -03:00
Jiri Olsa c75540e316 perf c2c report: Add dimension support
Adding bare bones of dimension support for c2c report.

Main interface functions are:

  c2c_hists__init
  c2c_hists__reinit

which re/initialize 'struct c2c_hists' object with sort/display entries
string, in a similar way that setup_sorting function does.

We overload the dimension to provide multi line header support for
sort/display entries.

Also we overload base 'struct perf_hpp_fmt' object with 'struct c2c_fmt'
to define c2c specific functions to deal with multi line headers and
spans.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1474558645-19956-14-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-10-19 13:18:31 -03:00
Jiri Olsa 903a6f15b9 perf c2c: Add report subcommand
Adding c2c report subcommand. It reads the perf.data and displays shared
data analysis.

This patch adds report basic wirings. It gets fully implemented in
following patches.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1474558645-19956-13-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-10-19 13:18:31 -03:00
Jiri Olsa 39bcd4a4e4 perf c2c: Add record subcommand
Adding c2c record subcommand. It setups options related to HITM
cacheline analysis and calls standard perf record command.

  $ sudo perf c2c record -v -- -a
  calling: record -W -d --sample-cpu -e cpu/mem-loads,ldlat=30/P -e cpu/mem-stores/P -a
  ...

It produces perf.data, which is to be reported by perf c2c report, that
comes in following patches.

Details are described in the man page, which is added in one of the
following patches.

Committer notes:

Testing it:

  # perf c2c record -a sleep 1
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 5.050 MB perf.data (412 samples) ]
  # ls -la perf.data
  -rw-------. 1 root root 5301752 Oct  4 13:32 perf.data
  # perf evlist
  cpu/mem-loads,ldlat=30/P
  cpu/mem-stores/P
  # perf evlist -v
  cpu/mem-loads,ldlat=30/P: type: 4, size: 112, config: 0x1cd, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|ADDR|ID|CPU|PERIOD|DATA_SRC|WEIGHT, read_format: ID, disabled: 1, inherit: 1, mmap: 1, comm: 1, freq: 1, task: 1, precise_ip: 3, mmap_data: 1, sample_id_all: 1, mmap2: 1, comm_exec: 1, { bp_addr, config1 }: 0x1f
  cpu/mem-stores/P: type: 4, size: 112, config: 0x82d0, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|ADDR|ID|CPU|PERIOD|DATA_SRC|WEIGHT, read_format: ID, disabled: 1, inherit: 1, freq: 1, precise_ip: 3, sample_id_all: 1
  #
  # perf report --stdio
  <SNIP>
  # Total Lost Samples: 14
  # Samples: 216  of event 'cpu/mem-loads,ldlat=30/P'
  # Event count (approx.): 15207
  # Overhead  Symbol                                 Shared Object
  # ........  .....................................  ............................
      10.32%  [k] update_blocked_averages            [kernel.vmlinux]
       3.43%  [.] 0x00000000001a2122                 qemu-system-x86_64 (deleted)
       2.52%  [k] enqueue_entity                     [kernel.vmlinux]
       1.88%  [.] g_main_context_query               libglib-2.0.so.0.4800.2
       1.86%  [k] __schedule                         [kernel.vmlinux]
  <SNIP>
  # Samples: 196  of event 'cpu/mem-stores/P'
  # Event count (approx.): 14771346
  # Overhead  Symbol                               Shared Object
  # ........  ...................................  ............................
      13.91%  [k] intel_idle                       [kernel.vmlinux]
       3.02%  [.] 0x00000000022f06ea               chrome
       2.94%  [.] 0x00000000001a1b4c               qemu-system-x86_64 (deleted)
       2.94%  [.] 0x000000000019d8e4               qemu-system-x86_64 (deleted)
       2.38%  [.] 0x00000000001a1c52               qemu-system-x86_64 (deleted)
  <SNIP>

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1474558645-19956-12-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-10-19 13:18:31 -03:00
Jiri Olsa 7aef3bf3da perf c2c: Add c2c command
Adding c2c command base wirings. Its implementation is going to be added
gradually in following patches.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1474558645-19956-11-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-10-19 13:18:31 -03:00