1. 08 Mar, 2018 32 commits
  2. 07 Mar, 2018 8 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
    • Arnaldo Carvalho de Melo's avatar
      perf cgroup: Make the cgroup name be const char * · 3b569286
      Arnaldo Carvalho de Melo authored
      The usual thing is for a constructor to allocate space for its members,
      not to require that the caller pass a pre-allocated 'name' and then, at
      its destructor, to free something not allocated by it.
      
      Fix it by making cgroup__new() to receive a const char pointer, then
      allocate cgroup->name that then can continue to be freed at
      cgroup__delete(), balancing the alloc/free operations inside the cgroup
      struct methods.
      
      This eases calling evlist__findnew_cgroup() from the custom 'perf trace'
      cgroup parser, that will only call parse_cgroups() when the '-G cgroup'
      is passed on the command line after '-e event' entries, when it'll
      behave just like 'perf stat' and 'perf record', i.e. the previous
      parse_cgroup() users that mandate that -G only can come after a -e.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-4leugnuyqi10t98990o3xi1t@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3b569286
    • Arnaldo Carvalho de Melo's avatar
      perf cgroup: Add evlist__add_default_cgroup() · 483322dd
      Arnaldo Carvalho de Melo authored
      So that tools like 'perf trace' can allow the user to set a cgroup
      to be used for all the evsels still without a crgroup setup by
      parse_cgroups(), such as the one to use for the syscalls, vfs_getname
      and other events involved in strace like syscall tracing.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-zf9jjsbj661r3lk6qb7g8j70@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      483322dd
    • Arnaldo Carvalho de Melo's avatar
      perf cgroup: Add evlist__findnew_cgroup() · 69239ec8
      Arnaldo Carvalho de Melo authored
      Similar to machine__findnew_thread(), etc, i.e. try to find, get a
      refcount if found and return it, otherwise return a new cgroup object.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-im1omevlihhyneiic4nl3g24@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      69239ec8