1. 09 1月, 2016 1 次提交
    • N
      perf report: Show random usage tip on the help line · 14cbfbeb
      Namhyung Kim 提交于
      Currently perf report only shows a help message "For a higher level
      overview, try: perf report --sort comm,dso" unconditionally (even if
      the sort keys were used).  Add more help tips and show randomly.
      
      Load tips from ${prefix}/share/doc/perf-tip/tips.txt file.
      
        $ perf report | tail
            0.10%  swapper  [kernel.vmlinux]   [k] irq_exit
            0.09%  swapper  [kernel.vmlinux]   [k] flush_smp_call_function_queue
            0.08%  swapper  [kernel.vmlinux]   [k] native_write_msr_safe
            0.03%  swapper  [kernel.vmlinux]   [k] group_sched_in
            0.01%  perf     [kernel.vmlinux]   [k] native_write_msr_safe
      
        #
        # (Tip: Search options using a keyword: perf report -h <keyword>)
        #
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NIngo Molnar <mingo@kernel.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1452166913-27046-1-git-send-email-namhyung@kernel.org
      [ Renamed it to perf_tip() and the parameter dirname to dirpath to fix the build on older distros ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      14cbfbeb
  2. 07 1月, 2016 2 次提交
  3. 18 12月, 2015 1 次提交
  4. 11 12月, 2015 1 次提交
  5. 28 11月, 2015 1 次提交
  6. 27 11月, 2015 1 次提交
  7. 20 11月, 2015 1 次提交
    • N
      perf report: Add callchain value option · f2af0086
      Namhyung Kim 提交于
      Now -g/--call-graph option supports how to display callchain values.
      Possible values are 'percent', 'period' and 'count'.  The percent is
      same as before and it's the default behavior.  The period displays the
      raw period value rather than the percentage.  The count displays the
      number of occurrences.
      
        $ perf report --no-children --stdio -g percent
        ...
          39.93%  swapper  [kernel.vmlinux]  [k] intel_idel
                  |
                  ---intel_idle
                     cpuidle_enter_state
                     cpuidle_enter
                     call_cpuidle
                     cpu_startup_entry
                     |
                     |--28.63%-- start_secondary
                     |
                      --11.30%-- rest_init
      
        $ perf report --no-children --show-total-period --stdio -g period
        ...
          39.93%   13018705  swapper  [kernel.vmlinux]  [k] intel_idel
                  |
                  ---intel_idle
                     cpuidle_enter_state
                     cpuidle_enter
                     call_cpuidle
                     cpu_startup_entry
                     |
                     |--9334403-- start_secondary
                     |
                      --3684302-- rest_init
      
        $ perf report --no-children --show-nr-samples --stdio -g count
        ...
          39.93%     80  swapper  [kernel.vmlinux]  [k] intel_idel
                  |
                  ---intel_idle
                     cpuidle_enter_state
                     cpuidle_enter
                     call_cpuidle
                     cpu_startup_entry
                     |
                     |--57-- start_secondary
                     |
                      --23-- rest_init
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NBrendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1447047946-1691-6-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f2af0086
  8. 13 11月, 2015 1 次提交
  9. 27 10月, 2015 1 次提交
  10. 23 10月, 2015 3 次提交
  11. 06 10月, 2015 1 次提交
  12. 01 10月, 2015 2 次提交
  13. 29 9月, 2015 5 次提交
  14. 15 9月, 2015 1 次提交
  15. 14 9月, 2015 1 次提交
    • K
      perf report: Introduce --socket-filter option · 21394d94
      Kan Liang 提交于
      Introduce --socket-filter option for 'perf report' to only show entries
      for a processor socket that match this filter.
      
        $ perf report --socket-filter 1 --stdio
        # To display the perf.data header info, please use --header/--header-only options.
        #
        # Total Lost Samples: 0
        #
        # Samples: 752  of event 'cycles'
        # Event count (approx.): 350995599
        # Processor Socket: 1
        #
        # Overhead  Command    Shared Object     Symbol
        # ........  .........  ................  .................................
        #
            97.02%  test       test              [.] plusB_c
             0.97%  test       test              [.] plusA_c
             0.23%  swapper    [kernel.vmlinux]  [k] acpi_idle_do_entry
             0.09%  rcu_sched  [kernel.vmlinux]  [k] dyntick_save_progress_counter
             0.01%  swapper    [kernel.vmlinux]  [k] task_waking_fair
             0.00%  swapper    [kernel.vmlinux]  [k] run_timer_softirq
      Signed-off-by: NKan Liang <kan.liang@intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1441377946-44429-3-git-send-email-kan.liang@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      21394d94
  16. 13 8月, 2015 1 次提交
    • K
      perf report: Show call graph from reference events · 9e207ddf
      Kan Liang 提交于
      Introduce --show-ref-call-graph for perf report to print reference
      callgraph for no callgraph event.
      
      Here is an example.
      
       perf report --show-ref-call-graph --stdio
      
       # To display the perf.data header info, please use
       --header/--header-only options.
       #
       #
       # Total Lost Samples: 0
       #
       # Samples: 5  of event 'cpu/cpu-cycles,call-graph=fp/'
       # Event count (approx.): 144985
       #
       # Children      Self  Command  Shared Object     Symbol
       # ........  ........  .......  ................  ........................................
       #
          72.30%     0.00%  sleep    [kernel.vmlinux]  [k] entry_SYSCALL_64_fastpath
                    |
                    ---entry_SYSCALL_64_fastpath
                       |
                       |--22.62%-- __GI___libc_nanosleep
                        --77.38%-- [...]
      
      ......
      
       # Samples: 6  of event 'cpu/instructions,call-graph=no/', show reference callgraph
       # Event count (approx.): 172780
       #
       # Children      Self  Command  Shared Object     Symbol
       # ........  ........  .......  ................  ........................................
       #
          73.16%     0.00%  sleep    [kernel.vmlinux]  [k] entry_SYSCALL_64_fastpath
                    |
                    ---entry_SYSCALL_64_fastpath
                       |
                       |--31.44%-- __GI___libc_nanosleep
                        --68.56%-- [...]
      Signed-off-by: NKan Liang <kan.liang@intel.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/1439289050-40510-3-git-send-email-kan.liang@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9e207ddf
  17. 10 8月, 2015 1 次提交
  18. 07 8月, 2015 2 次提交
  19. 02 7月, 2015 1 次提交
  20. 26 6月, 2015 1 次提交
    • L
      perf symbols: Check access permission when reading symbol files · 36c8bb56
      Li Zhang 提交于
      There 2 problems when reading symbols files:
      
      *  It doesn't report any errors even if when users specify symbol
         files which don't exist with --kallsyms or --vmlinux. The result
         just shows the address without symbols, which is not what is expected.
         So it's better to report errors and exit the program.
      
      *  When using command perf report --kallsyms=/proc/kallsyms with a
         non-root user, symbols are resolved. Then select one symbol and
         annotate it, it reports the error as the following:
         Can't annotate __clear_user: No vmlinux file with build id xxx was
         found.
      
         The problem is caused by reading /proc/kcore without access permission.
         /proc/kcore requires CAP_SYS_RAWIO capability to access, so it needs to
         change access permission to allow a specific user to read /proc/kcore or
         use root to execute the perf command.
      
      This patch is to report errors when symbol files specified by users
      don't exist. And check access permission of /proc/kcore when reading it.
      Signed-off-by: NLi Zhang <zhlcindy@linux.vnet.ibm.com>
      Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Link: http://lkml.kernel.org/r/1434704253-2632-1-git-send-email-zhlcindy@linux.vnet.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      36c8bb56
  21. 11 6月, 2015 1 次提交
    • H
      perf tools: Fix build failure on 32-bit arch · 6ba29c2f
      He Kuang 提交于
      Failed in 32bit arch build like this:
      
          CC       /opt/h00206996/output/perf/arm32/builtin-record.o
        util/session.c: In function ‘perf_session__warn_about_errors’:
        util/session.c:1304:9: error: format ‘%lu’ expects argument of type ‘long unsigned int’,
                               but argument 2 has type ‘long long unsigned int’ [-Werror=format=]
      
        builtin-report.c: In function ‘perf_evlist__tty_browse_hists’:
        builtin-report.c:323:2: error: format ‘%lu’ expects argument of type ‘long unsigned int’,
                                but argument 3 has type ‘u64’ [-Werror=format=]
      
      Replace %lu format strings in warning message with PRIu64 for u64
      'total_lost_samples' to fix this problem.
      Signed-off-by: NHe Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1434026664-71642-1-git-send-email-hekuang@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6ba29c2f
  22. 07 6月, 2015 1 次提交
    • K
      perf tools: handle PERF_RECORD_LOST_SAMPLES · c4937a91
      Kan Liang 提交于
      This patch modifies the perf tool to handle the new RECORD type,
      PERF_RECORD_LOST_SAMPLES.
      
      The number of lost-sample events is stored in
      .nr_events[PERF_RECORD_LOST_SAMPLES]. The exact number of samples
      which the kernel dropped is stored in total_lost_samples.
      
      When the percentage of dropped samples is greater than 5%, a warning
      is printed.
      
      Here are some examples:
      
      Eg 1, Recording different frequently-occurring events is safe with the
            patch. Only a very low drop rate is associated with such actions.
      
      $ perf record -e '{cycles:p,instructions:p}' -c 20003 --no-time ~/tchain ~/tchain
      
      $ perf report -D | tail
                SAMPLE events:     120243
                 MMAP2 events:          5
          LOST_SAMPLES events:         24
        FINISHED_ROUND events:         15
      cycles:p stats:
                 TOTAL events:      59348
                SAMPLE events:      59348
      instructions:p stats:
                 TOTAL events:      60895
                SAMPLE events:      60895
      
      $ perf report --stdio --group
       # To display the perf.data header info, please use --header/--header-only options.
       #
       #
       # Total Lost Samples: 24
       #
       # Samples: 120K of event 'anon group { cycles:p, instructions:p }'
       # Event count (approx.): 24048600000
       #
       #         Overhead  Command      Shared Object     Symbol
       # ................  ...........  ................
       ..................................
       #
          99.74%  99.86%  tchain_edit  tchain_edit       [.] f3
           0.09%   0.02%  tchain_edit  tchain_edit       [.] f2
           0.04%   0.00%  tchain_edit  [kernel.vmlinux]  [k] ixgbe_read_reg
      
      Eg 2, Recording the same thing multiple times can lead to high drop
            rate, but it is not a useful configuration.
      
      $ perf record -e '{cycles:p,cycles:p}' -c 20003 --no-time ~/tchain
      Warning: Processed 600592 samples and lost 99.73% samples!
      [perf record: Woken up 148 times to write data]
      [perf record: Captured and wrote 36.922 MB perf.data (1206322 samples)]
      [perf record: Woken up 1 times to write data]
      [perf record: Captured and wrote 0.121 MB perf.data (1629 samples)]
      Signed-off-by: NKan Liang <kan.liang@intel.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: acme@infradead.org
      Cc: eranian@google.com
      Link: http://lkml.kernel.org/r/1431285195-14269-9-git-send-email-kan.liang@intel.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      c4937a91
  23. 27 5月, 2015 1 次提交
  24. 12 5月, 2015 2 次提交
  25. 09 5月, 2015 1 次提交
    • A
      perf machine: Protect the machine->threads with a rwlock · b91fc39f
      Arnaldo Carvalho de Melo 提交于
      In addition to using refcounts for the struct thread lifetime
      management, we need to protect access to machine->threads from
      concurrent access.
      
      That happens in 'perf top', where a thread processes events, inserting
      and deleting entries from that rb_tree while another thread decays
      hist_entries, that end up dropping references and ultimately deleting
      threads from the rb_tree and releasing its resources when no further
      hist_entry (or other data structures, like in 'perf sched') references
      it.
      
      So the rule is the same for refcounts + protected trees in the kernel,
      get the tree lock, find object, bump the refcount, drop the tree lock,
      return, use object, drop the refcount if no more use of it is needed,
      keep it if storing it in some other data structure, drop when releasing
      that data structure.
      
      I.e. pair "t = machine__find(new)_thread()" with a "thread__put(t)", and
      "perf_event__preprocess_sample(&al)" with "addr_location__put(&al)".
      
      The addr_location__put() one is because as we return references to
      several data structures, we may end up adding more reference counting
      for the other data structures and then we'll drop it at
      addr_location__put() time.
      Acked-by: NDavid Ahern <dsahern@gmail.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-bs9rt4n0jw3hi9f3zxyy3xln@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b91fc39f
  26. 04 5月, 2015 1 次提交
  27. 01 5月, 2015 1 次提交
  28. 08 4月, 2015 1 次提交
  29. 25 3月, 2015 1 次提交
  30. 24 3月, 2015 1 次提交