1. 20 Oct, 2015 2 commits
    • Adrian Hunter's avatar
      perf/x86: Fix time_shift in perf_event_mmap_page · b9511cd7
      Adrian Hunter authored
      Commit:
      
        b20112ed ("perf/x86: Improve accuracy of perf/sched clock")
      
      allowed the time_shift value in perf_event_mmap_page to be as much
      as 32.  Unfortunately the documented algorithms for using time_shift
      have it shifting an integer, whereas to work correctly with the value
      32, the type must be u64.
      
      In the case of perf tools, Intel PT decodes correctly but the timestamps
      that are output (for example by perf script) have lost 32-bits of
      granularity so they look like they are not changing at all.
      
      Fix by limiting the shift to 31 and adjusting the multiplier accordingly.
      
      Also update the documentation of perf_event_mmap_page so that new code
      based on it will be more future-proof.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Fixes: b20112ed ("perf/x86: Improve accuracy of perf/sched clock")
      Link: http://lkml.kernel.org/r/1445001845-13688-2-git-send-email-adrian.hunter@intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      b9511cd7
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · 40d4f23f
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes:
      
      User visible changes:
      
        - 'perf bench mem' now prefaults unconditionally, no sense in
          providing modes where page faults are measured. (Ingo Molnar)
      
        - Harmonize -l/--nr_loops accross 'perf bench'. (Ingo Molnar)
      
        - Various 'perf bench' consistency improvements. (Ingo Molnar)
      
        - Suppress libtraceevent warnings in non-verbose 'perf test' mode.
          (Namhyung Kim)
      
        - Move some tracepoint event test error messages to the verbose mode
          of 'perf test'. (Namhyung Kim)
      
        - Make 'perf help' usage message consistent with other tools. (Yunlong Song)
      
      Build fixes:
      
        - Fix 'perf bench' build with gcc 4.4.7. (Arnaldo Carvalho de Melo)
      
      Infrastructure changes:
      
        - 'perf stat' prep work for the 'perf stat scripting' patchkit. (Jiri Olsa)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      40d4f23f
  2. 19 Oct, 2015 23 commits
  3. 14 Oct, 2015 1 commit
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · e9363dee
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
      
      User visible changes:
      
        - Use the alternative with the most descriptive filename containing
          a vmlinux file for a given build-id, providing a better title line
          for tools such as 'annotate'. (Arnaldo Carvalho de Melo)
      
        - Remove help messages about previous right and left arrow keybidings, that
          were repurposed for horizontal scrolling. (Arnaldo Carvalho de Melo)
      
        - Inform how to reset the symbol filter in the hists browser. (top & report)
          (Arnaldo Carvalho de Melo)
      
        - Add 'm' key for context menu display in the hists browser, that became
          inacessible with the repurposing of the right arrow key for horizontal
          scrolling. (Namhyung Kim)
      
        - Use debug_frame for callchains if eh_frame is unusable. (Rabin Vicent)
      
      Build fixes:
      
        - Fix strict-aliasing breakage with gcc 4.4 in the READ_ONCE/WRITE_ONCE code
          adopted from the kernel tree, that builds with -fno-strict-aliasing while
          tools/perf/ uses -Wstrict-aliasing=3. (Jiri Olsa)
      
        - Fix unw_word_t pointer casts in code using libunwind for callchains,
          fixing the build in at least 32-bit MIPS systems. (Rabin Vicent)
      
        - Work around cross compile build problems related to fixdep. (Jiri Olsa)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      e9363dee
  4. 13 Oct, 2015 5 commits
  5. 12 Oct, 2015 3 commits
    • Arnaldo Carvalho de Melo's avatar
      perf hists browser: Inform how to reset the symbol filter · 4aa8e454
      Arnaldo Carvalho de Melo authored
      When in the hists browser, i.e. in 'perf report' or in 'perf top', it is
      possible to press '/' and specify a substring to filter by symbol name.
      
      Clarify how to remove a filter by making the prompt be:
      
         Please enter the name of symbol you want to see.
         To remove the filter later, press / + ENTER
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-vbq2b0kyufwy6p0ctkfswcoe@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4aa8e454
    • Arnaldo Carvalho de Melo's avatar
      perf ui browsers: Remove help messages about use of right and arrow keys · 7727a925
      Arnaldo Carvalho de Melo authored
      They were repurposed for horizontal scrolling, so use just ENTER/ESC in
      the help messages.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Fixes: c6c3c02d ("perf hists browser: Implement horizontal scrolling")
      Link: http://lkml.kernel.org/n/tip-n5ar4qg8fs12ax4vhr3rxhxj@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7727a925
    • Arnaldo Carvalho de Melo's avatar
      perf symbols: Try the .debug/ DSO cache as a last resort · dc38218e
      Arnaldo Carvalho de Melo authored
      Not as the first attempt at finding a vmlinux for the running kernel,
      this way we get a more informative filename to present in tools, it will
      check that the build-id is the same as the one previously loaded in the
      DSO in dso->build_id, reading from /sys/kernel/notes, for instance.
      
      E.g. in the annotation TUI, going from 'perf top', for the scsi_sg_alloc
      kernel function, in the first line:
      
      Before:
      
      scsi_sg_alloc  /root/.debug/.build-id/28/2777c262e6b3c0451375163c9a81c893218ab1
      
      After:
      
      scsi_sg_alloc  /lib/modules/4.3.0-rc1+/build/vmlinux
      
      And:
      
        # ls -la /root/.debug/.build-id/28/2777c262e6b3c0451375163c9a81c893218ab1
      lrwxrwxrwx. 1 root root 81 Sep 22 16:11 /root/.debug/.build-id/28/2777c262e6b3c0451375163c9a81c893218ab1 -> ../../home/git/build/v4.3.0-rc1+/vmlinux/282777c262e6b3c0451375163c9a81c893218ab1
        # file ~/.debug/home/git/build/v4.3.0-rc1+/vmlinux/282777c262e6b3c0451375163c9a81c893218ab1
      /root/.debug/home/git/build/v4.3.0-rc1+/vmlinux/282777c262e6b3c0451375163c9a81c893218ab1: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=282777c262e6b3c0451375163c9a81c893218ab1, not stripped
        #
      
      The same as:
      
        # file /lib/modules/4.3.0-rc1+/build/vmlinux
      /lib/modules/4.3.0-rc1+/build/vmlinux: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=282777c262e6b3c0451375163c9a81c893218ab1, not stripped
      
      Furthermore:
      
        # sha256sum /lib/modules/4.3.0-rc1+/build/vmlinux
        e7a789bbdc61029ec09140c228e1dd651271f38ef0b8416c0b7d5ff727b98be2  /lib/modules/4.3.0-rc1+/build/vmlinux
        # sha256sum ~/.debug/home/git/build/v4.3.0-rc1+/vmlinux/282777c262e6b3c0451375163c9a81c893218ab1
        e7a789bbdc61029ec09140c228e1dd651271f38ef0b8416c0b7d5ff727b98be2  /root/.debug/home/git/build/v4.3.0-rc1+/vmlinux/282777c262e6b3c0451375163c9a81c893218ab1
        [root@zoo new]#
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-9y42ikzq3jisiddoi6f07n8z@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      dc38218e
  6. 08 Oct, 2015 2 commits
  7. 07 Oct, 2015 4 commits
    • Arnaldo Carvalho de Melo's avatar
      perf python: Support the PERF_RECORD_SWITCH event · ae938802
      Arnaldo Carvalho de Melo authored
      To test it check tools/perf/python/twatch.py, after following the
      instructions there to enable context_switch, output looks like:
      
        [root@zoo linux]# tools/perf/python/twatch.py
        cpu: 1, pid: 31463, tid: 31463 { type: context_switch, next_prev_pid: 31463, next_prev_tid: 31463, switch_out: 0 }
        cpu: 2, pid: 31463, tid: 31496 { type: context_switch, next_prev_pid: 31463, next_prev_tid: 31496, switch_out: 0 }
        cpu: 2, pid: 31463, tid: 31496 { type: context_switch, next_prev_pid: 31463, next_prev_tid: 31496, switch_out: 1 }
        cpu: 3, pid: 31463, tid: 31527 { type: context_switch, next_prev_pid: 31463, next_prev_tid: 31527, switch_out: 0 }
        cpu: 1, pid: 31463, tid: 31463 { type: context_switch, next_prev_pid: 31463, next_prev_tid: 31463, switch_out: 1 }
        cpu: 3, pid: 31463, tid: 31527 { type: context_switch, next_prev_pid: 31463, next_prev_tid: 31527, switch_out: 1 }
        cpu: 1, pid: 31463, tid: 31463 { type: context_switch, next_prev_pid: 31463, next_prev_tid: 31463, switch_out: 0 }
        ^CTraceback (most recent call last):
          File "tools/perf/python/twatch.py", line 67, in <module>
            main(context_switch = 1, thread = 31463)
          File "tools/perf/python/twatch.py", line 40, in main
            evlist.poll(timeout = -1)
        KeyboardInterrupt
        [root@zoo linux]#
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Guy Streeter <streeter@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-1ukistmpamc5z717k80ctcp2@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ae938802
    • Ingo Molnar's avatar
      Merge tag 'perf-urgent-for-mingo' of... · 00e6fa5f
      Ingo Molnar authored
      Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
      
      Pull perf/urgent fix from Arnaldo Carvalho de Melo:
      
        - Fix build break on (at least) powerpc due to sample_reg_masks, not being
          available for linking. (Sukadev Bhattiprolu)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      00e6fa5f
    • Sukadev Bhattiprolu's avatar
      perf tools: Fix build break on powerpc due to sample_reg_masks · 9fb47654
      Sukadev Bhattiprolu authored
      perf_regs.c does not get built on Powerpc as CONFIG_PERF_REGS is false.
      So the weak definition for 'sample_regs_masks' doesn't get picked up.
      
      Adding perf_regs.o to util/Build unconditionally, exposes a redefinition
      error for 'perf_reg_value()' function (due to the static inline version
      in util/perf_regs.h). So use #ifdef HAVE_PERF_REGS_SUPPORT' around that
      function.
      Signed-off-by: default avatarSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: linuxppc-dev@ozlabs.org
      Link: http://lkml.kernel.org/r/20150930182836.GA27858@us.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9fb47654
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-4.3-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · a0eeb8dd
      Linus Torvalds authored
      Pull NFS client bugfixes from Trond Myklebust:
       "Highlights include:
      
        Bugfixes:
         - Fix a use-after-free bug in the RPC/RDMA client
         - Fix a write performance regression
         - Fix up page writeback accounting
         - Don't try to reclaim unused state owners
         - Fix a NFSv4 nograce recovery hang
         - reset states to use open_stateid when returning delegation
           voluntarily
         - Fix a tracepoint NULL-pointer dereference"
      
      * tag 'nfs-for-4.3-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
        NFS: Fix a tracepoint NULL-pointer dereference
        nfs4: reset states to use open_stateid when returning delegation voluntarily
        NFSv4: Fix a nograce recovery hang
        NFSv4.1: nfs4_opendata_check_deleg needs to handle NFS4_OPEN_CLAIM_DELEG_CUR_FH
        NFSv4: Don't try to reclaim unused state owners
        NFS: Fix a write performance regression
        NFS: Fix up page writeback accounting
        xprtrdma: disconnect and flush cqs before freeing buffers
      a0eeb8dd