1. 02 8月, 2017 9 次提交
    • A
      perf trace beautify ioctl: Beautify perf ioctl's 'cmd' arg · 81e3d8b2
      Arnaldo Carvalho de Melo 提交于
      Also trying a new approach, using the copy of uapi/linux/perf_event.h we
      auto generate the string tables, then include it in the ioctl cmd
      beautifier.
      
      This way either the perf developers will add the new commands to the
      tools/ copy, like is happening with other areas of tools/include/ (bpf.h
      comes to mind), or we'll be notified when building perf that our copy
      drifted.
      
      E.g., looking at some of the perf ioctls issued by the 'perf test' test cases:
      
        # (perf trace -e perf_event_open,ioctl perf test)  2>&1 | egrep "(cmd: PERF_|perf_event_open)"
        4: Read samples using the mmap interface      :
         348.811 ( 0.062 ms): perf/23351 perf_event_open(attr_uptr: 0x414a5e8, pid: 23351 (perf), group_fd: -1, flags: FD_CLOEXEC) = 3
         348.878 ( 0.039 ms): perf/23351 perf_event_open(attr_uptr: 0x414a5e8, pid: 23351 (perf), cpu: 1, group_fd: -1, flags: FD_CLOEXEC) = 4
         348.919 ( 0.036 ms): perf/23351 perf_event_open(attr_uptr: 0x414a5e8, pid: 23351 (perf), cpu: 2, group_fd: -1, flags: FD_CLOEXEC) = 5
         348.958 ( 0.036 ms): perf/23351 perf_event_open(attr_uptr: 0x414a5e8, pid: 23351 (perf), cpu: 3, group_fd: -1, flags: FD_CLOEXEC) = 6
         349.070 ( 0.046 ms): perf/23351 perf_event_open(attr_uptr: 0x414aa38, pid: 23351 (perf), group_fd: -1, flags: FD_CLOEXEC) = 7
         349.120 ( 0.037 ms): perf/23351 perf_event_open(attr_uptr: 0x414aa38, pid: 23351 (perf), cpu: 1, group_fd: -1, flags: FD_CLOEXEC) = 8
         349.161 ( 0.036 ms): perf/23351 perf_event_open(attr_uptr: 0x414aa38, pid: 23351 (perf), cpu: 2, group_fd: -1, flags: FD_CLOEXEC) = 9
         349.201 ( 0.035 ms): perf/23351 perf_event_open(attr_uptr: 0x414aa38, pid: 23351 (perf), cpu: 3, group_fd: -1, flags: FD_CLOEXEC) = 10
         349.306 ( 0.041 ms): perf/23351 perf_event_open(attr_uptr: 0x414b2d8, pid: 23351 (perf), group_fd: -1, flags: FD_CLOEXEC) = 11
         349.611 ( 0.005 ms): perf/23351 ioctl(fd: 3<anon_inode:[perf_event]>, cmd: PERF_ID, arg: 0x7fff025999b8) = 0
         349.619 ( 0.002 ms): perf/23351 ioctl(fd: 7<anon_inode:[perf_event]>, cmd: PERF_SET_OUTPUT, arg: 0x3  ) = 0
         349.623 ( 0.002 ms): perf/23351 ioctl(fd: 7<anon_inode:[perf_event]>, cmd: PERF_ID, arg: 0x7fff025999b8) = 0
         349.627 ( 0.002 ms): perf/23351 ioctl(fd: 11<anon_inode:[perf_event]>, cmd: PERF_SET_OUTPUT, arg: 0x3 ) = 0
         349.630 ( 0.001 ms): perf/23351 ioctl(fd: 11<anon_inode:[perf_event]>, cmd: PERF_ID, arg: 0x7fff025999b8) = 0
      <SNIP>
        7: PERF_RECORD_* events & perf_sample fields  :
         647.150 ( 0.014 ms): perf/23354 perf_event_open(attr_uptr: 0x7fff02599920, pid: -1, cpu: 2, group_fd: -1, flags: FD_CLOEXEC) = 3
         647.197 ( 0.076 ms): perf/23354 perf_event_open(attr_uptr: 0x414b478, pid: -1, group_fd: -1, flags: FD_CLOEXEC) = 3
         647.289 ( 0.040 ms): perf/23354 perf_event_open(attr_uptr: 0x414b478, pid: -1, group_fd: -1, flags: FD_CLOEXEC) = 3
         647.368 ( 0.011 ms): perf/23354 perf_event_open(attr_uptr: 0x414a5e8, pid: 23355 (perf), group_fd: -1, flags: FD_CLOEXEC) = 3
         647.381 ( 0.005 ms): perf/23354 perf_event_open(attr_uptr: 0x414a5e8, pid: 23355 (perf), cpu: 1, group_fd: -1, flags: FD_CLOEXEC) = 4
         647.387 ( 0.005 ms): perf/23354 perf_event_open(attr_uptr: 0x414a5e8, pid: 23355 (perf), cpu: 2, group_fd: -1, flags: FD_CLOEXEC) = 5
         647.393 ( 0.004 ms): perf/23354 perf_event_open(attr_uptr: 0x414a5e8, pid: 23355 (perf), cpu: 3, group_fd: -1, flags: FD_CLOEXEC) = 7
         648.026 ( 0.011 ms): perf/23354 ioctl(fd: 3<anon_inode:[perf_event]>, cmd: PERF_ENABLE) = 0
         648.038 ( 0.002 ms): perf/23354 ioctl(fd: 4<anon_inode:[perf_event]>, cmd: PERF_ENABLE) = 0
         648.042 ( 0.002 ms): perf/23354 ioctl(fd: 5<anon_inode:[perf_event]>, cmd: PERF_ENABLE) = 0
         648.045 ( 0.002 ms): perf/23354 ioctl(fd: 7<anon_inode:[perf_event]>, cmd: PERF_ENABLE) = 0
      <SNIP>
        18: Breakpoint overflow signal handler         :
        2772.721 ( 0.017 ms): perf/23375 perf_event_open(attr_uptr: 0x7fff02599d20, pid: -1, cpu: 3, group_fd: -1, flags: FD_CLOEXEC) = 3
        2772.748 ( 0.009 ms): perf/23375 perf_event_open(attr_uptr: 0x7fff02599e60, cpu: -1, group_fd: -1, flags: FD_CLOEXEC) = 3
        2772.768 ( 0.002 ms): perf/23375 ioctl(fd: 3, cmd: PERF_RESET) = 0
        2772.776 ( 0.008 ms): perf/23375 perf_event_open(attr_uptr: 0x7fff02599e60, cpu: -1, group_fd: -1, flags: FD_CLOEXEC) = 4
        2772.788 ( 0.002 ms): perf/23375 ioctl(fd: 4, cmd: PERF_RESET) = 0
        2772.791 ( 0.006 ms): perf/23375 perf_event_open(attr_uptr: 0x7fff02599e60, cpu: -1, group_fd: -1, flags: FD_CLOEXEC) = 5
        2772.800 ( 0.001 ms): perf/23375 ioctl(fd: 5, cmd: PERF_RESET) = 0
        2772.803 ( 0.005 ms): perf/23375 ioctl(fd: 3, cmd: PERF_ENABLE) = 0
        2772.810 ( 0.004 ms): perf/23375 ioctl(fd: 4, cmd: PERF_ENABLE) = 0
        2772.815 ( 0.004 ms): perf/23375 ioctl(fd: 5, cmd: PERF_ENABLE) = 0
      <SNIP>
      
      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: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-ahotwscqt080ae0ulu3zznh2@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      81e3d8b2
    • A
      perf trace beautify ioctl: Beautify vhost virtio ioctl's 'cmd' arg · ec6dd85f
      Arnaldo Carvalho de Melo 提交于
      Also trying a new approach, using a copy of uapi/linux/vhost.h we auto
      generate the string tables, then include it in the ioctl cmd beautifier.
      
      This way either the KVM developers will add the new commands to the
      tools/ copy, like is happening with other areas of tools/include/ (bpf.h
      comes to mind), or we'll be notified when building perf that our copy
      drifted.
      
      E.g., doing syswide tracing grepping for the newly beautified VHOST
      ioctls:
      
        # perf trace -e ioctl 2>&1 | grep VHOST
        3873.064 ( 0.099 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: VHOST_NET_SET_BACKEND, arg: 0x7fff053dffe0) = 0
        3873.168 ( 0.019 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: VHOST_NET_SET_BACKEND, arg: 0x7fff053dffe0) = 0
        3873.226 ( 0.006 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: VHOST_GET_VRING_BASE, arg: 0x7fff053dff60) = 0
        3873.244 ( 0.002 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: VHOST_GET_VRING_BASE, arg: 0x7fff053dff60) = 0
        3873.817 ( 0.014 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: VHOST_SET_VRING_CALL, arg: 0x7fff053dff20) = 0
        3873.838 ( 0.004 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: VHOST_SET_VRING_CALL, arg: 0x7fff053dff20) = 0
        4701.372 ( 0.006 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: VHOST_SET_VRING_CALL, arg: 0x7fff053dfe20) = 0
        4701.417 ( 0.007 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: VHOST_SET_VRING_CALL, arg: 0x7fff053dfe20) = 0
        4701.563 ( 0.004 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: VHOST_SET_FEATURES, arg: 0x7fff053dfe88) = 0
        4701.571 ( 0.028 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: VHOST_SET_MEM_TABLE, arg: 0x563c7c906870) = 0
        4701.604 ( 0.003 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: VHOST_SET_VRING_NUM, arg: 0x7fff053dff00) = 0
        4701.609 ( 0.002 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: VHOST_SET_VRING_BASE, arg: 0x7fff053dff00) = 0
        4701.615 ( 0.002 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: VHOST_SET_VRING_ADDR, arg: 0x7fff053dfe70) = 0
        4701.619 ( 0.008 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: VHOST_SET_VRING_KICK, arg: 0x7fff053dfef0) = 0
        4701.634 ( 0.004 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: VHOST_SET_VRING_NUM, arg: 0x7fff053dff00) = 0
        4701.640 ( 0.002 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: VHOST_SET_VRING_BASE, arg: 0x7fff053dff00) = 0
        4701.644 ( 0.002 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: VHOST_SET_VRING_ADDR, arg: 0x7fff053dfe70) = 0
        4701.648 ( 0.009 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: VHOST_SET_VRING_KICK, arg: 0x7fff053dfef0) = 0
        4701.665 ( 0.005 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: VHOST_NET_SET_BACKEND, arg: 0x7fff053dff80) = 0
        4701.672 ( 0.004 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: VHOST_NET_SET_BACKEND, arg: 0x7fff053dff80) = 0
      ^C
      
       '-e ioctl' uses tracepoint filters, in time this will be replaces by
      eBPF filters hooked at the syscall tracepoints and that "grep VHOST"
      will also be done with eBPF, right at the kernel, to reduce overhead.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-2gthnhpliunvakywjterrzz3@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ec6dd85f
    • A
      tools include uapi: Grab a copy of linux/vhost.h · d02b395e
      Arnaldo Carvalho de Melo 提交于
      We will use it to generate tables for beautifying ioctl's 'cmd' arg.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-nxwpq34hu6te1m2ra5m7o8n9@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d02b395e
    • A
      perf trace beauty ioctl: Pass _IOC_DIR to the per _IOC_TYPE scnprintf · 8ff69577
      Arnaldo Carvalho de Melo 提交于
      Not all subsystems use the fact that we may have the same _IOC_NR for
      different _IOC_DIR, as in the end it'll result in a different ioctl
      number.
      
      So, for instance, vhost virtio has:
      
        #define VHOST_GET_FEATURES      _IOR(VHOST_VIRTIO, 0x00, __u64)
        #define VHOST_SET_FEATURES      _IOW(VHOST_VIRTIO, 0x00, __u64)
      
      So same _IOC_NR (0x00) but different _IOC_DIR (R versus W), but it also
      have:
      
        #define VHOST_SET_VRING_ENDIAN _IOW(VHOST_VIRTIO, 0x13, struct vhost_vring_state)
        #define VHOST_GET_VRING_ENDIAN _IOW(VHOST_VIRTIO, 0x14, struct vhost_vring_state)
      
      A "get" operation that uses a "W" _IOC_DIR, and its implementation, uses
      copy_to_user, it should've probably been _IOR().
      
      Then:
      
        /* Base value where queue looks for available descriptors */
        #define VHOST_SET_VRING_BASE _IOW(VHOST_VIRTIO, 0x12, struct vhost_vring_state)
        /* Get accessor: reads index, writes value in num */
        #define VHOST_GET_VRING_BASE _IOWR(VHOST_VIRTIO, 0x12, struct vhost_vring_state)
      
      So we'll need to use _IOC_DIR() to disambiguate the VHOST_VIRTIO ioctl
      bautifier.
      
      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: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-rq6q717ql7j2z7kuccafgq84@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8ff69577
    • A
      perf trace beautify ioctl: Beautify KVM ioctl's 'cmd' arg · 45717b7f
      Arnaldo Carvalho de Melo 提交于
      Also trying a new approach, using a copy of uapi/linux/kvm.h we auto
      generate the string tables, then include it in the ioctl cmd beautifier.
      
      This way either the KVM developers will add the new commands to the
      tools/ copy, like is happening with other areas of tools/include/ (bpf.h
      comes to mind), or we'll be notified when building perf that our copy
      drifted.
      
      E.g., a tracing a process and its threads, but would work for system wide as
      well, just drop that '-p 21238', to see ioctls for DRM, tty, sound, etc:
      
        # perf trace -e ioctl -p 21238 2>&1 | grep -v KVM_RUN
          7801.536 ( 0.003 ms): CPU 0/KVM/21276 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_IRQ_LINE_STATUS, arg: 0x7f484c6c73c0) = 0
        <SNIP lots of the last one>
          7801.715 ( 0.001 ms): CPU 0/KVM/21276 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_IRQ_LINE_STATUS, arg: 0x7f484c6c73e0) = 0
         11001.051 ( 0.008 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_SIGNAL_MSI, arg: 0x563c83379d70) = 1
         11001.225 ( 0.005 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_SIGNAL_MSI, arg: 0x563c83379d70) = 1
         10750.377 (249.963 ms): CPU 0/KVM/21276  ... [continued]: ioctl()) = 0
         11011.780 ( 0.015 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_SIGNAL_MSI, arg: 0x563c83379d90) = 1
         11011.929 ( 0.005 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_SIGNAL_MSI, arg: 0x7fff053e1000) = 1
         11012.090 ( 0.004 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_SIGNAL_MSI, arg: 0x563c83379d70) = 1
         11023.127 ( 0.020 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_SIGNAL_MSI, arg: 0x563c83379d90) = 1
         11000.483 (249.807 ms): CPU 0/KVM/21276  ... [continued]: ioctl()) = 0
         25620.877 ( 0.042 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_IRQ_LINE_STATUS, arg: 0x7fff053e1080) = 0
        <SNIP several of the last one>
         25621.025 ( 0.002 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_IRQ_LINE_STATUS, arg: 0x7fff053e10a0) = 0
         25500.803 (120.186 ms): CPU 0/KVM/21276  ... [continued]: ioctl()) = 0
         25621.078 ( 0.005 ms): CPU 0/KVM/21276 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_IRQ_LINE_STATUS, arg: 0x7f484c6c73c0) = 0
        <SNIP lots of the last one>
         25621.346 ( 0.001 ms): CPU 0/KVM/21276 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_IRQ_LINE_STATUS, arg: 0x7f484c6c73e0) = 0
         40456.997 ( 0.100 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: (WRITE, 0xaf, 0x30, 0x8), arg: 0x7fff053dffe0) = 0
         40457.100 ( 0.019 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: (WRITE, 0xaf, 0x30, 0x8), arg: 0x7fff053dffe0) = 0
         40457.133 ( 0.002 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: (READ|WRITE, 0xaf, 0x12, 0x8), arg: 0x7fff053dff60) = 0
         40457.139 ( 0.001 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: (READ|WRITE, 0xaf, 0x12, 0x8), arg: 0x7fff053dff60) = 0
         40458.503 ( 0.027 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_IOEVENTFD, arg: 0x7fff053dfc80) = 0
         40458.601 ( 0.030 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_IOEVENTFD, arg: 0x7fff053dfc80) = 0
         40458.649 ( 0.003 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: (WRITE, 0xaf, 0x21, 0x8), arg: 0x7fff053dff20) = 0
         40458.654 ( 0.002 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: (WRITE, 0xaf, 0x21, 0x8), arg: 0x7fff053dff20) = 0
         40458.657 ( 0.018 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_IRQFD, arg: 0x7fff053dff00  ) = 0
         40459.077 ( 0.017 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_IRQFD, arg: 0x7fff053dff00  ) = 0
         40459.123 ( 0.017 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_IOEVENTFD, arg: 0x7fff053dfd20) = 0
        <SNIP lots of the last one>
         40463.477 ( 0.013 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_IOEVENTFD, arg: 0x7fff053dfd20) = 0
         40464.874 ( 0.010 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_GET_VCPU_EVENTS, arg: 0x7fff053e0000) = 0
         40464.892 ( 0.048 ms): qemu-system-x8/21238 ioctl(fd: 12</dev/kvm>, cmd: KVM_CHECK_EXTENSION, arg: 0x4c           ) = 1
         40464.991 ( 0.002 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_GET_CLOCK, arg: 0x7fff053e0040) = 0
         40464.962 ( 0.013 ms): CPU 0/KVM/21276 ioctl(fd: 20<anon_inode:kvm-vcpu>, cmd: KVM_GET_MSRS, arg: 0x7f484c6c7670) = 1
         44540.437 ( 0.103 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_SET_GSI_ROUTING, arg: 0x563c7c93c000) = 0
         44540.544 ( 0.008 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_IRQFD, arg: 0x7fff053dfea0  ) = 0
         44540.555 ( 0.029 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_SET_GSI_ROUTING, arg: 0x563c7c93c000) = 0
         44540.586 ( 0.003 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_IRQFD, arg: 0x7fff053dfea0  ) = 0
         44540.592 ( 0.027 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_SET_GSI_ROUTING, arg: 0x563c7c93c000) = 0
         44540.625 ( 0.005 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: (WRITE, 0xaf, 0x21, 0x8), arg: 0x7fff053dfe20) = 0
         44540.639 ( 0.018 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_SET_GSI_ROUTING, arg: 0x563c7c93c000) = 0
         44540.658 ( 0.003 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: (WRITE, 0xaf, 0x21, 0x8), arg: 0x7fff053dfe20) = 0
         44540.686 ( 0.015 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_IOEVENTFD, arg: 0x7fff053dfbe0) = 0
         44540.727 ( 0.014 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_IOEVENTFD, arg: 0x7fff053dfbe0) = 0
         44540.748 ( 0.005 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: (WRITE, 0xaf, 0, 0x8), arg: 0x7fff053dfe88) = 0
         44540.754 ( 0.026 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: (WRITE, 0xaf, 0x3, 0x8), arg: 0x563c7c906870) = 0
         44540.783 ( 0.002 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: (WRITE, 0xaf, 0x10, 0x8), arg: 0x7fff053dff00) = 0
         44540.787 ( 0.002 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: (WRITE, 0xaf, 0x12, 0x8), arg: 0x7fff053dff00) = 0
         44540.793 ( 0.002 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: (WRITE, 0xaf, 0x11, 0x28), arg: 0x7fff053dfe70) = 0
         44540.796 ( 0.010 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: (WRITE, 0xaf, 0x20, 0x8), arg: 0x7fff053dfef0) = 0
         44540.811 ( 0.002 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: (WRITE, 0xaf, 0x10, 0x8), arg: 0x7fff053dff00) = 0
         44540.814 ( 0.002 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: (WRITE, 0xaf, 0x12, 0x8), arg: 0x7fff053dff00) = 0
         44540.819 ( 0.002 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: (WRITE, 0xaf, 0x11, 0x28), arg: 0x7fff053dfe70) = 0
         44540.822 ( 0.005 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: (WRITE, 0xaf, 0x20, 0x8), arg: 0x7fff053dfef0) = 0
         44540.837 ( 0.006 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: (WRITE, 0xaf, 0x30, 0x8), arg: 0x7fff053dff80) = 0
         44540.862 ( 0.004 ms): qemu-system-x8/21238 ioctl(fd: 27</dev/vhost-net>, cmd: (WRITE, 0xaf, 0x30, 0x8), arg: 0x7fff053dff80) = 0
         44540.887 ( 0.014 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_IOEVENTFD, arg: 0x7fff053dfd00) = 0
        <SNIP lots of the last one>
         44542.756 ( 0.020 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_IOEVENTFD, arg: 0x7fff053dfd00) = 0
         44542.809 ( 0.007 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_SET_VCPU_EVENTS, arg: 0x7fff053dffb0) = 0
         44542.819 ( 0.003 ms): qemu-system-x8/21238 ioctl(fd: 12</dev/kvm>, cmd: KVM_CHECK_EXTENSION, arg: 0x4c           ) = 1
         44543.016 ( 0.004 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_SET_CLOCK, arg: 0x7fff053dfff0) = 0
         44543.022 ( 0.008 ms): qemu-system-x8/21238 ioctl(fd: 20<anon_inode:kvm-vcpu>, cmd: KVM_KVMCLOCK_CTRL             ) = 0
         46952.502 ( 0.010 ms): qemu-system-x8/21238 ioctl(fd: 13<anon_inode:kvm-vm>, cmd: KVM_SIGNAL_MSI, arg: 0x563c83379d70) = 1
         46829.292 (249.860 ms): CPU 0/KVM/21276  ... [continued]: ioctl()) = 0
        ^C
      [root@jouet linux]#
      
      Since there are clashes in _IOC_NR() for some cases, notably ioctls with
      PPC_ and ARM_ in its name and some that depend on some internal state to
      be valid, but use the same number as others, those were removed in the
      shell script that builds the table, tools/perf/trace/beauty/kvm_ioctl.sh.
      
      Since so far we're supporting only x86 in the 'cmd' ioctl arg beautifier
      in perf trace, we can leave fully supporting these ioctls for later.
      
      There are some more to handle here, notably the one for /dev/vhost-net, will
      come later.
      
      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: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-zxhebe579n338d7qrnjoctes@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      45717b7f
    • A
      tools include uapi: Grab a copy of linux/kvm.h · 3ce97513
      Arnaldo Carvalho de Melo 提交于
      We will use it to generate tables for beautifying ioctl's 'cmd' arg.
      
      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: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-nxwpq34hu6te1m2ra5m7o8n9@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3ce97513
    • A
      perf trace beautify ioctl: Beautify sound ioctl's 'cmd' arg · 2c3e9629
      Arnaldo Carvalho de Melo 提交于
      This time we try a new approach, using a copy of uapi/sound/asound.h we
      auto generate the string tables, then include it in the ioctl cmd
      beautifier.
      
      This way either the sound developers will add the new commands to the
      tools/ copy, like is happening with other areas of tools/include/ (bpf.h
      comes to mind), or we'll be notified when building perf that our copy
      drifted.
      
      E.g.:
      
        # perf trace -p 22084 -e ioctl 2>&1 | head -5
           0.000 ( 0.068 ms): alsa-sink-ALC3/22084 ioctl(fd: 49</dev/snd/pcmC1D0p>, cmd: SNDRV_PCM_HWSYNC, arg: 0x557f8d7fa0f0) = 0
           0.344 ( 0.041 ms): alsa-sink-ALC3/22084 ioctl(fd: 46</dev/snd/controlC1>, cmd: SNDRV_CTL_ELEM_READ, arg: 0x7fe764018ee0) = 0
           0.403 ( 0.011 ms): alsa-sink-ALC3/22084 ioctl(fd: 49</dev/snd/pcmC1D0p>, cmd: SNDRV_PCM_HWSYNC, arg: 0x557f8d7fa0f0) = 0
           0.427 ( 0.009 ms): alsa-sink-ALC3/22084 ioctl(fd: 49</dev/snd/pcmC1D0p>, cmd: SNDRV_PCM_STATUS_EXT, arg: 0x7fe76c2e0b30) = 0
           2.461 ( 0.042 ms): alsa-sink-ALC3/22084 ioctl(fd: 49</dev/snd/pcmC1D0p>, cmd: SNDRV_PCM_HWSYNC, arg: 0x557f8d7fa0f0) = 0
        #
      
      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: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-8zuyf3e3u6jjcb2xzerw0kdi@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2c3e9629
    • A
      tools include uapi: Grab a copy of sound/asound.h · a215684e
      Arnaldo Carvalho de Melo 提交于
      We will use it to generate tables for beautifying ioctl's 'cmd' arg.
      
      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: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-wit4wwmrh9d37dtgtk0glbbj@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a215684e
    • A
      perf trace beauty ioctl: Beautify DRM ioctl cmds · ef9811f0
      Arnaldo Carvalho de Melo 提交于
      This time we try a new approach, using uapi/drm/ copies of drm.h and
      i915_drm.h we auto generate the string tables, then include it in the
      ioctl cmd beautifier.
      
      This way either the DRM developers will add the new commands to the
      tools/ copy, like is happening with other areas of tools/include/ (bpf.h
      comes to mind), or we'll be notified when building perf that our copy
      drifted.
      
      Either way the time from a new command being added to when 'perf trace'
      gets to know it is greatly shortened, for instance:
      
        # strace -p 22401 -e ioctl
        ioctl(8, DRM_IOCTL_I915_GEM_BUSY, 0x7ffc934f7600) = 0
        ioctl(8, DRM_IOCTL_I915_GEM_SET_DOMAIN, 0x7ffc934f7550) = 0
        ioctl(8, DRM_IOCTL_I915_GEM_SW_FINISH, 0x7ffc934f76e0) = 0
        ioctl(8, DRM_IOCTL_I915_GEM_SW_FINISH, 0x7ffc934f7780) = 0
        ioctl(8, _IOC(_IOC_READ|_IOC_WRITE, 0x64, 0x69, 0x40), 0x7ffc934f7700) = 0
        ioctl(8, DRM_IOCTL_I915_GEM_SET_DOMAIN, 0x7ffc934f7780) = 0
        ioctl(8, DRM_IOCTL_I915_GEM_MADVISE, 0x7ffc934f76f0) = 0
        ioctl(8, DRM_IOCTL_I915_GEM_BUSY, 0x7ffc934f76c0) = 0
        ioctl(8, DRM_IOCTL_I915_GEM_MADVISE, 0x7ffc934f76b0) = 0
        ioctl(8, DRM_IOCTL_I915_GEM_SET_DOMAIN, 0x7ffc934f76d0) = 0
        ioctl(8, DRM_IOCTL_MODE_ADDFB, 0x7ffc934f7880) = 0
        ioctl(8, DRM_IOCTL_MODE_PAGE_FLIP, 0x7ffc934f77d0) = 0
        ^Cstrace: Process 22401 detached
      
      versus:
      
        # perf trace -p 22401 -e ioctl
        1010.856 (0.006 ms): gnome-shell/22401 ioctl(fd: 8</dev/dri/card0>, cmd: DRM_I915_GEM_BUSY, arg: 0x7ffc934f7600) = 0
        1010.865 (0.003 ms): gnome-shell/22401 ioctl(fd: 8</dev/dri/card0>, cmd: DRM_I915_GEM_SET_DOMAIN, arg: 0x7ffc934f7550) = 0
        1010.872 (0.002 ms): gnome-shell/22401 ioctl(fd: 8</dev/dri/card0>, cmd: DRM_I915_GEM_SW_FINISH, arg: 0x7ffc934f76e0) = 0
        1010.939 (0.015 ms): gnome-shell/22401 ioctl(fd: 8</dev/dri/card0>, cmd: DRM_I915_GEM_SW_FINISH, arg: 0x7ffc934f7780) = 0
        1010.959 (0.085 ms): gnome-shell/22401 ioctl(fd: 8</dev/dri/card0>, cmd: DRM_I915_GEM_EXECBUFFER2, arg: 0x7ffc934f7700) = 0
        1011.048 (0.003 ms): gnome-shell/22401 ioctl(fd: 8</dev/dri/card0>, cmd: DRM_I915_GEM_SET_DOMAIN, arg: 0x7ffc934f7780) = 0
        1011.056 (0.002 ms): gnome-shell/22401 ioctl(fd: 8</dev/dri/card0>, cmd: DRM_I915_GEM_MADVISE, arg: 0x7ffc934f76f0) = 0
        1011.060 (0.002 ms): gnome-shell/22401 ioctl(fd: 8</dev/dri/card0>, cmd: DRM_I915_GEM_BUSY, arg: 0x7ffc934f76c0) = 0
        1011.064 (0.003 ms): gnome-shell/22401 ioctl(fd: 8</dev/dri/card0>, cmd: DRM_I915_GEM_MADVISE, arg: 0x7ffc934f76b0) = 0
        1011.068 (0.002 ms): gnome-shell/22401 ioctl(fd: 8</dev/dri/card0>, cmd: DRM_I915_GEM_SET_DOMAIN, arg: 0x7ffc934f76d0) = 0
        1011.074 (0.009 ms): gnome-shell/22401 ioctl(fd: 8</dev/dri/card0>, cmd: DRM_MODE_ADDFB, arg: 0x7ffc934f7880 ) = 0
        1011.096 (0.072 ms): gnome-shell/22401 ioctl(fd: 8</dev/dri/card0>, cmd: DRM_MODE_PAGE_FLIP, arg: 0x7ffc934f77d0) = 0
      ^C[root@jouet linux]#
      
      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: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-mly2d7v9kf28rso81dijbixq@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ef9811f0
  2. 01 8月, 2017 5 次提交
    • A
      tools include uapi: Grab copies of drm/{drm,i915_drm}.h · c1737f2b
      Arnaldo Carvalho de Melo 提交于
      We will use it to generate tables for beautifying ioctl's 'cmd' arg.
      
      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: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-bqoq114h917u6ggazn8m1w0t@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c1737f2b
    • A
      perf trace beauty ioctl: Improve 'cmd' beautifier · 1cc47f2d
      Arnaldo Carvalho de Melo 提交于
      By using the _IOC_(DIR,NR,TYPE,SIZE) macros to lookup a 'type' keyed
      table that then gets indexed by 'nr', falling back to a notation similar
      to the one used by 'strace', only more compact, i.e.:
      
         474.356 ( 0.007 ms): gnome-shell/22401 ioctl(fd: 8</dev/dri/card0>, cmd: (READ|WRITE, 0x64, 0xae, 0x1c), arg: 0x7ffc934f7880) = 0
         474.369 ( 0.053 ms): gnome-shell/22401 ioctl(fd: 8</dev/dri/card0>, cmd: (READ|WRITE, 0x64, 0xb0, 0x18), arg: 0x7ffc934f77d0) = 0
         505.055 ( 0.014 ms): gnome-shell/22401 ioctl(fd: 8</dev/dri/card0>, cmd: (READ|WRITE, 0x64, 0xaf, 0x4), arg: 0x7ffc934f741c) = 0
      
      This also moves it out of builtin-trace.c and into trace/beauty/ioctl.c
      to better compartimentalize all these formatters.
      
      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: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-s3enursdxsvnhdomh6qlte4g@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1cc47f2d
    • A
      tools headers: Fixup tools/include/uapi/linux/bpf.h copy of kernel ABI header · f1d6cb2d
      Arnaldo Carvalho de Melo 提交于
      In 04df41e3 ("bpf: update tools/include/uapi/linux/bpf.h") the files
      added in 40304b2a ("bpf: BPF support for sock_ops") were added to
      tools/include, but not in a verbatim way, missing the comments, which
      ends up triggering this warning when build tools/perf/:
      
        make: Entering directory '/home/acme/git/linux/tools/perf'
          BUILD:   Doing 'make -j4' parallel build
        Warning: Kernel ABI header at 'tools/include/uapi/linux/bpf.h' differs from latest version at 'include/uapi/linux/bpf.h'
      
      Make sure the the lines are equal, to fix the simple header copy
      drift detector in tools/perf/.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Lawrence Brakmo <brakmo@fb.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Fixes: 04df41e3 ("bpf: update tools/include/uapi/linux/bpf.h")
      Link: http://lkml.kernel.org/n/tip-z9qyyqht9qq3yyxu76sfy0dh@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f1d6cb2d
    • A
      tools perf: Do not check spaces/blank lines when checking header file copy drift · 470de0f3
      Arnaldo Carvalho de Melo 提交于
      We copy headers from include/, arch/ to allow tools/ use defines,
      structs from newer kernels and still be able to build on older systems.
      
      We then, as part of a build, check if those copies got out of sync, when
      we emit a warning, so that we can check if something needs to be
      reflected on the tools, e.g. a 'perf trace' syscall argument beautifier
      needs tweaking.
      
      But we don't have to be super strict with that, for instance, extra
      spaces, tabs or blank lines aren't problematic, so change
      check-headers.sh to have "--ignore-blank-lines --ignore-space-change" as
      default "diff" arguments.
      
      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: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-d8emqpdc3m2qtzt1ei8ra2tf@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      470de0f3
    • A
      tools include uapi: Grab a copy of asm-generic/ioctls.h · 6375f0ab
      Arnaldo Carvalho de Melo 提交于
      So that we can build on older systems where otherwise we would end up
      with:
      
          CC       /tmp/build/perf/trace/beauty/ioctl.o
        trace/beauty/ioctl.c: In function 'ioctl__scnprintf_tty_cmd':
        trace/beauty/ioctl.c:25:17: error: 'TIOCGEXCL' undeclared (first use in this function)
        trace/beauty/ioctl.c:25:17: note: each undeclared identifier is reported only once for each function it appears in
        trace/beauty/ioctl.c:25:2: error: array index in initializer not of integer type
        trace/beauty/ioctl.c:25:2: error: (near initialization for 'ioctl_tty_cmd')
      
      This way we can build a tool on an older system and it will still be
      capable of processing perf.data files generated on newer systems.
      
      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: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-8qvkv6txwuzua6d0yvt65wl3@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6375f0ab
  3. 31 7月, 2017 4 次提交
    • A
      tools headers: Fixup tools/include/uapi/linux/bpf.h copy of kernel ABI header · d62c1d72
      Arnaldo Carvalho de Melo 提交于
      In 2be7e212 ("bpf: add bpf_skb_adjust_room helper") BPF_ADJ_ROOM_NET was
      added to include/uapi/linux/bpf.h but BPF_ADJ_ROOM_NET_OPS was added to
      tools/include/uapi/linux/bpf.h, making these files differ, fix it by using the
      same name in both, BPF_ADJ_ROOM_NET, the one in the kernel headers copy.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Fixes: 2be7e212 ("bpf: add bpf_skb_adjust_room helper")
      Link: http://lkml.kernel.org/n/tip-2bmwovi9lymplyz6wsszppyf@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d62c1d72
    • I
      tools headers: Sync kernel ABI headers with tooling headers · a40f6177
      Ingo Molnar 提交于
      Sync up (copy) the following v4.13 kernel headers to the tooling headers:
      
        arch/arm/include/uapi/asm/kvm.h:
        arch/arm64/include/uapi/asm/kvm.h:
        arch/powerpc/include/uapi/asm/kvm.h:
        arch/s390/include/uapi/asm/kvm.h:
      
         - KVM ABI extensions, which do not affect perf tooling
      
        arch/x86/include/asm/cpufeatures.h:
        arch/x86/include/asm/disabled-features.h:
      
         - New PCID CPU feature on Intel CPUs - does not affect tooling.
      
      I.e. no real changes were needed to resolve the build warnings, just a plain copy
      of the latest kernel header version.
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David Carrillo-Cisneros <davidcc@google.com>
      Cc: Francis Deslauriers <francis.deslauriers@efficios.com>
      Cc: Geneviève Bastien <gbastien@versatic.net>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Julien Desfossez <jdesfossez@efficios.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Turner <pjt@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Simon Que <sque@chromium.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Taeung Song <treeze.taeung@gmail.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/20170730095232.4j4xigsoqwufl5hu@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a40f6177
    • I
      perf build: Clarify open-coded header version warning message · 8255e1ef
      Ingo Molnar 提交于
      In this patch we changed the header checks:
      
        perf build: Clarify header version warning message
      
      Unfortunately the header checks were copied to various places and thus the message got
      out of sync. Fix some of them here.
      
      Note that there's still old, misleading messages remaining in:
      
        tools/objtool/Makefile: || echo "warning: objtool: x86 instruction decoder differs from kernel" >&2 )) || true
        tools/objtool/Makefile: || echo "warning: objtool: orc_types.h differs from kernel" >&2 )) || true
      
      here objtool copied the perf message, plus:
      
       tools/perf/util/intel-pt-decoder/Build: || echo "Warning: Intel PT: x86 instruction decoder differs from kernel" >&2 )) || true
      
      here the PT code regressed over the original message and only emits a vague warning
      instead of specific file names...
      
      All of this should be consolidated into tools/Build/ and used in a consistent
      manner.
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David Carrillo-Cisneros <davidcc@google.com>
      Cc: Francis Deslauriers <francis.deslauriers@efficios.com>
      Cc: Geneviève Bastien <gbastien@versatic.net>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Julien Desfossez <jdesfossez@efficios.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Turner <pjt@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Simon Que <sque@chromium.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Taeung Song <treeze.taeung@gmail.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/20170730095130.bblldwxjz5hamybb@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8255e1ef
    • I
      perf build: Clarify header version warning message · c59796d5
      Ingo Molnar 提交于
      Change this:
      
        Warning: arch/x86/include/asm/disabled-features.h differs from kernel
        Warning: arch/x86/include/asm/cpufeatures.h differs from kernel
        Warning: arch/powerpc/include/uapi/asm/kvm.h differs from kernel
        Warning: arch/s390/include/uapi/asm/kvm.h differs from kernel
      
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/disabled-features.h' differs from latest version at 'arch/x86/include/asm/disabled-features.h'
        Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h'
        Warning: Kernel ABI header at 'tools/arch/powerpc/include/uapi/asm/kvm.h' differs from latest version at 'arch/powerpc/include/uapi/asm/kvm.h'
        Warning: Kernel ABI header at 'tools/arch/s390/include/uapi/asm/kvm.h' differs from latest version at 'arch/s390/include/uapi/asm/kvm.h'
      
      ... to make it clearer what the warning is about, and to make it easier
      to diff the two versions when syncing up the files.
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David Carrillo-Cisneros <davidcc@google.com>
      Cc: Francis Deslauriers <francis.deslauriers@efficios.com>
      Cc: Geneviève Bastien <gbastien@versatic.net>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Julien Desfossez <jdesfossez@efficios.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Turner <pjt@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Simon Que <sque@chromium.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Taeung Song <treeze.taeung@gmail.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/20170730093747.qogjn3lp7ntwcgwg@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c59796d5
  4. 30 7月, 2017 2 次提交
    • I
      Merge tag 'perf-core-for-mingo-4.14-20170728' of... · c3a3800f
      Ingo Molnar 提交于
      Merge tag 'perf-core-for-mingo-4.14-20170728' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes for 4.14 from Arnaldo Carvalho de Melo:
      
      New features:
      
       - Add PERF_SAMPLE_CALLCHAIN and PERF_RECORD_MMAP[2] to 'perf data' CTF
         conversion, allowing CTF trace visualization tools to show callchains
         and to resolve symbols (Geneviève Bastien)
      
      Improvements:
      
       - Use group read for event groups in 'perf stat', reducing overhead when
         groups are defined in the event specification, i.e. when using {} to
         enclose a list of events, asking them to be read at the same time,
         e.g.: "perf stat -e '{cycles,instructions}'" (Jiri Olsa)
      
      Fixes:
      
       - Do not overwrite perf_sample->weight in 'perf annotate' when
         processing samples, use whatever came from the kernel when
         perf_event_attr.sample_type has PERF_SAMPLE_WEIGHT set or just handle
         its default value, 0, when that is not set and "weight" is one of the
         sort orders chosen (Arnaldo Carvalho de Melo)
      
       - 'perf annotate --show-total-period' fixes:
          - TUI should show period, not nr_samples
          - Set appropriate column width for period/percent
          - Fix the column header to show "Period" when when that is what
            is being asked for
         (Taeung Song, Arnaldo Carvalho de Melo)
      
       - Use default sort if evlist is empty, fixing pipe mode (David Carrillo-Cisneros)
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      c3a3800f
    • I
  5. 29 7月, 2017 4 次提交
    • G
      perf data: Add doc when no conversion support compiled · 6b7007af
      Geneviève Bastien 提交于
      This adds documentation on the environment variables needed to the
      message telling that no conversion support is compiled in.
      
      Committer testing:
      
        $ make -C tools/perf install
        $ perf data convert --all --to-ctf myctftrace
        No conversion support compiled in. perf should be compiled with environment variables LIBBABELTRACE=1 and LIBBABELTRACE_DIR=/path/to/libbabeltrace/
        $
      Signed-off-by: NGeneviève Bastien <gbastien@versatic.net>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Francis Deslauriers <francis.deslauriers@efficios.com>
      Cc: Julien Desfossez <jdesfossez@efficios.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20170727181205.24843-3-gbastien@versatic.netSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6b7007af
    • G
      perf data: Add mmap[2] events to CTF conversion · f9f6f2a9
      Geneviève Bastien 提交于
      This adds the mmap and mmap2 events to the CTF trace obtained from perf
      data.
      
      These events will allow CTF trace visualization tools like Trace Compass
      to automatically resolve the symbols of the callchain to the
      corresponding function or origin library.
      
      To include those events, one needs to convert with the --all option.
      Here follows an output of babeltrace:
      
        $ sudo perf data convert --all --to-ctf myctftrace
        $ babeltrace ./myctftrace
        [19:00:00.000000000] (+0.000000000) perf_mmap2: { cpu_id = 0 },
       { pid = 638, tid = 638, start = 0x7F54AE39E000, filename =
       "/usr/lib/ld-2.25.so" }
        [19:00:00.000000000] (+0.000000000) perf_mmap2: { cpu_id = 0 }, { pid =
       638, tid = 638, start = 0x7F54AE565000, filename =
       "/usr/lib/libudev.so.1.6.6" }
        [19:00:00.000000000] (+0.000000000) perf_mmap2: { cpu_id = 0 }, { pid =
       638, tid = 638, start = 0x7FFC093EA000, filename = "[vdso]" }
      Signed-off-by: NGeneviève Bastien <gbastien@versatic.net>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Francis Deslauriers <francis.deslauriers@efficios.com>
      Cc: Julien Desfossez <jdesfossez@efficios.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20170727181205.24843-2-gbastien@versatic.netSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f9f6f2a9
    • G
      perf data: Add callchain to CTF conversion · a3073c8e
      Geneviève Bastien 提交于
      The field perf_callchain, if available, is added to the sampling events
      during the CTF conversion. It is an array of u64 values.  The
      perf_callchain_size field contains the size of the array.
      
      It will allow the analysis of sampling data in trace visualization tools
      like Trace Compass. Possible analyses with those data: dynamic
      flamegraphs, correlation with other tracing data like a userspace trace.
      
      Here follows a babeltrace CTF output of a trace with callchain:
      
        $ babeltrace ./myctftrace
        [17:38:45.672760285] (+?.?????????) cycles:ppp: { cpu_id = 0 }, { perf_ip = 0xFFFFFFFF81063EE4, perf_tid = 25841, perf_pid = 25774, perf_period = 1, perf_callchain_size = 7, perf_callchain = [ [0] = 0xFFFFFFFFFFFFFF80, [1] = 0xFFFFFFFF81063EE4, [2] = 0xFFFFFFFF8100C770, [3] = 0xFFFFFFFF81006EC6, [4] = 0xFFFFFFFF8118245E, [5] = 0xFFFFFFFF810A9224, [6] = 0xFFFFFFFF8164A4C6 ] }
        [17:38:45.672777672] (+0.000017387) cycles:ppp: { cpu_id = 0 }, { perf_ip = 0xFFFFFFFF81063EE4, perf_tid = 25841, perf_pid = 25774, perf_period = 1, perf_callchain_size = 8, perf_callchain = [ [0] = 0xFFFFFFFFFFFFFF80, [1] = 0xFFFFFFFF81063EE4, [2] = 0xFFFFFFFF8100C770, [3] = 0xFFFFFFFF81006EC6, [4] = 0xFFFFFFFF8118245E, [5] = 0xFFFFFFFF810A9224, [6] = 0xFFFFFFFF8164A4C6, [7] = 0xFFFFFFFF8164ABAD ] }
        [17:38:45.672786700] (+0.000009028) cycles:ppp: { cpu_id = 0 }, { perf_ip = 0xFFFFFFFF81063EE4, perf_tid = 25841, perf_pid = 25774, perf_period = 70, perf_callchain_size = 3, perf_callchain = [ [0] = 0xFFFFFFFFFFFFFF80, [1] = 0xFFFFFFFF81063EE4, [2] = 0xFFFFFFFF8100C770 ] }
      Signed-off-by: NGeneviève Bastien <gbastien@versatic.net>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Francis Deslauriers <francis.deslauriers@efficios.com>
      Cc: Julien Desfossez <jdesfossez@efficios.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20170727181205.24843-1-gbastien@versatic.net
      [ Removed PERF_SAMPLE_CALLCHAIN from the TODO list, jolsa ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a3073c8e
    • A
      perf annotate TUI: Set appropriate column width for period/percent · 3861c4a4
      Arnaldo Carvalho de Melo 提交于
      Either when we start 'perf annotate' or 'perf report' with
      --show-total-period or when we, in the annotate browser, press 't' to
      toggle period/percent for the first column, we need to adjust the width
      for the 'period' case.
      Based-on-a-patch-by: NTaeung Song <treeze.taeung@gmail.com>
      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: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-n2np5qcs20u6qjdr9orygne6@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3861c4a4
  6. 28 7月, 2017 5 次提交
  7. 27 7月, 2017 7 次提交
    • A
      perf annotate stdio: Set enough columns for --show-total-period · ce9ee4a2
      Arnaldo Carvalho de Melo 提交于
      Now that we set the first column header according to wether
      --show-total-period is being used, we need to size it accordingly.
      Based-on-a-patch-by: NTaeung Song <treeze.taeung@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/n/tip-pu504ffnit4m334k09hxcbs3@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ce9ee4a2
    • D
      perf sort: Use default sort if evlist is empty · 64831a21
      David Carrillo-Cisneros 提交于
      Fixes bug noted by Jiri in https://lkml.org/lkml/2017/6/13/755 and
      caused by commit d49dadea ("perf tools: Make 'trace' or
      'trace_fields' sort key default for tracepoint events") not taking into
      account that evlist is empty in pipe-mode.
      
      Before this commit, pipe mode will only show bogus "100.00%  N/A"
      instead of correct output as follows:
      
        $ perf record -o - sleep 1 | perf report -i -
        # To display the perf.data header info, please use --header/--header-only options.
        #
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.000 MB - ]
        #
        # Total Lost Samples: 0
        #
        # Samples: 8  of event 'cycles:ppH'
        # Event count (approx.): 145658
        #
        # Overhead  Trace output
        # ........  ............
        #
           100.00%  N/A
      
      Correct output, after patch:
      
        $ perf record -o - sleep 1 | perf report -i -
        # To display the perf.data header info, please use --header/--header-only options.
        #
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.000 MB - ]
        #
        # Total Lost Samples: 0
        #
        # Samples: 8  of event 'cycles:ppH'
        # Event count (approx.): 191331
        #
        # Overhead  Command  Shared Object      Symbol
        # ........  .......  .................  .................................
        #
            81.63%  sleep    libc-2.19.so       [.] _exit
            13.58%  sleep    ld-2.19.so         [.] do_lookup_x
             2.34%  sleep    [kernel.kallsyms]  [k] context_switch
             2.34%  sleep    libc-2.19.so       [.] __GI___libc_nanosleep
             0.11%  perf     [kernel.kallsyms]  [k] __intel_pmu_enable_a
      Reported-by: NJiri Olsa <jolsa@kernel.org>
      Report-Link: https://lkml.kernel.org/r/20170613185422.GA6092@kravaSigned-off-by: NDavid Carrillo-Cisneros <davidcc@google.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Turner <pjt@google.com>
      Cc: Simon Que <sque@chromium.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Fixes: d49dadea ("perf tools: Make 'trace' or 'trace_fields' sort key default for tracepoint events")
      Link: https://lkml.kernel.org/r/20170721051157.47331-1-davidcc@google.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      64831a21
    • A
      perf annotate: Do not overwrite perf_sample->weight · c6c13be7
      Arnaldo Carvalho de Melo 提交于
      When we parse an event we may get a value from the kernel in response to
      PERF_SAMPLE_WEIGHT being set in perf_event_attr->sample_type, and if it
      is not set, then perf_sample->weight will be set to zero, which should
      be ok according to a discussion with Andi Kleen [1]:
      
      1: https://lkml.kernel.org/r/20170724174637.GS3044@two.firstfloor.orgAcked-by: NAndi Kleen <andi@firstfloor.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Taeung Song <treeze.taeung@gmail.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-8ev8ufk3lzmvgz37yg9nv3qz@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c6c13be7
    • J
      perf stat: Use group read for event groups · 82bf311e
      Jiri Olsa 提交于
      Make perf stat use  group read if there  are groups defined. The group
      read will get the values for all member of groups within a single
      syscall instead of calling read syscall for every event.
      
      We can see considerable less amount of kernel cycles spent on single
      group read, than reading each event separately, like for following perf
      stat command:
      
        # perf stat -e {cycles,instructions} -I 10 -a sleep 1
      
      Monitored with "perf stat -r 5 -e '{cycles:u,cycles:k}'"
      
      Before:
      
              24,325,676      cycles:u
             297,040,775      cycles:k
      
             1.038554134 seconds time elapsed
      
      After:
              25,034,418      cycles:u
             158,256,395      cycles:k
      
             1.036864497 seconds time elapsed
      
      The perf_evsel__open fallback changes contributed by Andi Kleen.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/20170726120206.9099-4-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      82bf311e
    • J
      perf evsel: Add read_counter() · f7794d52
      Jiri Olsa 提交于
      Add perf_evsel__read_counter() to read single or group counter. After
      calling this function the counter's evsel::counts struct is filled with
      values for the counter and member of its group if there are any.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/20170726120206.9099-3-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f7794d52
    • J
      perf tools: Add perf_evsel__read_size function · de63403b
      Jiri Olsa 提交于
      Currently we use the size of struct perf_counts_values to read the
      event, which prevents us to put any new member to the struct.
      
      Adding perf_evsel__read_size to return size of the buffer needed for
      event read.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/20170726120206.9099-2-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      de63403b
    • I
      Merge tag 'perf-core-for-mingo-4.14-20170725' of... · ee438ec8
      Ingo Molnar 提交于
      Merge tag 'perf-core-for-mingo-4.14-20170725' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvemends and fixes for v4.14:
      
      New features:
      
      - Filter out 'sshd' in the tracer ancestry in 'perf trace' syswide tracing,
        to elliminate tracing loops (Arnaldo Carvalho de Melo)
      
      - Support lookup of symbols in other mount namespaces in 'perf top' (Krister Johansen)
      
      - Initial 'clone' syscall args beautifier in 'perf trace' (Arnaldo Carvalho de Melo)
      
      User visible changes:
      
      - Ignore 'fd' and 'offset' args for MAP_ANONYMOUS in 'perf trace'
        (Arnaldo Carvalho de Melo)
      
      - Process tracing data in 'perf annotate' pipe mode (David Carrillo-Cisneros)
      
      - Make 'perf report --branch-history' work without callgraphs(-g) option
        in perf record (Jin Yao)
      
      - Tag branch type/flag on "to" and tag cycles on "from" in 'perf report' (Jin Yao)
      
      Fixes:
      
      - Fix jvmti linker error when libelf config is disabled (Sudeep Holla)
      
      - Fix cgroups refcount usage (Arnaldo Carvalho de Melo)
      
      - Fix kernel symbol adjustment for s390x (Thomas Richter)
      
      - Fix 'perf report --stdio --show-total-period', it was showing the
        number of samples, not the total period (Taeung Song)
      
      Infrastructure changes:
      
      - Add perf_sample dictionary to tracepoint handlers in 'perf script'
        python, which were already present for other types of events
        (hardware, etc) (Arun Kalyanasundaram)
      
      - Make build fail on vendor events JSON parse error (Andi Kleen)
      
      - Adopt strstarts() from the kernel (Arnaldo Carvalho de Melo)
      
      Arch specific changes:
      
      - Set no_aux_samples for the tracking event in Intel PT (Kan Liang)
      
      - Always set no branch for Intel PT dummy event (Kan Liang)
      
      Trivial changes:
      
      - Simplify some error handlers in 'perf script' (Dan Carpenter)
      
      - Add EXCLUDE_EXTLIBS and EXTRA_PERFLIBS to makefile (David Carrillo-Cisneros)
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      ee438ec8
  8. 26 7月, 2017 4 次提交
    • A
      perf tools: Add tools/include/uapi/asm-generic/fcntl.h to the MANIFEST · 62e6039f
      Arnaldo Carvalho de Melo 提交于
      This file was copied from the kernel so that we could build tools/perf/
      on older systems where some newer defines, such as these are available:
      
          CC       trace/beauty/fcntl.o
        trace/beauty/fcntl.c: In function ‘syscall_arg__scnprintf_fcntl_arg’:
        trace/beauty/fcntl.c:93:13: error: ‘F_OFD_SETLK’ undeclared (first use in this function)
              cmd == F_OFD_SETLK || cmd == F_OFD_SETLKW || cmd == F_OFD_GETLK ||
                     ^
        trace/beauty/fcntl.c:93:13: note: each undeclared identifier is reported only once for each function it appears in
        trace/beauty/fcntl.c:93:35: error: ‘F_OFD_SETLKW’ undeclared (first use in this function)
              cmd == F_OFD_SETLK || cmd == F_OFD_SETLKW || cmd == F_OFD_GETLK ||
                                           ^
        trace/beauty/fcntl.c:93:58: error: ‘F_OFD_GETLK’ undeclared (first use in this function)
              cmd == F_OFD_SETLK || cmd == F_OFD_SETLKW || cmd == F_OFD_GETLK ||
                                                                  ^
        mv: cannot stat ‘trace/beauty/.fcntl.o.tmp’: No such file or directory
        make[4]: *** [trace/beauty/fcntl.o] Error 1
        make[3]: *** [trace/beauty] Error 2
        make[3]: *** Waiting for unfinished jobs....
          CC       tests/llvm.o
      
      But we need to make sure that it is also in the tools/perf/MANIFEST file, that
      is used to build a tarball for detached (from the kernel sources) compilation,
      which was failing, with the above message, on a RHEL7.4 system, fix it.
      
      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: Wang Nan <wangnan0@huawei.com>
      Fixes: 84d1d8a1 ("tools include uapi asm-generic: Grab a copy of fcntl.h")
      Link: http://lkml.kernel.org/n/tip-2d5px7aq5stbwi24pgirwtlm@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      62e6039f
    • T
      perf annotate stdio: Fix column header when using --show-total-period · 38d2dcd0
      Taeung Song 提交于
      Currently the first column header is always "Percent", fix it to show
      correct column name based on given options, i.e. if using
      --show-total-period, show "Event count" as a first column.
      Reported-by: NMilian Wolff <milian.wolff@kdab.com>
      Signed-off-by: NTaeung Song <treeze.taeung@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/c3c902e7-95bc-16d4-366f-12eb034c5c8d@gmail.com
      [ Extracted from a larger patch ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      38d2dcd0
    • A
      perf jevents: Make build fail on JSON parse error · 3f056b66
      Andi Kleen 提交于
      Today, when a JSON file fails parsing the build continues, but there are
      no json files built in, which is difficult to debug later.  Make the
      build stop on a parse error instead.
      
      v2: Add fixes from Sukadev. Now we handle architectures
          with no JSON events correctly. And fix some stale comments.
      
      Committer note:
      
      Tested by running the cross build container tests, that were all failing
      for v1.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Link: http://lkml.kernel.org/r/20170725001638.19990-1-andi@firstfloor.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3f056b66
    • J
      perf report: Tag branch type/flag on "to" and tag cycles on "from" · a1a8bed3
      Jin Yao 提交于
      Current --branch-history LBR annotation displays confused data. For
      example, each cycles report is duplicated on both "from" and "to"
      entries.
      
      For example:
      
        perf report --branch-history --no-children --stdio
      
        --2.32%--main div.c:39 (COND_BWD CROSS_2M predicted:49.7% cycles:1)
                  main div.c:44 (predicted:49.7% cycles:1)
                  main div.c:42 (RET CROSS_2M cycles:2)
                  compute_flag div.c:28 (cycles:2)
                  compute_flag div.c:27 (RET CROSS_2M cycles:1)
                  rand rand.c:28 (cycles:1)
                  rand rand.c:28 (RET CROSS_2M cycles:1)
                  __random random.c:298 (cycles:1)
                  __random random.c:297 (COND_BWD CROSS_2M cycles:1)
                  __random random.c:295 (cycles:1)
                  __random random.c:295 (COND_BWD CROSS_2M cycles:1)
                  __random random.c:295 (cycles:1)
                  __random random.c:295 (RET CROSS_2M cycles:9)
      
      The cycles should be tagged only on the "from". It's for the code block
      that ends with "from", not for "to".
      
      Another issue is the "predicted:49.7%" is duplicated too (tag on both
      "from" and "to").
      
      This patch tags the branch type/flag on "to" and tag the cycles on
      "from".
      
      For example:
      
        --2.32%--main div.c:39 (COND_BWD CROSS_2M predicted:49.7%)
                  main div.c:44 (cycles:1)
                  main div.c:42 (RET CROSS_2M)
                  compute_flag div.c:28 (cycles:2)
                  compute_flag div.c:27 (RET CROSS_2M)
                  rand rand.c:28 (cycles:1)
                  rand rand.c:28 (RET CROSS_2M)
                  __random random.c:298 (cycles:1)
                  __random random.c:297 (COND_BWD CROSS_2M)
                  __random random.c:295 (cycles:1)
                  __random random.c:295 (COND_BWD CROSS_2M)
                  __random random.c:295 (cycles:1)
                  __random random.c:295 (RET CROSS_2M)
                  |
                   --2.23%--__random_r random_r.c:392 (cycles:9)
      
      In this example, The "main div.c:39 (COND_BWD CROSS_2M predicted:49.7%)"
      is "to" of branch and "main div.c:44 (cycles:1)" is "from" of branch.
      It should be easier for understanding than before.
      Signed-off-by: NYao Jin <yao.jin@linux.intel.com>
      Reviewed-by: NAndi Kleen <ak@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1500894547-18411-1-git-send-email-yao.jin@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a1a8bed3