1. 03 6月, 2011 3 次提交
    • D
      perf stat: clarify unsupported events from uncounted events · 2cee77c4
      David Ahern 提交于
      perf stat continues running even if the event list contains counters
      that are not supported. The resulting output then contains <not counted>
      for those events which gets confusing as to which events are supported,
      but not counted and which are not supported.
      
      Before:
      
      perf stat -ddd -- sleep 1
      
            Performance counter stats for 'sleep 1':
      
                0.571283 task-clock                #    0.001 CPUs utilized
                       1 context-switches          #    0.002 M/sec
                       0 CPU-migrations            #    0.000 M/sec
                     157 page-faults               #    0.275 M/sec
               1,037,707 cycles                    #    1.816 GHz
           <not counted> stalled-cycles-frontend
           <not counted> stalled-cycles-backend
                 654,499 instructions              #    0.63  insns per cycle
                 136,129 branches                  #  238.286 M/sec
           <not counted> branch-misses
           <not counted> L1-dcache-loads
           <not counted> L1-dcache-load-misses
           <not counted> LLC-loads
           <not counted> LLC-load-misses
           <not counted> L1-icache-loads
           <not counted> L1-icache-load-misses
           <not counted> dTLB-loads
           <not counted> dTLB-load-misses
           <not counted> iTLB-loads
           <not counted> iTLB-load-misses
           <not counted> L1-dcache-prefetches
           <not counted> L1-dcache-prefetch-misses
      
             1.001004836 seconds time elapsed
      
      After:
      
      perf stat -ddd -- sleep 1
      
       Performance counter stats for 'sleep 1':
      
                1.350326 task-clock                #    0.001 CPUs utilized
                       2 context-switches          #    0.001 M/sec
                       0 CPU-migrations            #    0.000 M/sec
                     157 page-faults               #    0.116 M/sec
                  11,986 cycles                    #    0.009 GHz
         <not supported> stalled-cycles-frontend
         <not supported> stalled-cycles-backend
                 496,986 instructions              #   41.46  insns per cycle
                 138,065 branches                  #  102.246 M/sec
                   7,245 branch-misses             #    5.25% of all branches
           <not counted> L1-dcache-loads
           <not counted> L1-dcache-load-misses
           <not counted> LLC-loads
           <not counted> LLC-load-misses
           <not counted> L1-icache-loads
           <not counted> L1-icache-load-misses
           <not counted> dTLB-loads
           <not counted> dTLB-load-misses
           <not counted> iTLB-loads
           <not counted> iTLB-load-misses
           <not counted> L1-dcache-prefetches
         <not supported> L1-dcache-prefetch-misses
      
             1.002397333 seconds time elapsed
      
      v1->v2:
      changed supported type from int to bool
      
      v2->v3
      fixed vertical alignment of new struct element
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/1306767359-13221-1-git-send-email-dsahern@gmail.comSigned-off-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2cee77c4
    • F
      perf python: Cleanup useless double NULL termination in method arg names · 64348153
      Frederic Weisbecker 提交于
      The list of methods argument names only needs to be NULL terminated
      once. Remove the second ones.
      
      Cc: David Ahern <daahern@cisco.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Link: http://lkml.kernel.org/r/1301588863-20210-2-git-send-email-fweisbec@gmail.comSigned-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      64348153
    • F
      perf python: Fix argument name list of read_on_cpu() · e95cc028
      Frederic Weisbecker 提交于
      Mandatory arguments need to be present in the argument name list, as
      well as optional arguments, otherwise python barfs:
      
      	# ./python/twatch.py
      	Traceback (most recent call last):
      	  File "./python/twatch.py", line 41, in <module>
      	    main()
      	  File "./python/twatch.py", line 32, in main
      	    event = evlist.read_on_cpu(cpu)
      	RuntimeError: more argument specifiers than keyword list entries
      
      Hence, add cpu to the name list.
      
      Cc: David Ahern <daahern@cisco.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Link: http://lkml.kernel.org/r/1301588863-20210-1-git-send-email-fweisbec@gmail.comSigned-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e95cc028
  2. 02 6月, 2011 3 次提交
  3. 29 5月, 2011 9 次提交
  4. 28 5月, 2011 6 次提交
  5. 27 5月, 2011 2 次提交
  6. 26 5月, 2011 17 次提交
    • A
      perf tools: Fix build on older systems · 75911c9b
      Arnaldo Carvalho de Melo 提交于
      Where /usr/include/linux/const.h is not present, e.g. RHEL5.
      Reported-by: NSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      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: Tom Zanussi <tzanussi@gmail.com>
      Link: http://lkml.kernel.org/n/tip-ypcw2mu0w7dl1rrc6ncz3pee@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      75911c9b
    • A
      perf symbols: Handle /proc/sys/kernel/kptr_restrict · ec80fde7
      Arnaldo Carvalho de Melo 提交于
      Perf uses /proc/modules to figure out where kernel modules are loaded.
      
      With the advent of kptr_restrict, non root users get zeroes for all module
      start addresses.
      
      So check if kptr_restrict is non zero and don't generate the syntethic
      PERF_RECORD_MMAP events for them.
      
      Warn the user about it in perf record and in perf report.
      
      In perf report the reference relocation symbol being zero means that
      kptr_restrict was set, thus /proc/kallsyms has only zeroed addresses, so don't
      use it to fixup symbol addresses when using a valid kallsyms (in the buildid
      cache) or vmlinux (in the vmlinux path) build-id located automatically or
      specified by the user.
      
      Provide an explanation about it in 'perf report' if kernel samples were taken,
      checking if a suitable vmlinux or kallsyms was found/specified.
      
      Restricted /proc/kallsyms don't go to the buildid cache anymore.
      
      Example:
      
       [acme@emilia ~]$ perf record -F 100000 sleep 1
      
       WARNING: Kernel address maps (/proc/{kallsyms,modules}) are restricted, check
       /proc/sys/kernel/kptr_restrict.
      
       Samples in kernel functions may not be resolved if a suitable vmlinux file is
       not found in the buildid cache or in the vmlinux path.
      
       Samples in kernel modules won't be resolved at all.
      
       If some relocation was applied (e.g. kexec) symbols may be misresolved even
       with a suitable vmlinux or kallsyms file.
      
       [ perf record: Woken up 1 times to write data ]
       [ perf record: Captured and wrote 0.005 MB perf.data (~231 samples) ]
       [acme@emilia ~]$
      
       [acme@emilia ~]$ perf report --stdio
       Kernel address maps (/proc/{kallsyms,modules}) were restricted,
       check /proc/sys/kernel/kptr_restrict before running 'perf record'.
      
       If some relocation was applied (e.g. kexec) symbols may be misresolved.
      
       Samples in kernel modules can't be resolved as well.
      
       # Events: 13  cycles
       #
       # Overhead  Command      Shared Object                 Symbol
       # ........  .......  .................  .....................
       #
          20.24%    sleep  [kernel.kallsyms]  [k] page_fault
          20.04%    sleep  [kernel.kallsyms]  [k] filemap_fault
          19.78%    sleep  [kernel.kallsyms]  [k] __lru_cache_add
          19.69%    sleep  ld-2.12.so         [.] memcpy
          14.71%    sleep  [kernel.kallsyms]  [k] dput
           4.70%    sleep  [kernel.kallsyms]  [k] flush_signal_handlers
           0.73%    sleep  [kernel.kallsyms]  [k] perf_event_comm
           0.11%    sleep  [kernel.kallsyms]  [k] native_write_msr_safe
      
       #
       # (For a higher level overview, try: perf report --sort comm,dso)
       #
       [acme@emilia ~]$
      
      This is because it found a suitable vmlinux (build-id checked) in
      /lib/modules/2.6.39-rc7+/build/vmlinux (use -v in perf report to see the long
      file name).
      
      If we remove that file from the vmlinux path:
      
       [root@emilia ~]# mv /lib/modules/2.6.39-rc7+/build/vmlinux \
      		     /lib/modules/2.6.39-rc7+/build/vmlinux.OFF
       [acme@emilia ~]$ perf report --stdio
       [kernel.kallsyms] with build id 57298cdbe0131f6871667ec0eaab4804dcf6f562
       not found, continuing without symbols
      
       Kernel address maps (/proc/{kallsyms,modules}) were restricted, check
       /proc/sys/kernel/kptr_restrict before running 'perf record'.
      
       As no suitable kallsyms nor vmlinux was found, kernel samples can't be
       resolved.
      
       Samples in kernel modules can't be resolved as well.
      
       # Events: 13  cycles
       #
       # Overhead  Command      Shared Object  Symbol
       # ........  .......  .................  ......
       #
          80.31%    sleep  [kernel.kallsyms]  [k] 0xffffffff8103425a
          19.69%    sleep  ld-2.12.so         [.] memcpy
      
       #
       # (For a higher level overview, try: perf report --sort comm,dso)
       #
       [acme@emilia ~]$
      Reported-by: NStephane Eranian <eranian@google.com>
      Suggested-by: NDavid Miller <davem@davemloft.net>
      Cc: Dave Jones <davej@redhat.com>
      Cc: David Miller <davem@davemloft.net>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Kees Cook <kees.cook@canonical.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Pekka Enberg <penberg@cs.helsinki.fi>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Link: http://lkml.kernel.org/n/tip-mt512joaxxbhhp1odop04yit@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ec80fde7
    • J
      perf: Remove duplicate headers · ea7659fb
      Jesper Juhl 提交于
      Signed-off-by: NJesper Juhl <jj@chaosbits.net>
      Cc: Tom Zanussi <tom.zanussi@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
      Cc: trivial@kernel.org
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Link: http://lkml.kernel.org/r/alpine.LNX.2.00.1105261011290.17400@swampdragon.chaosbits.netSigned-off-by: NIngo Molnar <mingo@elte.hu>
      ea7659fb
    • I
      Merge branch 'linus' into perf/urgent · 1102c660
      Ingo Molnar 提交于
      Merge reason: Linus applied an overlapping commit:
      
        5f2e8e2b: kernel/watchdog.c: Use proper ANSI C prototypes
      
      So merge it in to make sure we can iterate the file without conflicts.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1102c660
    • E
      tmpfs: fix XATTR N overriding POSIX_ACL Y · 4db70f73
      Eric Paris 提交于
      Choosing TMPFS_XATTR default N was switching off TMPFS_POSIX_ACL,
      even if it had been Y in oldconfig; and Linus reports that PulseAudio
      goes subtly wrong unless it can use ACLs on /dev/shm.
      
      Make TMPFS_POSIX_ACL select TMPFS_XATTR (and depend upon TMPFS),
      and move the TMPFS_POSIX_ACL entry before the TMPFS_XATTR entry,
      to avoid asking unnecessary questions then ignoring their answers.
      Signed-off-by: NHugh Dickins <hughd@google.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4db70f73
    • S
      ftrace: Add internal recursive checks · b1cff0ad
      Steven Rostedt 提交于
      Witold reported a reboot caused by the selftests of the dynamic function
      tracer. He sent me a config and I used ktest to do a config_bisect on it
      (as my config did not cause the crash). It pointed out that the problem
      config was CONFIG_PROVE_RCU.
      
      What happened was that if multiple callbacks are attached to the
      function tracer, we iterate a list of callbacks. Because the list is
      managed by synchronize_sched() and preempt_disable, the access to the
      pointers uses rcu_dereference_raw().
      
      When PROVE_RCU is enabled, the rcu_dereference_raw() calls some
      debugging functions, which happen to be traced. The tracing of the debug
      function would then call rcu_dereference_raw() which would then call the
      debug function and then... well you get the idea.
      
      I first wrote two different patches to solve this bug.
      
      1) add a __rcu_dereference_raw() that would not do any checks.
      2) add notrace to the offending debug functions.
      
      Both of these patches worked.
      
      Talking with Paul McKenney on IRC, he suggested to add recursion
      detection instead. This seemed to be a better solution, so I decided to
      implement it. As the task_struct already has a trace_recursion to detect
      recursion in the ring buffer, and that has a very small number it
      allows, I decided to use that same variable to add flags that can detect
      the recursion inside the infrastructure of the function tracer.
      
      I plan to change it so that the task struct bit can be checked in
      mcount, but as that requires changes to all archs, I will hold that off
      to the next merge window.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Link: http://lkml.kernel.org/r/1306348063.1465.116.camel@gandalf.stny.rr.comReported-by: NWitold Baryluk <baryluk@smp.if.uj.edu.pl>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      b1cff0ad
    • L
      tracing: Update btrfs's tracepoints to use u64 interface · 7f34b746
      liubo 提交于
      To avoid 64->32 truncating WARNING, update btrfs's tracepoints.
      Signed-off-by: NLiu Bo <liubo2009@cn.fujitsu.com>
      Link: http://lkml.kernel.org/r/4DACE6E3.8080200@cn.fujitsu.comSigned-off-by: NSteven Rostedt <rostedt@goodmis.org>
      7f34b746
    • L
      tracing: Add __print_symbolic_u64 to avoid warnings on 32bit machine · 2fc1b6f0
      liubo 提交于
      Filesystem, like Btrfs, has some "ULL" macros, and when these macros are passed
      to tracepoints'__print_symbolic(), there will be 64->32 truncate WARNINGS during
      compiling on 32bit box.
      Signed-off-by: NLiu Bo <liubo2009@cn.fujitsu.com>
      Link: http://lkml.kernel.org/r/4DACE6E0.7000507@cn.fujitsu.comSigned-off-by: NSteven Rostedt <rostedt@goodmis.org>
      2fc1b6f0
    • S
      ftrace: Set ops->flag to enabled even on static function tracing · 3b6cfdb1
      Steven Rostedt 提交于
      When dynamic ftrace is not configured, the ops->flags still needs
      to have its FTRACE_OPS_FL_ENABLED bit set in ftrace_startup().
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      3b6cfdb1
    • S
      tracing: Have event with function tracer check error return · 17bb615a
      Steven Rostedt 提交于
      The self tests for event tracer does not check if the function
      tracing was successfully activated. It needs to before it continues
      the tests, otherwise the wrong errors may be reported.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      17bb615a
    • S
      ftrace: Have ftrace_startup() return failure code · a1cd6173
      Steven Rostedt 提交于
      The register_ftrace_function() returns an error code on failure
      except if the call to ftrace_startup() fails. Add a error return to
      ftrace_startup() if it fails to start, allowing register_ftrace_funtion()
      to return a proper error value.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      a1cd6173
    • S
      video: mb862xx: udelay need linux/delay.h · 520fd845
      Stephen Rothwell 提交于
      Fix this:
      
        drivers/video/mb862xx/mb862xx-i2c.c: In function 'mb862xx_i2c_wait_event':
        drivers/video/mb862xx/mb862xx-i2c.c:25: error: implicit declaration of function 'udelay'
      
      caused by commit f8a6b1f4 ("video: mb862xx: add support for
      controller's I2C bus adapter").
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      520fd845
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/linux-2.6-nsfd · 14d74e0c
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/linux-2.6-nsfd:
        net: fix get_net_ns_by_fd for !CONFIG_NET_NS
        ns proc: Return -ENOENT for a nonexistent /proc/self/ns/ entry.
        ns: Declare sys_setns in syscalls.h
        net: Allow setting the network namespace by fd
        ns proc: Add support for the ipc namespace
        ns proc: Add support for the uts namespace
        ns proc: Add support for the network namespace.
        ns: Introduce the setns syscall
        ns: proc files for namespace naming policy.
      14d74e0c
    • L
      slub: remove no-longer used 'unlock_out' label · 49a78d08
      Linus Torvalds 提交于
      Commit a71ae47a ("slub: Fix double bit unlock in debug mode")
      removed the only goto to this label, resulting in
      
        mm/slub.c: In function '__slab_alloc':
        mm/slub.c:1834: warning: label 'unlock_out' defined but not used
      
      fixed trivially by the removal of the label itself too.
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Cc: Christoph Lameter <cl@linux.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      49a78d08
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 · 3f5785ec
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (89 commits)
        bonding: documentation and code cleanup for resend_igmp
        bonding: prevent deadlock on slave store with alb mode (v3)
        net: hold rtnl again in dump callbacks
        Add Fujitsu 1000base-SX PCI ID to tg3
        bnx2x: protect sequence increment with mutex
        sch_sfq: fix peek() implementation
        isdn: netjet - blacklist Digium TDM400P
        via-velocity: don't annotate MAC registers as packed
        xen: netfront: hold RTNL when updating features.
        sctp: fix memory leak of the ASCONF queue when free asoc
        net: make dev_disable_lro use physical device if passed a vlan dev (v2)
        net: move is_vlan_dev into public header file (v2)
        bug.h: Fix build with CONFIG_PRINTK disabled.
        wireless: fix fatal kernel-doc error + warning in mac80211.h
        wireless: fix cfg80211.h new kernel-doc warnings
        iwlagn: dbg_fixed_rate only used when CONFIG_MAC80211_DEBUGFS enabled
        dst: catch uninitialized metrics
        be2net: hash key for rss-config cmd not set
        bridge: initialize fake_rtable metrics
        net: fix __dst_destroy_metrics_generic()
        ...
      
      Fix up trivial conflicts in drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
      3f5785ec
    • J
      jump_label: Check entries limit in __jump_label_update · 7cbc5b8d
      Jiri Olsa 提交于
      When iterating the jump_label entries array (core or modules),
      the __jump_label_update function peeks over the last entry.
      
      The reason is that the end of the for loop depends on the key
      value of the processed entry. Thus when going through the
      last array entry, we will touch the memory behind the array
      limit.
      
      This bug probably will never be triggered, since most likely the
      memory behind the jump_label entries will be accesable and the
      entry->key will be different than the expected value.
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Acked-by: NJason Baron <jbaron@redhat.com>
      Link: http://lkml.kernel.org/r/20110510104346.GC1899@jolsa.brq.redhat.comSigned-off-by: NSteven Rostedt <rostedt@goodmis.org>
      7cbc5b8d
    • R
      ftrace/recordmcount: Avoid STT_FUNC symbols as base on ARM · 9905ce8a
      Rabin Vincent 提交于
      While find_secsym_ndx often finds the unamed local STT_SECTION, if a
      section has only one function in it, the ARM toolchain generates the
      STT_FUNC symbol before the STT_SECTION, and recordmcount finds this
      instead.
      
      This is problematic on ARM because in ARM ELFs, "if a [STT_FUNC] symbol
      addresses a Thumb instruction, its value is the address of the
      instruction with bit zero set (in a relocatable object, the section
      offset with bit zero set)".  This leads to incorrect mcount addresses
      being recorded.
      
      Fix this by not using STT_FUNC symbols as the base on ARM.
      Signed-off-by: NRabin Vincent <rabin@rab.in>
      Link: http://lkml.kernel.org/r/1305134631-31617-1-git-send-email-rabin@rab.inSigned-off-by: NSteven Rostedt <rostedt@goodmis.org>
      9905ce8a