1. 23 Aug, 2016 36 commits
  2. 18 Aug, 2016 4 commits
    • Ingo Molnar's avatar
      Merge tag 'perf-urgent-for-mingo-20160818' of... · de737f33
      Ingo Molnar authored
      Merge tag 'perf-urgent-for-mingo-20160818' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
      
      Pull perf/urgent fixes from Arnaldo Carvalho de Melo:
      
      - Do not access outside hw cache name arrays (Arnaldo Carvalho de Melo)
      
      - Use addr_location::addr instead of ip for entries when unwinding using
        DWARF CFI, fixing the "srcline" information for userspace application
        callchains (Milian Wolff)
      
      - Reinstate strlcpy() header guard with __UCLIBC__, fixing the build
        with uclibc, detected when building for the ARC architecture (Vineet Gupta)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      de737f33
    • Arnaldo Carvalho de Melo's avatar
      perf evsel: Do not access outside hw cache name arrays · c53412ee
      Arnaldo Carvalho de Melo authored
      We have to check if the values are >= *_MAX, not just >, fix it.
      
      From the bugzilla report:
      
      ''In file /tools/perf/util/evsel.c  function __perf_evsel__hw_cache_name
      it appears that there is a bug that reads beyond the end of the buffer.
      The statement "if (type > PERF_COUNT_HW_CACHE_MAX)" allows type to be
      equal to the maximum value. Later, when statement "if
      (!perf_evsel__is_cache_op_valid(type, op))" is executed, the function
      can access array perf_evsel__hw_cache_stat[type] beyond the end of the
      buffer.
      
      It appears to me that the statement "if (type > PERF_COUNT_HW_CACHE_MAX)"
      should be "if (type >= PERF_COUNT_HW_CACHE_MAX)"
      
      Bug found with Coverity and manual code review. No attempts were made to
      execute the code with a maximum type value.''
      
      Committer note:
      
      Testing it:
      
        $ perf record -e $(echo $(perf list cache | cut -d \[ -f1) | sed 's/ /,/g') usleep 1
        [ perf record: Woken up 16 times to write data ]
        [ perf record: Captured and wrote 0.023 MB perf.data (34 samples) ]
        $ perf evlist
        L1-dcache-load-misses
        L1-dcache-loads
        L1-dcache-stores
        L1-icache-load-misses
        LLC-load-misses
        LLC-loads
        LLC-store-misses
        LLC-stores
        branch-load-misses
        branch-loads
        dTLB-load-misses
        dTLB-loads
        dTLB-store-misses
        dTLB-stores
        iTLB-load-misses
        iTLB-loads
        node-load-misses
        node-loads
        node-store-misses
        node-stores
        $ perf list cache
      
        List of pre-defined events (to be used in -e):
      
          L1-dcache-load-misses        [Hardware cache event]
          L1-dcache-loads              [Hardware cache event]
          L1-dcache-stores             [Hardware cache event]
          L1-icache-load-misses        [Hardware cache event]
          LLC-load-misses              [Hardware cache event]
          LLC-loads                    [Hardware cache event]
          LLC-store-misses             [Hardware cache event]
          LLC-stores                   [Hardware cache event]
          branch-load-misses           [Hardware cache event]
          branch-loads                 [Hardware cache event]
          dTLB-load-misses             [Hardware cache event]
          dTLB-loads                   [Hardware cache event]
          dTLB-store-misses            [Hardware cache event]
          dTLB-stores                  [Hardware cache event]
          iTLB-load-misses             [Hardware cache event]
          iTLB-loads                   [Hardware cache event]
          node-load-misses             [Hardware cache event]
          node-loads                   [Hardware cache event]
          node-store-misses            [Hardware cache event]
          node-stores                  [Hardware cache event]
        $
      Reported-by: default avatarBrian Sweeney <bsweeney@lgsinnovations.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=153351Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c53412ee
    • Vineet Gupta's avatar
      tools lib: Reinstate strlcpy() header guard with __UCLIBC__ · 0215d59b
      Vineet Gupta authored
      perf tools build in recent kernels spews splat when cross compiling with uClibc:
      
      |   CC       util/alias.o
      | In file included from tools/perf/util/../ui/../util/cache.h:8:0,
      |                 from tools/perf/util/../ui/helpline.h:7,
      |                 from tools/perf/util/debug.h:8,
      |                 from arch/../util/cpumap.h:9,
      |                 from arch/../util/env.h:5,
      |                 from arch/common.h:4,
      |                 from arch/common.c:3:
      | tools/include/linux/string.h:12:15: warning: redundant redeclaration of ‘strlcpy’ [-Wredundant-decls]
      |  extern size_t strlcpy(char *dest, const char *src, size_t size);
                     ^
      This is after commit 61a6445e ("tools lib: Guard the strlcpy() header with
      __GLIBC__").
      
      The problem is uClibc also defines __GLIBC__ for exported headers for
      applications. So add that specific check to not trip for uClibc.
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Petri Gynther <pgynther@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Cc: linux-snps-arc@lists.infradead.org
      Link: http://lkml.kernel.org/r/1471537703-16439-1-git-send-email-vgupta@synopsys.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0215d59b
    • Jiri Olsa's avatar
      perf/x86: Fix PEBS threshold initialization · b6a32f02
      Jiri Olsa authored
      Latest PEBS rework change could skip initialization
      of the ds->pebs_interrupt_threshold for single event
      PEBS threshold events.
      
      Make sure the PEBS threshold gets always initialized.
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Fixes: 09e61b4f ("perf/x86/intel: Rework the large PEBS setup code")
      Link: http://lkml.kernel.org/r/1471511392-29875-1-git-send-email-jolsa@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      b6a32f02