1. 08 Mar, 2018 35 commits
  2. 07 Mar, 2018 5 commits
    • Takashi Iwai's avatar
      perf tools: Correct title markers for asciidoctor · ea66536a
      Takashi Iwai authored
      I've tested to process the perf man pages with asciidoctor that is
      picker than asciidoc, and it revealed minor syntax errors in some
      documents.  Namely, the title markers aren't aligned with the previous
      line, hence asciidoctor didn't recognize as titles.
      
      This patch corrects these markers to be processed properly.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180307105441.28512-1-tiwai@suse.deSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ea66536a
    • Adrian Hunter's avatar
      perf auxtrace: Make auxtrace_queues__add_buffer() return buffer_ptr · 4c454843
      Adrian Hunter authored
      In preparation for supporting AUX area sampling buffers,
      auxtrace_queues__add_buffer() needs to be more generic. To that end, make
      it return buffer_ptr instead of the caller.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/1520327598-1317-6-git-send-email-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4c454843
    • Adrian Hunter's avatar
      perf auxtrace: Rename some buffer-queuing functions · a356a597
      Adrian Hunter authored
      Rename some buffer-queuing functions in preparation for supporting AUX area
      sampling buffers.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/1520327598-1317-5-git-send-email-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a356a597
    • Adrian Hunter's avatar
      perf auxtrace: Add missing parameters from kernel-doc comments · b818ec61
      Adrian Hunter authored
      Add missing parameters from kernel-doc comments.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/1520327598-1317-4-git-send-email-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b818ec61
    • Arnaldo Carvalho de Melo's avatar
      perf trace: Support setting cgroups as targets · 9ea42ba4
      Arnaldo Carvalho de Melo authored
      One can set a cgroup as a default cgroup to be used by all events or
      set cgroups with the 'perf stat' and 'perf record' behaviour, i.e.
      '-G A' will be the cgroup for events defined so far in the command line.
      
      Here in my main machine, with a kvm instance running a rhel6 guinea pig
      I have:
      
        # ls -la /sys/fs/cgroup/perf_event/ | grep drw
        drwxr-xr-x. 14 root root 360 Mar  6 12:04 ..
        drwxr-xr-x.  3 root root   0 Mar  6 15:05 machine.slice
        #
      
      So I can go ahead and use that cgroup hierarchy, say lets see what
      syscalls are being emitted by threads in that 'machine.slice' hierarchy
      that are taking more than 100ms:
      
        # perf trace --duration 100 -G machine.slice
           0.188 (249.850 ms): CPU 0/KVM/23744 ioctl(fd: 16<anon_inode:kvm-vcpu:0>, cmd: KVM_RUN) = 0
         250.274 (249.743 ms): CPU 0/KVM/23744 ioctl(fd: 16<anon_inode:kvm-vcpu:0>, cmd: KVM_RUN) = 0
         500.224 (249.755 ms): CPU 0/KVM/23744 ioctl(fd: 16<anon_inode:kvm-vcpu:0>, cmd: KVM_RUN) = 0
         750.097 (249.934 ms): CPU 0/KVM/23744 ioctl(fd: 16<anon_inode:kvm-vcpu:0>, cmd: KVM_RUN) = 0
        1000.244 (249.780 ms): CPU 0/KVM/23744 ioctl(fd: 16<anon_inode:kvm-vcpu:0>, cmd: KVM_RUN) = 0
        1250.197 (249.796 ms): CPU 0/KVM/23744 ioctl(fd: 16<anon_inode:kvm-vcpu:0>, cmd: KVM_RUN) = 0
        1500.124 (249.859 ms): CPU 0/KVM/23744 ioctl(fd: 16<anon_inode:kvm-vcpu:0>, cmd: KVM_RUN) = 0
        1750.076 (172.900 ms): CPU 0/KVM/23744 ioctl(fd: 16<anon_inode:kvm-vcpu:0>, cmd: KVM_RUN) = 0
         902.570 (1021.116 ms): qemu-system-x8/23667 ppoll(ufds: 0x558151e03180, nfds: 74, tsp: 0x7ffc00cd0900, sigsetsize: 8) = 1
        1923.825 (305.133 ms): qemu-system-x8/23667 ppoll(ufds: 0x558151e03180, nfds: 74, tsp: 0x7ffc00cd0900, sigsetsize: 8) = 1
        2000.172 (229.002 ms): CPU 0/KVM/23744 ioctl(fd: 16<anon_inode:kvm-vcpu:0>, cmd: KVM_RUN) = 0
      ^C  #
      
      If we look inside that cgroup hierarchy we get:
      
        # ls -la /sys/fs/cgroup/perf_event/machine.slice/ | grep drw
        drwxr-xr-x. 3 root root 0 Mar  6 15:05 .
        drwxr-xr-x. 2 root root 0 Mar  6 16:16 machine-qemu\x2d2\x2drhel6.sandy.scope
        #
      
      There is just one, but lets say there were more and we would want to see
      5 seconds worth of syscall summary for the threads in that cgroup:
      
        # perf trace --summary -G machine.slice/machine-qemu\\x2d2\\x2drhel6.sandy.scope/ -a sleep 5
      
         Summary of events:
      
           qemu-system-x86 (23667), 143858 events, 24.2%
      
           syscall            calls    total       min       avg       max      stddev
                                       (msec)    (msec)    (msec)    (msec)        (%)
           --------------- -------- --------- --------- --------- ---------     ------
           ppoll              28492  4348.631     0.000     0.153    11.616      1.05%
           futex              19661   140.801     0.001     0.007     2.993      3.20%
           read               18440    68.084     0.001     0.004     1.653      4.33%
           ioctl               5387    24.768     0.002     0.005     0.134      1.62%
      
           CPU 0/KVM (23744), 449455 events, 75.8%
      
           syscall            calls    total       min       avg       max      stddev
                                     (msec)    (msec)    (msec)    (msec)        (%)
           --------------- -------- --------- --------- --------- ---------     ------
           ioctl             148364  3401.812     0.000     0.023    11.801      1.15%
           futex              36131   404.127     0.001     0.011     7.377      2.63%
           writev             29452   339.688     0.003     0.012     1.740      1.36%
           write              11315    45.992     0.001     0.004     0.105      1.10%
      
        #
      
      See the documentation about how to set more than one cgroup for
      different events in the same command line.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-t126jh4occqvu0xdqlcjygex@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9ea42ba4