1. 17 1月, 2015 2 次提交
    • A
      tools: Remove bitops/hweight usage of bits in tools/perf · 25cd480e
      Arnaldo Carvalho de Melo 提交于
      We need to use lib/hweight.c for that, just like we do for lib/rbtree.c,
      so tools need to link hweight.o. For now do it directly, but we need to
      have a tools/lib/lk.a or .so that collects these goodies...
      Reported-by: NJan Beulich <JBeulich@suse.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      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-a1e91dx3apzqw5kbdt7ut21s@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      25cd480e
    • N
      perf tools: Fix building error in x86_64 when dwarf unwind is on · c6e5e9fb
      Namhyung Kim 提交于
      When build with 'make ARCH=x86' and dwarf unwind is on, there is a
      compiling error:
      
         CC       /home/wn/perf/arch/x86/util/unwind-libdw.o
         CC       /home/wn/perf/arch/x86/tests/regs_load.o
       arch/x86/tests/regs_load.S: Assembler messages:
       arch/x86/tests/regs_load.S:65: Error: operand type mismatch for `push'
       arch/x86/tests/regs_load.S:72: Error: operand type mismatch for `pop'
       make[1]: *** [/home/wn/perf/arch/x86/tests/regs_load.o] Error 1
       make[1]: INTERNAL: Exiting with 25 jobserver tokens available; should be 24!
       make: *** [all] Error 2
       ...
      
      Which is caused by incorrectly undefine macro HAVE_ARCH_X86_64_SUPPORT.
      'config/Makefile.arch' tests __x86_64__ only when 'ARCH=x86_64'.
      However, when building x86_64 kernel, ARCH=x86 is valid and commonly
      used. Build systems, such as yocto, uses x86_64 compiler with 'ARCH=x86'
      to build x86_64 perf, which causes mismatching.
      
      As __LP64__ is defined for x86_64 as well, we can consolidate the
      __x86_64__ check to the __LP64__ check and get rid of the IS_X86_64
      IMHO.
      
      (This patch is made by Namhyung Kim when replying my v1 patch:
      
      https://lkml.org/lkml/2015/1/7/17
      
      I modified the code to remove dependency on RAW_ARCH:
      
      https://lkml.org/lkml/2015/1/7/865
      
      Namhyung Kim didn't provide his SOB in his original email. I add
      mine only for my modification.)
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Li Zefan <lizefan@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/1421029255-23039-1-git-send-email-wangnan0@huawei.com
      [ Namhyung provided his S-o-B on a followup to this patch thread on lkml ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c6e5e9fb
  2. 17 12月, 2014 7 次提交
  3. 09 12月, 2014 1 次提交
  4. 19 11月, 2014 1 次提交
  5. 05 11月, 2014 1 次提交
    • N
      perf tools: Add gzip decompression support for kernel module · e92ce12e
      Namhyung Kim 提交于
      Now my Archlinux box shows module symbols correctly.
      
      Before:
        $ perf report --stdio
        Failed to open /tmp/perf-3477.map, continuing without symbols
        no symbols found in /usr/bin/date, maybe install a debug package?
        No kallsyms or vmlinux with build-id 7b4ea0a49ae2111925857099aaf05c3246ff33e0 was found
        [drm] with build id 7b4ea0a49ae2111925857099aaf05c3246ff33e0 not found, continuing without symbols
        No kallsyms or vmlinux with build-id edd931629094b660ca9dec09a1b635c8d87aa2ee was found
        [jbd2] with build id edd931629094b660ca9dec09a1b635c8d87aa2ee not found, continuing without symbols
        No kallsyms or vmlinux with build-id a7b1eada671c34933e5610bb920b2ca4945a82c3 was found
        [ext4] with build id a7b1eada671c34933e5610bb920b2ca4945a82c3 not found, continuing without symbols
        No kallsyms or vmlinux with build-id d69511fa3e5840e770336ef45b06c83fef8d74e3 was found
        [scsi_mod] with build id d69511fa3e5840e770336ef45b06c83fef8d74e3 not found, continuing without symbols
        No kallsyms or vmlinux with build-id af0430af13461af058770ee9b87afc07922c2e77 was found
        [libata] with build id af0430af13461af058770ee9b87afc07922c2e77 not found, continuing without symbols
        No kallsyms or vmlinux with build-id aaeedff8160ce631a5f0333591c6ff291201d29f was found
        [libahci] with build id aaeedff8160ce631a5f0333591c6ff291201d29f not found, continuing without symbols
        No kallsyms or vmlinux with build-id c57907712becaf662dc4981824bb372c0441d605 was found
        [mac80211] with build id c57907712becaf662dc4981824bb372c0441d605 not found, continuing without symbols
        No kallsyms or vmlinux with build-id e0589077cc0ec8c3e4c40eb9f2d9e69d236bee8f was found
        [iwldvm] with build id e0589077cc0ec8c3e4c40eb9f2d9e69d236bee8f not found, continuing without symbols
        No kallsyms or vmlinux with build-id 2d86086bf136bf374a2f029cf85a48194f9b950b was found
        [cfg80211] with build id 2d86086bf136bf374a2f029cf85a48194f9b950b not found, continuing without symbols
        No kallsyms or vmlinux with build-id 4493c48599bdb3d91d0f8db5150e0be33fdd9221 was found
        [iwlwifi] with build id 4493c48599bdb3d91d0f8db5150e0be33fdd9221 not found, continuing without symbols
        ...
        #
        # Overhead  Command          Shared Object            Symbol
        # ........  ...............  .......................  ........................................................
        #
             0.03%  swapper          [ext4]                   [k] 0x000000000000fe2e
             0.03%  swapper          [kernel.kallsyms]        [k] account_entity_enqueue
             0.03%  swapper          [ext4]                   [k] 0x000000000000fc2b
             0.03%  irq/50-iwlwifi   [iwlwifi]                [k] 0x000000000000200b
             0.03%  swapper          [kernel.kallsyms]        [k] ktime_add_safe
             0.03%  swapper          [kernel.kallsyms]        [k] elv_completed_request
             0.03%  swapper          [libata]                 [k] 0x0000000000003997
             0.03%  swapper          [libahci]                [k] 0x0000000000001f25
             0.03%  swapper          [kernel.kallsyms]        [k] rb_next
             0.03%  swapper          [kernel.kallsyms]        [k] blk_finish_request
             0.03%  swapper          [ext4]                   [k] 0x0000000000010248
             0.00%  perf             [kernel.kallsyms]        [k] native_write_msr_safe
      
      After:
        $ perf report --stdio
        Failed to open /tmp/perf-3477.map, continuing without symbols
        no symbols found in /usr/bin/tr, maybe install a debug package?
        ...
        #
        # Overhead  Command          Shared Object                Symbol
        # ........  ...............  ...........................  ......................................................
        #
      
             0.04%  kworker/u16:3    [ext4]                       [k] ext4_read_block_bitmap
             0.03%  kworker/u16:0    [mac80211]                   [k] ieee80211_sta_reset_beacon_monitor
             0.02%  irq/50-iwlwifi   [mac80211]                   [k] ieee80211_get_bssid
             0.02%  firefox          [e1000e]                     [k] __ew32_prepare
             0.02%  swapper          [libahci]                    [k] ahci_handle_port_interrupt
             0.02%  emacs            libglib-2.0.so.0.4000.0      [.] g_mutex_unlock
             0.02%  swapper          [e1000e]                     [k] e1000_clean_tx_irq
             0.02%  dwm              [kernel.kallsyms]            [k] __schedule
             0.02%  gnome-terminal-  [vdso]                       [.] __vdso_clock_gettime
             0.02%  swapper          [e1000e]                     [k] e1000_alloc_rx_buffers
             0.02%  irq/50-iwlwifi   [mac80211]                   [k] ieee80211_rx
             0.01%  firefox          [vdso]                       [.] __vdso_gettimeofday
             0.01%  irq/50-iwlwifi   [iwlwifi]                    [k] iwl_pcie_rxq_restock.part.13
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/87h9yexshi.fsf@sejong.aot.lge.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e92ce12e
  6. 04 11月, 2014 1 次提交
  7. 29 10月, 2014 2 次提交
  8. 26 9月, 2014 2 次提交
    • A
      tools lib api: Adopt fdarray class from perf's evlist · 1b85337d
      Arnaldo Carvalho de Melo 提交于
      The extensible file description array that grew in the perf_evlist class
      can be useful for other tools, as it is not something that only evlists
      need, so move it to tools/lib/api/fd to ease sharing it.
      
      v2: Don't use {} like in:
      
       libapi_dirs:
      	$(QUIET_MKDIR)mkdir -p $(OUTPUT){fs,fd}/
      
      in Makefiles, as it will not work in some systems, as in ubuntu13.10.
      
      v3: Add fd/*.[ch] to LIBAPIKFS_SOURCES (Fix from Jiri Olsa)
      
      v4: Leave the fcntl(fd, O_NONBLOCK) in the evlist layer, remains to
          be checked if it is really needed there, but has no place in the
          fdarray class (Fix from Jiri Olsa)
      
      v5: Remove evlist details from fdarray grow/filter tests. Improve it a
          bit doing more tests about expected internal state.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/n/tip-kleuni3hckbc3s0lu6yb9x40@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1b85337d
    • A
      perf tests: Add test for perf_evlist__filter_pollfd() · 54dbfae3
      Arnaldo Carvalho de Melo 提交于
      That will use a synthetic evlist with just what is touched by this new
      method to check that it works as expected.
      
      Output in verbose mode:
      
        $ perf test -v pollfd
        33: Filter fds with revents mask in a pollfd array         :
        --- start ---
        filtering all but pollfd[2]:
        before:   5 [ 5, 4, 3, 2, 1 ]
         after:   1 [ 3 ]
        filtering all but (pollfd[0], pollfd[3]):
        before:   5 [ 5, 4, 3, 2, 1 ]
         after:   2 [ 5, 2 ]
        test child finished with 0
        ---- end ----
        Filter fds with revents mask in a pollfd array: Ok
        $
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      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-x7c8liszdvc3ocmanf2cet8p@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      54dbfae3
  9. 18 9月, 2014 1 次提交
    • A
      perf tools: Add perf-with-kcore script · c501e90b
      Adrian Hunter 提交于
      Decoding an Intel PT trace of the kernel requires an accurate kernel
      object image.  This is provided by making a copy of kcore.  However the
      copy needs to be made under the same conditions as the original
      recording, and then it needs to be associated with the perf.data file.
      The perf-with-kcore script does that.
      
      The script also checks the permissions on the buildid cache and can be
      used to fix them.  That is needed for distributions where root does not
      have a home directory and consequently writes to the same buildid cache
      as the user, resulting in cached files that the user does not have
      access to.
      
      Example:
      
      $ ./perf-with-kcore
      Usage: perf-with-kcore <perf sub-command> <perf.data directory> [<sub-command options> [ -- <workload>]]
             <perf sub-command> can be record, script, report or inject
         or: perf-with-kcore fix_buildid_cache_permissions
      $ ./perf-with-kcore record pt_uname -e intel_pt// -- uname
      Recording
      Using /home/ahunter/bin/perf
      perf version 3.15.rc3.g4549ba
      /home/ahunter/bin/perf record -o pt_uname/perf.data -e intel_pt//  -- uname
      Linux
      [ perf record: Woken up 3 times to write data ]
      [ perf record: Captured and wrote 0.023 MB pt_uname/perf.data ]
      Copying kcore
      [sudo] password for ahunter:
      Done
      $ tools/perf/perf-with-kcore.sh script pt_uname | head
      Using /home/ahunter/bin/perf
      perf version 3.15.rc3.g4549ba
      /home/ahunter/bin/perf script -i pt_uname/perf.data --kallsyms=pt_uname/kcore_dir/kallsyms
               swapper     0 [002] 161533.969666: sched:sched_switch: swapper/2:0 [120] R ==> perf:11316 [120]
                :11315 11315 [003] 161533.969704: sched:sched_switch: perf:11315 [120] S ==> swapper/3:0 [120]
                :11316 11316 [002] 161533.969783: sched:sched_switch: perf:11316 [120] R ==> migration/2:33 [0]
                   :33    33 [002] 161533.969791: sched:sched_switch: migration/2:33 [0] S ==> swapper/2:0 [120]
               swapper     0 [003] 161533.969792: sched:sched_switch: swapper/3:0 [120] R ==> perf:11316 [120]
                :11316 11316 [003] 161533.970062: branches:                 0 [unknown] ([unknown]) => ffffffff810532fa native_write_msr_safe ([kernel.kallsyms])
                :11316 11316 [003] 161533.970062: branches:  ffffffff810532fd native_write_msr_safe ([kernel.kallsyms]) => ffffffff81035b31 pt_config_start ([kernel.kallsyms])
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      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/1406786474-9306-30-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c501e90b
  10. 23 8月, 2014 1 次提交
  11. 12 8月, 2014 1 次提交
  12. 18 7月, 2014 1 次提交
  13. 17 7月, 2014 2 次提交
  14. 09 6月, 2014 1 次提交
  15. 04 6月, 2014 2 次提交
  16. 01 6月, 2014 1 次提交
  17. 21 5月, 2014 1 次提交
  18. 16 5月, 2014 1 次提交
  19. 02 5月, 2014 2 次提交
  20. 30 4月, 2014 1 次提交
  21. 28 4月, 2014 4 次提交
  22. 15 4月, 2014 1 次提交
  23. 14 3月, 2014 3 次提交
    • D
      perf bench: Add futex-requeue microbenchmark · 0fb298cf
      Davidlohr Bueso 提交于
      Block a bunch of threads on a futex and requeue them on another, N at a
      time.
      
      This program is particularly useful to measure the latency of nthread
      requeues without waking up any tasks -- thus mimicking a regular
      futex_wait.
      
      An example run:
      
        $ perf bench futex requeue -r 100 -t 64
        Run summary [PID 151011]: Requeuing 64 threads (from 0x7d15c4 to 0x7d15c8), 1 at a time.
      
        [Run 1]: Requeued 64 of 64 threads in 0.0400 ms
        [Run 2]: Requeued 64 of 64 threads in 0.0390 ms
        [Run 3]: Requeued 64 of 64 threads in 0.0400 ms
        ...
        [Run 100]: Requeued 64 of 64 threads in 0.0390 ms
        Requeued 64 of 64 threads in 0.0399 ms (+-0.37%)
      Signed-off-by: NDavidlohr Bueso <davidlohr@hp.com>
      Acked-by: NDarren Hart <dvhart@linux.intel.com>
      Cc: Aswin Chandramouleeswaran <aswin@hp.com>
      Cc: Darren Hart <dvhart@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jason Low <jason.low2@hp.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Scott J Norton <scott.norton@hp.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Waiman Long <Waiman.Long@hp.com>
      Link: http://lkml.kernel.org/r/1387081917-9102-4-git-send-email-davidlohr@hp.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0fb298cf
    • D
      perf bench: Add futex-wake microbenchmark · 27db7830
      Davidlohr Bueso 提交于
      Block a bunch of threads on a futex and wake them up, N at a time.
      
      This program is particularly useful to measure the latency of nthread
      wakeups in non-error situations:  all waiters are queued and all wake
      calls wakeup one or more tasks.
      
      An example run:
      
        $ perf bench futex wake -t 512 -r 100
        Run summary [PID 27823]: blocking on 512 threads (at futex 0x7e10d4), waking up 1 at a time.
      
        [Run 1]: Wokeup 512 of 512 threads in 6.0080 ms
        [Run 2]: Wokeup 512 of 512 threads in 5.2280 ms
        [Run 3]: Wokeup 512 of 512 threads in 4.8300 ms
        ...
        [Run 100]: Wokeup 512 of 512 threads in 5.0100 ms
        Wokeup 512 of 512 threads in 5.0109 ms (+-2.25%)
      Signed-off-by: NDavidlohr Bueso <davidlohr@hp.com>
      Acked-by: NDarren Hart <dvhart@linux.intel.com>
      Cc: Aswin Chandramouleeswaran <aswin@hp.com>
      Cc: Darren Hart <dvhart@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jason Low <jason.low2@hp.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Scott J Norton <scott.norton@hp.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Waiman Long <Waiman.Long@hp.com>
      Link: http://lkml.kernel.org/r/1387081917-9102-3-git-send-email-davidlohr@hp.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      27db7830
    • D
      perf bench: Add futex-hash microbenchmark · a0439711
      Davidlohr Bueso 提交于
      Introduce futexes to perf-bench and add a program that stresses and
      measures the kernel's implementation of the hash table.
      
      This is a multi-threaded program that simply measures the amount of
      failed futex wait calls - we only want to deal with the hashing
      overhead, so a negative return of futex_wait_setup() is enough to do the
      trick.
      
      An example run:
      
        $ perf bench futex hash -t 32
        Run summary [PID 10989]: 32 threads, each operating on 1024 [private] futexes for 10 secs.
      
        [thread  0] futexes: 0x19d9b10 ... 0x19dab0c [ 418713 ops/sec ]
        [thread  1] futexes: 0x19daca0 ... 0x19dbc9c [ 469913 ops/sec ]
        [thread  2] futexes: 0x19dbe30 ... 0x19dce2c [ 479744 ops/sec ]
        ...
        [thread 31] futexes: 0x19fbb80 ... 0x19fcb7c [ 464179 ops/sec ]
      
        Averaged 454310 operations/sec (+- 0.84%), total secs = 10
      Signed-off-by: NDavidlohr Bueso <davidlohr@hp.com>
      Acked-by: NDarren Hart <dvhart@linux.intel.com>
      Cc: Aswin Chandramouleeswaran <aswin@hp.com>
      Cc: Darren Hart <dvhart@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jason Low <jason.low2@hp.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Scott J Norton <scott.norton@hp.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Waiman Long <Waiman.Long@hp.com>
      Link: http://lkml.kernel.org/r/1387081917-9102-2-git-send-email-davidlohr@hp.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a0439711