1. 11 Sep, 2012 8 commits
    • Jiri Olsa's avatar
      perf symbols: Make dsos__find function globally available · 1c4be9ff
      Jiri Olsa authored
      Changing dsos__find function from static to be globally available.
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1347295819-23177-4-git-send-email-jolsa@redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1c4be9ff
    • Jiri Olsa's avatar
      perf tools: Add memdup function · b232e073
      Jiri Olsa authored
      Adding memdup function to duplicate region of memory.
      
        void *memdup(const void *src, size_t len)
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1347295819-23177-3-git-send-email-jolsa@redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b232e073
    • Jiri Olsa's avatar
      perf tools: Do backtrace post unwind only if we regs and stack were captured · bdde3716
      Jiri Olsa authored
      Bail out without error if we want to do backtrace post unwind, but were
      not able to capture user registers or user stack during the record
      phase, which is possible and valid case.
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1347295819-23177-2-git-send-email-jolsa@redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      bdde3716
    • Irina Tirdea's avatar
      perf tools: fix ALIGN redefinition in system headers · 9ac3e487
      Irina Tirdea authored
      On some systems (e.g. Android), ALIGN is defined in system headers as
      ALIGN(p).  The definition of ALIGN used in perf takes 2 parameters:
      ALIGN(x,a).  This leads to redefinition conflicts.
      
      Redefinition error on Android:
      In file included from util/include/linux/list.h:1:0,
      from util/callchain.h:5,
      from util/hist.h:6,
      from util/session.h:4,
      from util/build-id.h:4,
      from util/annotate.c:11:
      util/include/linux/kernel.h:11:0: error: "ALIGN" redefined [-Werror]
      bionic/libc/include/sys/param.h:38:0: note: this is the location of
      the previous definition
      
      Conflics with system defined ALIGN in Android:
      util/event.c: In function 'perf_event__synthesize_comm':
      util/event.c:115:32: error: macro "ALIGN" passed 2 arguments, but takes just 1
      util/event.c:115:9: error: 'ALIGN' undeclared (first use in this function)
      util/event.c:115:9: note: each undeclared identifier is reported only once for
      each function it appears in
      
      In order to avoid this redefinition, ALIGN is renamed to PERF_ALIGN.
      Signed-off-by: default avatarIrina Tirdea <irina.tirdea@intel.com>
      Acked-by: default avatarPekka Enberg <penberg@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Irina Tirdea <irina.tirdea@intel.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1347315303-29906-5-git-send-email-irina.tirdea@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9ac3e487
    • Irina Tirdea's avatar
      perf tools: include __WORDSIZE definition · 3f34f6c0
      Irina Tirdea authored
      __WORDSIZE is GLibC-specific and is not defined on all systems or glibc
      versions (e.g. Android's bionic does not define it).
      
      In file included from util/include/linux/bitmap.h:5:0,
                       from util/header.h:10,
                       from util/session.h:6,
                       from util/build-id.h:4,
                       from util/annotate.c:11:
      util/include/linux/bitops.h: In function 'set_bit':
      util/include/linux/bitops.h:25:12: error:
      '__WORDSIZE' undeclared (first use in this function)
      util/include/linux/bitops.h:25:12: note:
      each undeclared identifier is reported only once for each function it appears in
      util/include/linux/bitops.h:23:51: error:
      parameter 'addr' set but not used [-Werror=unused-but-set-parameter]
      util/include/linux/bitops.h: In function 'clear_bit':
      util/include/linux/bitops.h:30:12: error:
      '__WORDSIZE' undeclared (first use in this function)
      util/include/linux/bitops.h:28:53: error:
      parameter 'addr' set but not used [-Werror=unused-but-set-parameter]
      In file included from util/header.h:10:0,
                       from util/session.h:6,
                       from util/build-id.h:4,
                       from util/annotate.c:11:
      util/include/linux/bitmap.h: In function 'bitmap_zero':
      util/include/linux/bitmap.h:22:6: error:
      '__WORDSIZE' undeclared (first use in this function)
      
      Defining __WORDSIZE in perf's headers if it is not already defined.
      Suggested-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Suggested-by: default avatarPekka Enberg <penberg@kernel.org>
      Signed-off-by: default avatarIrina Tirdea <irina.tirdea@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Irina Tirdea <irina.tirdea@intel.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1347315303-29906-4-git-send-email-irina.tirdea@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3f34f6c0
    • Irina Tirdea's avatar
      perf tools: Update types definitions for Android · 86d5a70c
      Irina Tirdea authored
      Some type definitions are missing from Android or are already defined in
      bionic and lead to redefinition errors.
      
      Android defines in types.h __le32. Since perf is wrapping <linux/types.h> with a
      local version, we need to define this constant in the local version too.
      Error in Android:
      In file included from bionic/libc/include/unistd.h:36:0,
                       from external/perf/tools/perf/util/util.h:46,
                       from external/perf/tools/perf/util/cache.h:5,
                       from external/perf/tools/perf/util/abspath.c:1:
      bionic/libc/kernel/common/linux/capability.h:60:2:
      error: unknown type name '__le32'
      
      roundup() definition is missing:
      util/symbol.c: In function 'symbols__fixup_end':
      util/symbol.c:106: warning: implicit declaration of function 'roundup'
      util/symbol.c:106: warning: nested extern declaration of 'roundup'
      
      __force macro defined in perf is also defined in libc which leads to
      redefinition errors. In order to avoid these, we guard these definition
      with
      Signed-off-by: default avatarIrina Tirdea <irina.tirdea@intel.com>
      Acked-by: default avatarPekka Enberg <penberg@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Irina Tirdea <irina.tirdea@intel.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1347315303-29906-3-git-send-email-irina.tirdea@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      86d5a70c
    • Arnaldo Carvalho de Melo's avatar
      perf tools: Add missing perf_regs.h file to MANIFEST · fe392c53
      Arnaldo Carvalho de Melo authored
      The 2bcd355b broke the perf-tar*-src-pkg generated tarballs builds, fix
      it.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-2ndz2o636rn4q175fwn18x32@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      fe392c53
    • Irina Tirdea's avatar
      perf tools: include wrapper for magic.h · f8fcd776
      Irina Tirdea authored
      perf is currently including magic.h directly from the kernel. If the
      glibc magic.h is also included, this leads to warnings that the
      constants are redefined. This happens on some systems (e.g. Android).
      
      Redefinition errors on Android:
      In file included from util/util.h:79:0,
                       from util/cache.h:5,
                       from util/abspath.c:1:
      util/../../../include/linux/magic.h:5:0:
      error: "AFFS_SUPER_MAGIC" redefined [-Werror]
      bionic/libc/include/sys/vfs.h:53:0:
      note: this is the location of the previous definition
      util/../../../include/linux/magic.h:19:0:
      error: "EFS_SUPER_MAGIC" redefined [-Werror]
      bionic/libc/include/sys/vfs.h:61:0:
      note: this is the location of the previous definition
      util/../../../include/linux/magic.h:26:0:
      error: "HPFS_SUPER_MAGIC" redefined [-Werror]
      bionic/libc/include/sys/vfs.h:67:0:
      note: this is the location of the previous definition
      
      Only two constants from magic.h are used by perf (DEBUGFS_MAGIC and
      SYSFS_MAGIC). This fix provides a wrapper for magic.h that includes only
      these constants instead of including the kernel header file directly.
      Signed-off-by: default avatarIrina Tirdea <irina.tirdea@intel.com>
      Acked-by: default avatarPekka Enberg <penberg@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Irina Tirdea <irina.tirdea@intel.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1347315303-29906-2-git-send-email-irina.tirdea@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f8fcd776
  2. 09 Sep, 2012 4 commits
  3. 08 Sep, 2012 19 commits
  4. 07 Sep, 2012 5 commits
  5. 06 Sep, 2012 4 commits
    • Jiri Olsa's avatar
      perf tools: Fix cache event name generation · 275ef387
      Jiri Olsa authored
      If the event name is specified with all 3 components, the last one
      overwrites the previous one during the name composing within the
      parse_events_add_cache function.
      
      Fixing this by properly adjusting the string index.
      Reported-by: default avatarJoel Uckelman <joel@lightboxtechnologies.com>
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Joel Uckelman <joel@lightboxtechnologies.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LPU-Reference: 20120905175133.GA18352@krava.brq.redhat.com
      [ committer note: Remove the newline fix, done already in 42e1fb77 ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      275ef387
    • Arnaldo Carvalho de Melo's avatar
      perf test: Add roundtrip test for hardware cache events · 49f20d72
      Arnaldo Carvalho de Melo authored
      That nicely catches the problem reported by Joel Uckelman in
      http://permalink.gmane.org/gmane.linux.kernel.perf.user/1016 :
      
        [root@sandy ~]# perf test
         1: vmlinux symtab matches kallsyms: Ok
         2: detect open syscall event: Ok
         3: detect open syscall event on all cpus: Ok
         4: read samples using the mmap interface: Ok
         5: parse events tests: Ok
         6: x86 rdpmc test: Ok
         7: Validate PERF_RECORD_* events & perf_sample fields: Ok
         8: Test perf pmu format parsing: Ok
         9: Test dso data interface: Ok
        10: roundtrip evsel->name check: FAILED!
      
        [root@sandy ~]# perf test -v 10
        10: roundtrip evsel->name check:
        --- start ---
        L1-dcache-misses != L1-dcache-load-misses
        L1-dcache-misses != L1-dcache-store-misses
        L1-dcache-misses != L1-dcache-prefetch-misses
        L1-icache-misses != L1-icache-load-misses
        L1-icache-misses != L1-icache-prefetch-misses
        LLC-misses != LLC-load-misses
        LLC-misses != LLC-store-misses
        LLC-misses != LLC-prefetch-misses
        dTLB-misses != dTLB-load-misses
        dTLB-misses != dTLB-store-misses
        dTLB-misses != dTLB-prefetch-misses
        iTLB-misses != iTLB-load-misses
        branch-misses != branch-load-misses
        node-misses != node-load-misses
        node-misses != node-store-misses
        node-misses != node-prefetch-misses
        ---- end ----
        roundtrip evsel->name check: FAILED!
      
        [root@sandy ~]#
      
      Now lemme apply Jiri's fix and try it again...
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Joel Uckelman <joel@lightboxtechnologies.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-bbewtxw0rfipp5qy1j3jtg5d@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      49f20d72
    • Arnaldo Carvalho de Melo's avatar
      perf evlist: Add fprintf method · 78f067b3
      Arnaldo Carvalho de Melo authored
      For debugging, etc.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-fjimge1ovgh976qlt8dtmlp0@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      78f067b3
    • Arnaldo Carvalho de Melo's avatar
      perf tools: Remove extraneous newline when parsing hardware cache events · 42e1fb77
      Arnaldo Carvalho de Melo authored
      Noticed while developing a 'perf test' entry to verify that
      perf_evsel__name works.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-xz6zgh38mp3cjnd2udh38z8f@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      42e1fb77