1. 17 8月, 2015 1 次提交
  2. 10 8月, 2015 1 次提交
  3. 04 8月, 2015 1 次提交
  4. 24 7月, 2015 3 次提交
  5. 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
  6. 04 5月, 2015 1 次提交
  7. 29 4月, 2015 2 次提交
    • A
      perf script: Add field option 'flags' to print sample flags · 400ea6d3
      Adrian Hunter 提交于
      Instruction tracing will typically have access to information about the
      instruction being executed for a particular ip sample.  Some of that
      information will be available in the 'flags' member of struct
      perf_sample.
      
      With the addition of transactions events synthesis to Instruction
      Tracing options, there is a need to be able easily to see the flags
      because they show whether the ip is at the start, commit or abort of a
      tranasaction.
      
      Consequently add an option to display the flags.
      
      The flags are "bcrosyiABEx" which stand for branch, call, return,
      conditional, system, asynchronous, interrupt, transaction abort, trace
      begin, trace end, and in transaction, respectively.
      
      Example using Intel PT:
      
      perf script -fip,time,event,sym,addr,flags
      
      ...
       1288.721584105: branches:u:   bo              401146 main =>           401152 main
       1288.721584105: transactions:   x                   0           401164 main
       1288.721584105: branches:u:   bx              40117c main =>           40119b main
       1288.721584105: branches:u:   box             4011a4 main =>           40117e main
       1288.721584105: branches:u:   bcx             401187 main =>           401094 g
      ...
       1288.721591645: branches:u:   bx              4010c4 g =>           4010cb g
       1288.721591645: branches:u:   brx             4010cc g =>           401189 main
       1288.721591645: transactions:                       0           4011a6 main
       1288.721593199: branches:u:   b               4011a9 main =>           4011af main
       1288.721593199: branches:u:   bo              4011bc main =>           40113e main
       1288.721593199: branches:u:   b               401150 main =>           40115a main
       1288.721593199: transactions:   x                   0           401164 main
       1288.721593199: branches:u:   bx              40117c main =>           40119b main
       1288.721593199: branches:u:   box             4011a4 main =>           40117e main
       1288.721593199: branches:u:   bcx             401187 main =>           40105e f
      ...
       1288.722284747: branches:u:   brx             401093 f =>           401189 main
       1288.722284747: branches:u:   box             4011a4 main =>           40117e main
       1288.722284747: branches:u:   bcx             401187 main =>           40105e f
       1288.722285883: transactions:   bA                  0           401071 f
       1288.722285883: branches:u:   bA              401071 f =>           40116a main
       1288.722285883: branches:u:   bE              40116a main =>                0 [unknown]
       1288.722297174: branches:u:   bB                   0 [unknown] =>           40116a main
      ...
      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: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1428594864-29309-26-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      400ea6d3
    • A
      perf script: Add Instruction Tracing support · 7a680eb9
      Adrian Hunter 提交于
      Add support for decoding an AUX area assuming it contains instruction
      tracing data.
      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: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1428594864-29309-17-git-send-email-adrian.hunter@intel.com
      [ Do not use -Z as an alternative to --itrace ]
      [ Fixed initialization of itrace_synth_opts struct fields on older gcc versions ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7a680eb9
  8. 03 4月, 2015 3 次提交
    • Y
      perf script: Support using -f to override perf.data file ownership · 06af0f2c
      Yunlong Song 提交于
      Enable perf script to use perf.data when it is not owned by current user
      or root. Change the short option name of --fields to -F to avoid confusion
      with --force.
      
      Example:
      
       # perf record ls
       # chown Yunlong.Song:Yunlong.Song perf.data
       # ls -al perf.data
       -rw------- 1 Yunlong.Song Yunlong.Song 28360 Apr  2 14:53 perf.data
       # id
       uid=0(root) gid=0(root) groups=0(root),64(pkcs11)
      
      Before this patch:
      
       # perf script
       File perf.data not owned by current user or root (use -f to override)
       # perf script -f
         Error: switch `f' requires a value
      
        usage: perf script [<options>]
           or: perf script [<options>] record <script> [<record-options>] <command>
           or: perf script [<options>] report <script> [script-args]
           or: perf script [<options>] <script> [<record-options>] <command>
           or: perf script [<options>] <top-script> [script-args]
      
           -f, --fields <str>    comma separated output fields prepend with
           'type:'. Valid types: hw,sw,trace,raw. Fields:
           comm,tid,pid,time,cpu,event,trace,ip,sym,dso,addr,symoff,period
      
      As shown above, the -f option does not work at all. And -f is already
      taken up by --fields, which makes --force confused, so change the short
      option name of --fields to -F like what other perf commands do (e.g.
      perf report -F) and use -f as the short option name of --force.
      
      After this patch:
      
       # perf script
       File perf.data not owned by current user or root (use -f to override)
       # perf script -f
       :41298 41298 2590086.564226:          1 cycles:  ffffffff8103efc6
       native_write_msr_safe ([kernel.kallsyms])
       :41298 41298 2590086.564244:          1 cycles:  ffffffff8103efc6
       native_write_msr_safe ([kernel.kallsyms])
       :41298 41298 2590086.564249:          7 cycles:  ffffffff8103efc6
       native_write_msr_safe ([kernel.kallsyms])
       :41298 41298 2590086.564255:        176 cycles:  ffffffff8103efc6
       native_write_msr_safe ([kernel.kallsyms])
           ls 41298 2590086.567346:       4059 cycles:  ffffffff8105a592
           raise_softirq ([kernel.kallsyms])
           ls 41298 2590086.567353:       3717 cycles:  ffffffff8105a592
           raise_softirq ([kernel.kallsyms])
           ls 41298 2590086.567358:      63058 cycles:  ffffffff8105a592
           raise_softirq ([kernel.kallsyms])
           ls 41298 2590086.567448:    1706255 cycles:            406ae0
           [unknown] (/usr/bin/ls)
      
      As shown above, the -f option really works now.
      Signed-off-by: NYunlong Song <yunlong.song@huawei.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1427982439-27388-8-git-send-email-yunlong.song@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      06af0f2c
    • A
      perf scripting: No need to pass thread twice to the scripting callbacks · f9d5d549
      Arnaldo Carvalho de Melo 提交于
      It is already in the addr_location, so remove the redundant 'thread'
      parameter from the callback signatures.
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      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: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1427906210-10519-3-git-send-email-acme@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f9d5d549
    • A
      perf script: No need to lookup thread twice · 79628f2c
      Arnaldo Carvalho de Melo 提交于
      We get the thread when we call perf_event__preprocess_sample(), no need
      to do it before that.
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      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: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1427906210-10519-2-git-send-email-acme@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      79628f2c
  9. 25 3月, 2015 1 次提交
  10. 20 3月, 2015 1 次提交
  11. 11 3月, 2015 1 次提交
  12. 29 10月, 2014 2 次提交
  13. 18 10月, 2014 2 次提交
    • J
      perf script: Add period as a default output column · e8564b71
      Jiri Olsa 提交于
      Adding period as a default output column in script command fo hardware,
      software and raw events.
      
      If PERF_SAMPLE_PERIOD sample type is defined in perf.data, following
      will be displayed in perf script output:
      
        $ perf script
                    ls  8034 57477.887209:     250000 task-clock:  ffffffff81361d72 memset ([kernel.kallsyms])
                    ls  8034 57477.887464:     250000 task-clock:  ffffffff816f6d92 _raw_spin_unlock_irqrestore ([kernel.kallsyms])
                    ls  8034 57477.887708:     250000 task-clock:  ffffffff811a94f0 do_munmap ([kernel.kallsyms])
                    ls  8034 57477.887959:     250000 task-clock:        34080916c6 get_next_seq (/usr/lib64/libc-2.17.so)
                    ls  8034 57477.888208:     250000 task-clock:        3408079230 _IO_doallocbuf (/usr/lib64/libc-2.17.so)
                    ls  8034 57477.888717:     250000 task-clock:  ffffffff814242c8 n_tty_write ([kernel.kallsyms])
                    ls  8034 57477.889285:     250000 task-clock:        3408076402 fwrite_unlocked (/usr/lib64/libc-2.17.so)
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: "Jen-Cheng(Tommy) Huang" <tommy24@gatech.edu>
      Cc: Andi Kleen <andi@firstfloor.org>
      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: Jen-Cheng(Tommy) Huang <tommy24@gatech.edu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1408977943-16594-10-git-send-email-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e8564b71
    • J
      perf script: Add period data column · 535aeaae
      Jiri Olsa 提交于
      Adding period data column to be displayed in perf script.  It's possible
      to get period values using -f option, like:
      
        $ perf script -f comm,tid,time,period,ip,sym,dso
                :26019 26019 52414.329088:       3707  ffffffff8105443a native_write_msr_safe ([kernel.kallsyms])
                :26019 26019 52414.329088:         44  ffffffff8105443a native_write_msr_safe ([kernel.kallsyms])
                :26019 26019 52414.329093:       1987  ffffffff8105443a native_write_msr_safe ([kernel.kallsyms])
                :26019 26019 52414.329093:          6  ffffffff8105443a native_write_msr_safe ([kernel.kallsyms])
                    ls 26019 52414.329442:     537558        3407c0639c _dl_map_object_from_fd (/usr/lib64/ld-2.17.so)
                    ls 26019 52414.329442:       2099        3407c0639c _dl_map_object_from_fd (/usr/lib64/ld-2.17.so)
                    ls 26019 52414.330181:    1242100        34080917bb get_next_seq (/usr/lib64/libc-2.17.so)
                    ls 26019 52414.330181:       3774        34080917bb get_next_seq (/usr/lib64/libc-2.17.so)
                    ls 26019 52414.331427:    1083662  ffffffff810c7dc2 update_curr ([kernel.kallsyms])
                    ls 26019 52414.331427:        360  ffffffff810c7dc2 update_curr ([kernel.kallsyms])
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Acked-by: NDavid Ahern <dsahern@gmail.com>
      Cc: "Jen-Cheng(Tommy) Huang" <tommy24@gatech.edu>
      Cc: Andi Kleen <andi@firstfloor.org>
      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: Jen-Cheng(Tommy) Huang <tommy24@gatech.edu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1408977943-16594-9-git-send-email-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      535aeaae
  14. 09 10月, 2014 1 次提交
  15. 26 9月, 2014 1 次提交
  16. 23 8月, 2014 1 次提交
  17. 14 8月, 2014 4 次提交
  18. 12 8月, 2014 1 次提交
  19. 25 7月, 2014 1 次提交
  20. 23 7月, 2014 2 次提交
  21. 13 1月, 2014 1 次提交
  22. 28 12月, 2013 1 次提交
  23. 20 12月, 2013 1 次提交
    • A
      perf symbols: Add 'machine' member to struct addr_location · cc22e575
      Arnaldo Carvalho de Melo 提交于
      The addr_location struct should fully qualify an address, and to do that
      it should have in it the machine where the thread was found.
      
      Thus all functions that receive an addr_location now don't need to also
      receive a 'machine', those functions just need to access al->machine
      instead, just like it does with the other parts of an address location:
      al->thread, al->map, etc.
      
      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: 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-o51iiee7vyq4r3k362uvuylg@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cc22e575
  24. 11 12月, 2013 1 次提交
  25. 10 12月, 2013 1 次提交
    • A
      perf script: Add an option to print the source line number · cc8fae1d
      Adrian Hunter 提交于
      Add field 'srcline' that displays the source file name and line number
      associated with the sample ip.  The information displayed is the same as
      from addr2line.
      
       $ perf script -f comm,tid,pid,time,ip,sym,dso,symoff,srcline
                  grep 10701/10701 2497321.421013:  ffffffff81043ffa native_write_msr_safe+0xa ([kernel.kallsyms])
        /usr/src/debug/kernel-3.9.fc17/linux-3.9.10-100.fc17.x86_64/arch/x86/include/asm/msr.h:95
                  grep 10701/10701 2497321.421984:  ffffffff8165b6b3 _raw_spin_lock+0x13 ([kernel.kallsyms])
        /usr/src/debug/kernel-3.9.fc17/linux-3.9.10-100.fc17.x86_64/arch/x86/include/asm/spinlock.h:54
                  grep 10701/10701 2497321.421990:  ffffffff810b64b3 tick_sched_timer+0x53 ([kernel.kallsyms])
        /usr/src/debug/kernel-3.9.fc17/linux-3.9.10-100.fc17.x86_64/kernel/time/tick-sched.c:840
                  grep 10701/10701 2497321.421992:  ffffffff8106f63f run_timer_softirq+0x2f ([kernel.kallsyms])
        /usr/src/debug/kernel-3.9.fc17/linux-3.9.10-100.fc17.x86_64/kernel/timer.c:1372
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.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 <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1386315778-11633-3-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cc8fae1d
  26. 05 12月, 2013 2 次提交
  27. 28 11月, 2013 2 次提交