1. 25 Sep, 2013 4 commits
  2. 24 Sep, 2013 2 commits
  3. 23 Sep, 2013 1 commit
  4. 20 Sep, 2013 4 commits
    • Peter Zijlstra's avatar
      perf: Fix capabilities bitfield compatibility in 'struct perf_event_mmap_page' · fa731587
      Peter Zijlstra authored
      Solve the problems around the broken definition of perf_event_mmap_page::
      cap_usr_time and cap_usr_rdpmc fields which used to overlap, partially
      fixed by:
      
        860f085b ("perf: Fix broken union in 'struct perf_event_mmap_page'")
      
      The problem with the fix (merged in v3.12-rc1 and not yet released
      officially), noticed by Vince Weaver is that the new behavior is
      not detectable by new user-space, and that due to the reuse of the
      field names it's easy to mis-compile a binary if old headers are used
      on a new kernel or new headers are used on an old kernel.
      
      To solve all that make this change explicit, detectable and self-contained,
      by iterating the ABI the following way:
      
       - Always clear bit 0, and rename it to usrpage->cap_bit0, to at least not
         confuse old user-space binaries. RDPMC will be marked as unavailable
         to old binaries but that's within the ABI, this is a capability bit.
      
       - Rename bit 1 to ->cap_bit0_is_deprecated and always set it to 1, so new
         libraries can reliably detect that bit 0 is deprecated and perma-zero
         without having to check the kernel version.
      
       - Use bits 2, 3, 4 for the newly defined, correct functionality:
      
      	cap_user_rdpmc		: 1, /* The RDPMC instruction can be used to read counts */
      	cap_user_time		: 1, /* The time_* fields are used */
      	cap_user_time_zero	: 1, /* The time_zero field is used */
      
       - Rename all the bitfield names in perf_event.h to be different from the
         old names, to make sure it's not possible to mis-compile it
         accidentally with old assumptions.
      
      The 'size' field can then be used in the future to add new fields and it
      will act as a natural ABI version indicator as well.
      
      Also adjust tools/perf/ userspace for the new definitions, noticed by
      Adrian Hunter.
      Reported-by: default avatarVince Weaver <vincent.weaver@maine.edu>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Also-Fixed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Link: http://lkml.kernel.org/n/tip-zr03yxjrpXesOzzupszqglbv@git.kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      fa731587
    • Yan, Zheng's avatar
      perf/x86/intel/uncore: Don't use smp_processor_id() in validate_group() · 73c4427c
      Yan, Zheng authored
      uncore_validate_group() can't call smp_processor_id() because it is
      in preemptible context. Pass NUMA_NO_NODE to the allocator instead.
      Signed-off-by: default avatarYan, Zheng <zheng.z.yan@intel.com>
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1379400493-11505-1-git-send-email-zheng.z.yan@intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      73c4427c
    • Peter Zijlstra's avatar
      perf: Update ABI comment · c5ecceef
      Peter Zijlstra authored
      For some mysterious reason the sample_id field of PERF_RECORD_MMAP went AWOL.
      Reported-by: default avatarVince Weaver <vince@deater.net>
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      c5ecceef
    • Ingo Molnar's avatar
      Merge tag 'perf-urgent-for-mingo' of... · 24e31f0b
      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 fixes from Arnaldo Carvalho de Melo:
      
       * Check for SIGINT in more loops, allowing tools such as 'perf report' to
         react faster to Ctrl+C, from Arnaldo Carvalho de Melo.
      
       * Fix objdump line parsing offset validation in the annotate code,
         from Adrian Hunter.
      
       * Fix buildid cache handling of kallsyms with kcore, from Adrian Hunter.
      
       * Fix compile with libelf without get_phdrnum, from Adrian Hunter.
      
       * Sharpen the libaudit dependencies test, refusing to build with older
         libraries that doesn't have all the functions used by 'perf trace", fix
         from Ingo Molnar.
      
       * Fill in new definitions for madvise()/mmap() flags to fix the build in
         older systems, from Ingo Molnar.
      
       * Fix old GCC build error in older systems in the kallsyms parsing code in
         trace-event-parse.c, from Ingo Molnar.
      
       * Ignore DWARF declaration tags, allowing, for instance, that the
      
           $ perf probe -L getname
      
         command succeeds in showing the source code for the 'getname' kernel
         function, telling in which lines probes can be inserted, fix from
         Masami Hiramatsu.
      
       * Fix linux/magic.h related build breakage in some systems, fix from
         Vinson Lee.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      24e31f0b
  5. 19 Sep, 2013 9 commits
    • Vinson Lee's avatar
      tools lib lk: Uninclude linux/magic.h in debugfs.c · ce7eebe5
      Vinson Lee authored
      The compilation only looks for linux/magic.h from the default include
      paths, which does not include the source tree. This results in a build
      error if linux/magic.h is not available or not installed.
      
      For example, this build error occurs on CentOS 5.
      
      $ make -C tools/lib/lk V=1
      [...]
      gcc -o debugfs.o -c -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6
      -D_FORTIFY_SOURCE=2 -Wbad-function-cast -Wdeclaration-after-statement
      -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations
      -Wmissing-prototypes -Wnested-externs -Wno-system-headers
      -Wold-style-definition -Wpacked -Wredundant-decls -Wshadow
      -Wstrict-aliasing=3 -Wstrict-prototypes -Wswitch-default -Wswitch-enum
      -Wundef -Wwrite-strings -Wformat  -fPIC  -D_LARGEFILE64_SOURCE
      -D_FILE_OFFSET_BITS=64 debugfs.c
      debugfs.c:8:25: error: linux/magic.h: No such file or directory
      
      The only symbol from linux/magic.h needed by debugfs.c is DEBUGFS_MAGIC,
      and that is already defined in debugfs.h. linux/magic.h isn't providing
      any extra symbols and can unincluded. This is similar to the approach by
      perf, which has its own magic.h wrapper at
      tools/perf/util/include/linux/magic.h
      Signed-off-by: default avatarVinson Lee <vlee@twitter.com>
      Acked-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Vinson Lee <vlee@freedesktop.org>
      Cc: stable@vger.kernel.org
      Link: http://lkml.kernel.org/r/1379546200-17028-1-git-send-email-vlee@freedesktop.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ce7eebe5
    • Ingo Molnar's avatar
      perf tools: Fix old GCC build error in trace-event-parse.c:parse_proc_kallsyms() · 0f965429
      Ingo Molnar authored
      Old GCC (4.1) does not see through the code flow of parse_proc_kallsyms()
      and gets confused about the status of 'fmt':
      
       util/trace-event-parse.c: In function ‘parse_proc_kallsyms’:
       util/trace-event-parse.c:189: warning: ‘fmt’ may be used uninitialized in this function
       make: *** [util/trace-event-parse.o] Error 1
      
      Help out GCC by initializing 'fmt' to NULL.
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: H. Peter Anvin <hpa@zytor.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>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20130912131649.GC23826@gmail.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0f965429
    • Masami Hiramatsu's avatar
      perf probe: Fix finder to find lines of given function · 0dbb1cac
      Masami Hiramatsu authored
      The commit ba28c59b fixed a declaration
      entry bug in probe_point_search_cb().  There are same bugs in line
      finder and call_probe_finder().  This introduces a new dwarf utility
      function to determine given DIE is a function definition, not
      declaration.
      Signed-off-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Prashanth Nageshappa <prashanth@linux.vnet.ibm.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: yrl.pp-manager.tt@hitachi.com
      Link: http://lkml.kernel.org/r/20120423032435.8737.80064.stgit@localhost.localdomainSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0dbb1cac
    • Arnaldo Carvalho de Melo's avatar
      perf session: Check for SIGINT in more loops · 33e940a2
      Arnaldo Carvalho de Melo authored
      When processing big files we were not checking if session_done was set
      by the SIGINT signal handler, for instance in 'perf report'. Fix it.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      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: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-pyad42lgrtq7xhg2dpsoauq7@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      33e940a2
    • Adrian Hunter's avatar
      perf tools: Fix compile with libelf without get_phdrnum · e955d5c4
      Adrian Hunter authored
      Add a feature check for get_phdrnum() and implement a replacement if it
      is not present.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      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/r/1379080170-6608-1-git-send-email-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e955d5c4
    • Adrian Hunter's avatar
      perf tools: Fix buildid cache handling of kallsyms with kcore · 5b6a42fc
      Adrian Hunter authored
      When kallsyms is used with kcore the dso long_name becomes the kcore
      file name.  That prevents the buildid cache from caching kallsyms.
      (There is no support at present for caching kcore).  Fix by changing it
      so that the kallsyms name is used in that case instead.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      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/r/1379009959-28046-1-git-send-email-adrian.hunter@intel.com
      [ Kept 'struct foo' pointer as first parameter of foo__ prefixed functions ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5b6a42fc
    • Adrian Hunter's avatar
      perf annotate: Fix objdump line parsing offset validation · 886b37ba
      Adrian Hunter authored
      When parsing lines from objdump a line containing source code starting
      with a numeric label is mistaken for a line of disassembly starting with
      a memory address.
      
      Current validation fails to recognise that the "memory address" is out
      of range and calculates an invalid offset which later causes this
      segfault:
      
      Program received signal SIGSEGV, Segmentation fault.
      0x0000000000457315 in disasm__calc_percent (notes=0xc98970, evidx=0, offset=143705, end=2127526177, path=0x7fffffffbf50)
          at util/annotate.c:631
      631				hits += h->addr[offset++];
      (gdb) bt
       #0  0x0000000000457315 in disasm__calc_percent (notes=0xc98970, evidx=0, offset=143705, end=2127526177, path=0x7fffffffbf50)
          at util/annotate.c:631
       #1  0x00000000004d65e3 in annotate_browser__calc_percent (browser=0x7fffffffd130, evsel=0xa01da0) at ui/browsers/annotate.c:364
       #2  0x00000000004d7433 in annotate_browser__run (browser=0x7fffffffd130, evsel=0xa01da0, hbt=0x0) at ui/browsers/annotate.c:672
       #3  0x00000000004d80c9 in symbol__tui_annotate (sym=0xc989a0, map=0xa02660, evsel=0xa01da0, hbt=0x0) at ui/browsers/annotate.c:962
       #4  0x00000000004d7aa0 in hist_entry__tui_annotate (he=0xdf73f0, evsel=0xa01da0, hbt=0x0) at ui/browsers/annotate.c:823
       #5  0x00000000004dd648 in perf_evsel__hists_browse (evsel=0xa01da0, nr_events=1, helpline=
          0x58b768 "For a higher level overview, try: perf report --sort comm,dso", ev_name=0xa02cd0 "cycles", left_exits=false, hbt=
          0x0, min_pcnt=0, env=0xa011e0) at ui/browsers/hists.c:1659
       #6  0x00000000004de372 in perf_evlist__tui_browse_hists (evlist=0xa01520, help=
          0x58b768 "For a higher level overview, try: perf report --sort comm,dso", hbt=0x0, min_pcnt=0, env=0xa011e0)
          at ui/browsers/hists.c:1950
       #7  0x000000000042cf6b in __cmd_report (rep=0x7fffffffd6c0) at builtin-report.c:581
       #8  0x000000000042e25d in cmd_report (argc=0, argv=0x7fffffffe4b0, prefix=0x0) at builtin-report.c:965
       #9  0x000000000041a0e1 in run_builtin (p=0x801548, argc=1, argv=0x7fffffffe4b0) at perf.c:319
       #10 0x000000000041a319 in handle_internal_command (argc=1, argv=0x7fffffffe4b0) at perf.c:376
       #11 0x000000000041a465 in run_argv (argcp=0x7fffffffe38c, argv=0x7fffffffe380) at perf.c:420
       #12 0x000000000041a707 in main (argc=1, argv=0x7fffffffe4b0) at perf.c:521
      
      After the fix is applied the symbol can be annotated showing the
      problematic line "1:      rep"
      
      copy_user_generic_string  /usr/lib/debug/lib/modules/3.9.10-100.fc17.x86_64/vmlinux
                   */
                  ENTRY(copy_user_generic_string)
                          CFI_STARTPROC
                          ASM_STAC
                          andl %edx,%edx
                    and    %edx,%edx
                          jz 4f
                    je     37
                          cmpl $8,%edx
                    cmp    $0x8,%edx
                          jb 2f           /* less than 8 bytes, go to byte copy loop */
                    jb     33
                          ALIGN_DESTINATION
                    mov    %edi,%ecx
                    and    $0x7,%ecx
                    je     28
                    sub    $0x8,%ecx
                    neg    %ecx
                    sub    %ecx,%edx
              1a:   mov    (%rsi),%al
                    mov    %al,(%rdi)
                    inc    %rsi
                    inc    %rdi
                    dec    %ecx
                    jne    1a
                          movl %edx,%ecx
              28:   mov    %edx,%ecx
                          shrl $3,%ecx
                    shr    $0x3,%ecx
                          andl $7,%edx
                    and    $0x7,%edx
                  1:      rep
      100.00        rep    movsq %ds:(%rsi),%es:(%rdi)
                          movsq
                  2:      movl %edx,%ecx
              33:   mov    %edx,%ecx
                  3:      rep
                    rep    movsb %ds:(%rsi),%es:(%rdi)
                          movsb
                  4:      xorl %eax,%eax
              37:   xor    %eax,%eax
                    data32 xchg %ax,%ax
                          ASM_CLAC
                          ret
                    retq
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      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/r/1379009721-27667-1-git-send-email-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      886b37ba
    • Ingo Molnar's avatar
      perf tools: Fill in new definitions for madvise()/mmap() flags · 456857bd
      Ingo Molnar authored
      builtin-trace.c started using various new syscall features not defined
      in the header files of older distros - resulting in build failures.
      
      Fill in the (ABI) constants if they are not defined.
      
      (There might be a better place to put this than builtin-trace.c, into a
      compat header or so.)
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-tip-commits@vger.kernel.org
      Link: http://lkml.kernel.org/r/20130912132900.GE23826@gmail.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      456857bd
    • Ingo Molnar's avatar
      perf tools: Sharpen the libaudit dependencies test · 33cbbdcc
      Ingo Molnar authored
      There are older libaudit versions that don't have an
      audit_errno_to_name() method, resulting in a builtin-trace.c build
      error:
      
        builtin-trace.c: In function ‘trace__sys_exit’:
        builtin-trace.c:794: warning: implicit declaration of function ‘audit_errno_to_name’
      
      Expand the libaudit test to detect this.
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20130912132706.GD23826@gmail.com
      [ Fix the test by escaping the double quotes ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      33cbbdcc
  6. 18 Sep, 2013 5 commits
  7. 17 Sep, 2013 6 commits
  8. 16 Sep, 2013 9 commits