1. 30 Jul, 2017 1 commit
  2. 26 Jul, 2017 13 commits
  3. 25 Jul, 2017 7 commits
    • Jiri Olsa's avatar
      perf evsel: Add verbose output for sys_perf_event_open fallback · 2b04e0f8
      Jiri Olsa authored
      Adding info about what is being switched off in the sys_perf_event_open
      fallback.
      
      New output (notice the 'switching off' lines):
      
        $ perf stat -e '{cycles,instructions}' -vvv ls
        Using CPUID GenuineIntel-6-3D
        intel_pt default config: tsc
        ------------------------------------------------------------
        perf_event_attr:
          size                             112
          sample_type                      IDENTIFIER
          read_format                      TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING|ID|GROUP
          disabled                         1
          inherit                          1
          enable_on_exec                   1
          exclude_guest                    1
        ------------------------------------------------------------
        sys_perf_event_open: pid 3591  cpu -1  group_fd -1  flags 0x8
        sys_perf_event_open failed, error -22
        switching off cloexec flag
        ------------------------------------------------------------
        perf_event_attr:
          size                             112
          sample_type                      IDENTIFIER
          read_format                      TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING|ID|GROUP
          disabled                         1
          inherit                          1
          enable_on_exec                   1
          exclude_guest                    1
        ------------------------------------------------------------
        sys_perf_event_open: pid 3591  cpu -1  group_fd -1  flags 0
        sys_perf_event_open failed, error -22
        switching off exclude_guest, exclude_host
        ------------------------------------------------------------
        perf_event_attr:
          size                             112
          sample_type                      IDENTIFIER
          read_format                      TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING|ID|GROUP
          disabled                         1
          inherit                          1
          enable_on_exec                   1
        ------------------------------------------------------------
        sys_perf_event_open: pid 3591  cpu -1  group_fd -1  flags 0
        sys_perf_event_open failed, error -22
        switching off sample_id_all
        ------------------------------------------------------------
        perf_event_attr:
          size                             112
          sample_type                      IDENTIFIER
          read_format                      TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING|ID|GROUP
          disabled                         1
          inherit                          1
          enable_on_exec                   1
        ...
      Signed-off-by: default avatarJiri 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/20170721121212.21414-2-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2b04e0f8
    • Sudeep Holla's avatar
      perf jvmti: Fix linker error when libelf config is disabled · 5d90faf4
      Sudeep Holla authored
      When libelf is disabled in the configuration, we get the following
      linker error:
      
        LINK     libperf-jvmti.so
        ld: cannot find -lelf
        Makefile.perf:515: recipe for target 'libperf-jvmti.so' failed
      
      Jiri pointed out that both librt and libelf are not really required. So
      this patch fixes the linker error by getting rid of unwanted libraries
      in the linker stage.
      Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      Acked-by: default avatarDavid Carrillo-Cisneros <davidcc@google.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Elena Reshetova <elena.reshetova@intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Paul Turner <pjt@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Fixes: 209045ad ("perf tools: add JVMTI agent library")
      Link: http://lkml.kernel.org/r/20170719011839.99399-5-davidcc@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5d90faf4
    • David Carrillo-Cisneros's avatar
      perf annotate: Process tracing data in pipe mode · f4849599
      David Carrillo-Cisneros authored
      'perf annotate' was missing the handler for tracing data records.
      
      Prior to this patch we obtained "unhandled" records when piping trace
      events to perf annotate (using -D option to show the dump_printf
      messages in process_event_synth_tracing_data_stub):
      
        $ perf record -o - -e block:bio_free sleep 2 | perf annotate -D --stdio
        ...
        0x78 [0xc]: PERF_RECORD_TRACING_DATA: unhandled!
        ...
      Signed-off-by: default avatarDavid Carrillo-Cisneros <davidcc@google.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Elena Reshetova <elena.reshetova@intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Paul Turner <pjt@google.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/20170719011839.99399-4-davidcc@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f4849599
    • David Carrillo-Cisneros's avatar
      perf tools: Add EXCLUDE_EXTLIBS and EXTRA_PERFLIBS to makefile · cb281fea
      David Carrillo-Cisneros authored
      The goal is to allow users to override linking of libraries that
      were automatically added to PERFLIBS.
      
      EXCLUDE_EXTLIBS contains linker flags to be removed from LIBS
      while EXTRA_PERFLIBS contains linker flags to be added.
      
      My use case is to force certain library to be build statically,
      e.g. for libelf:
      
        EXCLUDE_EXTLIBS=-lelf EXTRA_PERFLIBS=path/libelf.a
      Signed-off-by: default avatarDavid Carrillo-Cisneros <davidcc@google.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Elena Reshetova <elena.reshetova@intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Paul Turner <pjt@google.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/20170719011839.99399-3-davidcc@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      cb281fea
    • Arnaldo Carvalho de Melo's avatar
      perf cgroup: Fix refcount usage · cd8dd032
      Arnaldo Carvalho de Melo authored
      When converting from atomic_t to refcount_t we didn't follow the usual
      step of initializing it to one before taking any new reference, which
      trips over checking if taking a reference for a freed refcount_t, fix
      it.
      
      Brendan's report:
      
       ---
      It's 4.12-rc7, with node v4.4.1. I'm building 4.13-rc1 now, as I hit
      what I think is another unrelated perf bug and I'm starting to wonder
      what else is broken on that version:
      
      (root) /mnt/src/linux-4.12-rc7/tools/perf # ./perf record -F 99 -a -e
      cpu-clock --cgroup=docker/f9e9d5df065b14646e8a11edc837a13877fd90c171137b2ba3feb67a0201cb65
      -g
      perf: /mnt/src/linux-4.12-rc7/tools/include/linux/refcount.h:108:
      refcount_inc: Assertion `!(!refcount_inc_not_zero(r))' failed.
      Aborted
      
      that used to work...
       ---
      
      Testing it:
      
      Before:
      
        # perf stat -e cycles -C 0 --cgroup /
        perf: /home/acme/git/linux/tools/include/linux/refcount.h:108: refcount_inc: Assertion `!(!refcount_inc_not_zero(r))' failed.
        Aborted (core dumped)
        #
      
      After:
      
        # perf stat -e cycles -C 0 --cgroup /
      ^C
        Performance counter stats for 'CPU(s) 0':
      
             132,081,393      cycles                    /
      
             2.492942763 seconds time elapsed
      
        #
      Reported-by: default avatarBrendan Gregg <brendan.d.gregg@gmail.com>
      Acked-by: default avatarElena Reshetova <elena.reshetova@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David Carrillo-Cisneros <davidcc@google.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Krister Johansen <kjlx@templeofstupid.com>
      Cc: Paul Turner <pjt@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sudeep Holla <Sudeep.Holla@arm.com>
      Cc: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Fixes: 79c5fe6d ("perf cgroup: Convert cgroup_sel.refcnt from atomic_t to refcount_t")
      Link: http://lkml.kernel.org/n/tip-l7ovfblq14ip2i08m1g0fkhv@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      cd8dd032
    • Thomas Richter's avatar
      perf report: Fix kernel symbol adjustment for s390x · cf6383f7
      Thomas Richter authored
      On s390x the kernel text segment starts at address 0x0.  When perf
      report reads kernel symbols from vmlinux file it adds an offset of
      0x1000.
      
      For example see symbol set_reset_devices:
      
        [root@s8360047 linux-devel]# nm -A vmlinux| fgrep set_reset_devices
        vmlinux:0000000001379000 t set_reset_devices
        [root@s8360047 linux-devel]#
      
        [root@s8360047 linux-devel]# fgrep set_reset_devices /proc/kallsyms
        0000000001379000 t set_reset_devices
        [root@s8360047 linux-devel]#
      
      The kernel symbol table and the vmlinux file have the same address for
      symbol set_reset_devices namely 1379000.
      
      When perf report reads this symbols it displays it with address
      symbol__new: set_reset_devices 0x137a000-0x137a018
      
      There is a difference between perf report and vmlinux of 0x1000.
      
      The reason for the difference is at kernel symbol load time in function
      dso__load_sym(). The vmlinux file is investigated with its ELF header.
      Command readelf shows this:
      
        Section Headers:
        [Nr] Name              Type             Address           Offset
             Size              EntSize          Flags  Link  Info  Align
        [ 0]                   NULL             0000000000000000  00000000
             0000000000000000  0000000000000000           0     0     0
        [ 1] .text             PROGBITS         0000000000000000  00001000
             0000000000b0e0c2  0000000000000000  AX       0     0     128
      
      This leads to an invalid calculation of the symbol start address, see
      file utit/symbol-elf.c line 974:
      
              /* Adjust symbol to map to file offset */
              if (adjust_kernel_syms)
                      sym.st_value -= shdr.sh_addr - shdr.sh_offset;
      
      With shdr.sh_addr set to 0x0 and shdr.sh_offset set to 0x1000 as read
      from the ELF .text section 0x1000 is added to the symbol address.
      
      I would like to fix this by introducing an archticture specific function
      named elf__needs_adjust_symbols(). This is the same approach as done by
      PowerPC.  The function currently does not exist for s390x and the
      default weak one is used.  The s390x specific one returns false when
      symsrc_init() is invoked for kernel symbols and results in variable
      adjust_kernel_syms being false.  This omits the adjustment and the
      correct address is displayed (when symbol resolvement does not work).
      
      The s390x specific function returns false for kernel symbol adjustment
      and returns true for kernel modules, processes and shared libraries.
      Signed-off-by: default avatarThomas-Mich Richter <tmricht@linux.vnet.ibm.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
      LPU-Reference: 20170713130252.6167-1-tmricht@linux.vnet.ibm.com
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      cf6383f7
    • Taeung Song's avatar
      perf annotate stdio: Fix --show-total-period · 585d93c5
      Taeung Song authored
      We were showing the total number of samples, not the total period as
      asked by the user, fix it.
      Reported-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Milian Wolff <milian.wolff@kdab.com>
      Link: http://lkml.kernel.org/n/tip-lh2nh89rtqn5x5vbfthw6qml@git.kernel.org
      Fixes: 0c4a5bce ("perf annotate: Display total number of samples with --show-total-period")
      [ split from a larger patch ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      585d93c5
  4. 24 Jul, 2017 7 commits
  5. 23 Jul, 2017 8 commits
  6. 22 Jul, 2017 4 commits
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-linus-v4.13-rc2' of... · 4b162c53
      Linus Torvalds authored
      Merge tag 'hwmon-for-linus-v4.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fix from Guenter Roeck:
       "Avoid buffer overruns in applesmc driver"
      
      * tag 'hwmon-for-linus-v4.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (applesmc) Avoid buffer overruns
      4b162c53
    • Linus Torvalds's avatar
      Merge tag 'tty-4.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · ae75d1ae
      Linus Torvalds authored
      Pull tty/serial fixes from Greg KH:
       "Here are some small tty and serial driver fixes for 4.13-rc2. Nothing
        huge at all, a revert of a patch that turned out to break things, a
        fix up for a new tty ioctl we added in 4.13-rc1 to get the uapi
        definition correct, and a few minor serial driver fixes for reported
        issues.
      
        All of these have been in linux-next for a while with no reported
        issues"
      
      * tag 'tty-4.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        tty: Fix TIOCGPTPEER ioctl definition
        tty: hide unused pty_get_peer function
        tty: serial: lpuart: Fix the logic for detecting the 32-bit type UART
        serial: imx: Prevent TX buffer PIO write when a DMA has been started
        Revert "serial: imx-serial - move DMA buffer configuration to DT"
        serial: sh-sci: Uninitialized variables in sysfs files
        serial: st-asc: Potential error pointer dereference
      ae75d1ae
    • Linus Torvalds's avatar
      Merge tag 'char-misc-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · dedaff2f
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here are some small char and misc driver fixes for 4.13-rc2. All fix
        reported problems with 4.13-rc1 or older kernels (like the binder
        fixes). Full details in the shortlog.
      
        All have been in linux-next with no reported issues"
      
      * tag 'char-misc-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        w1: omap-hdq: fix error return code in omap_hdq_probe()
        regmap: regmap-w1: Fix build troubles
        w1: Fix slave count on 1-Wire bus (resend)
        mux: mux-core: unregister mux_class in mux_exit()
        mux: remove the Kconfig question for the subsystem
        nvmem: rockchip-efuse: amend compatible rk322x-efuse to rk3228-efuse
        drivers/fsi: fix fsi_slave_mode prototype
        fsi: core: register with postcore_initcall
        thunderbolt: Correct access permissions for active NVM contents
        vmbus: re-enable channel tasklet
        spmi: pmic-arb: Always allocate ppid_to_apid table
        MAINTAINERS: Add entry for SPMI subsystem
        spmi: Include OF based modalias in device uevent
        binder: Use wake up hint for synchronous transactions.
        binder: use group leader instead of open thread
        Revert "android: binder: Sanity check at binder ioctl"
      dedaff2f
    • Linus Torvalds's avatar
      Merge tag 'usb-4.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 55fd939e
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here are some small USB fixes for 4.13-rc2.
      
        The usual batch, gadget fixes for reported issues, as well as xhci
        fixes, and a small random collection of other fixes for reported
        issues.
      
        All have been in linux-next with no reported issues"
      
      * tag 'usb-4.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (25 commits)
        xhci: fix memleak in xhci_run()
        usb: xhci: fix spinlock recursion for USB2 test mode
        xhci: fix 20000ms port resume timeout
        usb: xhci: Issue stop EP command only when the EP state is running
        xhci: Bad Ethernet performance plugged in ASM1042A host
        xhci: Fix NULL pointer dereference when cleaning up streams for removed host
        usb: renesas_usbhs: gadget: disable all eps when the driver stops
        usb: renesas_usbhs: fix usbhsc_resume() for !USBHSF_RUNTIME_PWCTRL
        usb: gadget: udc: renesas_usb3: protect usb3_ep->started in usb3_start_pipen()
        usb: gadget: udc: renesas_usb3: fix zlp transfer by the dmac
        usb: gadget: udc: renesas_usb3: fix free size in renesas_usb3_dma_free_prd()
        usb: gadget: f_uac2: endianness fixes.
        usb: gadget: f_uac1: endianness fixes.
        include: usb: audio: specify exact endiannes of descriptors
        usb: gadget: udc: start_udc() can be static
        usb: dwc2: gadget: On USB RESET reset device address to zero
        usb: storage: return on error to avoid a null pointer dereference
        usb: typec: include linux/device.h in ucsi.h
        USB: cdc-acm: add device-id for quirky printer
        usb: dwc3: gadget: only unmap requests from DMA if mapped
        ...
      55fd939e