• Jiri Olsa's avatar
    perf c2c: Add record subcommand · 39bcd4a4
    Jiri Olsa authored
    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: default avatarJiri Olsa <jolsa@kernel.org>
    Tested-by: default avatarArnaldo 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.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    39bcd4a4
builtin-c2c.c 3.14 KB