1. 10 3月, 2010 3 次提交
  2. 27 1月, 2010 1 次提交
  3. 16 1月, 2010 1 次提交
  4. 13 1月, 2010 1 次提交
    • A
      perf report: Fix --no-call-chain option handling · b9a63b9b
      Arnaldo Carvalho de Melo 提交于
      To avoid the funny:
      
       [root@doppio ~]# perf record -a -f sleep 2s
       [ perf record: Woken up 1 times to write data ]
       [ perf record: Captured and wrote 0.334 MB perf.data (~14572 samples) ]
       [root@doppio ~]# perf report --no-call-graph
       selected -g but no callchain data. Did you call perf record without -g?
      
      And fix the bug reported by peterz when we do indeed record with
      callchains and then ask for a report without:
      
      [root@doppio ~]# perf record -a -g -f sleep 2s
      [root@doppio ~]# perf report --no-call-graph
      Segmentation fault
      [root@doppio ~]#
      Reported-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1262699685-27820-1-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b9a63b9b
  5. 30 12月, 2009 1 次提交
  6. 28 12月, 2009 3 次提交
  7. 19 12月, 2009 1 次提交
    • A
      perf diff: Fix usage array, it must end with a NULL entry · 0422a4fc
      Arnaldo Carvalho de Melo 提交于
      Fixing this:
      
       [acme@doppio linux-2.6-tip]$ perf diff --hell
         Error: unknown option `hell'
      
        usage: perf diff [<options>] [old_file] [new_file]
       Segmentation fault
       [acme@doppio linux-2.6-tip]$
      
      Also go over the other such arrays to check if they all were OK,
      they are, but there were some minor changes to do like making
      one static and renaming another to match the command it refers
      to.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1261161358-23959-1-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0422a4fc
  8. 18 12月, 2009 1 次提交
    • A
      perf session: Make events_stats u64 to avoid overflow on 32-bit arches · b5b60fda
      Arnaldo Carvalho de Melo 提交于
      Pekka Enberg reported weird percentages in perf report. It
      turns out we are overflowing a 32-bit variables in struct
      events_stats on 32-bit architectures.
      
      Before:
      
       [acme@ana linux-2.6-tip]$ perf report -i pekka.perf.data 2> /dev/null | head -10
         281.96%       Xorg                        b710a561  [.] 0x000000b710a561
         140.15%       Xorg  [kernel]                        [k] __initramfs_end
          51.56%   metacity  libgobject-2.0.so.0.2000.1      [.] 0x00000000026e46
          35.12%  evolution  libcairo.so.2.10800.6           [.] 0x000000000203bd
          33.84%   metacity  libpthread-2.9.so               [.] 0x00000000007a3d
      
      After:
      
       [acme@ana linux-2.6-tip]$ perf report -i pekka.perf.data 2> /dev/null | head -10
          30.04%       Xorg                       b710a561   [.] 0x000000b710a561
          14.93%       Xorg  [kernel]                        [k] __initramfs_end
           5.49%   metacity  libgobject-2.0.so.0.2000.1      [.] 0x00000000026e46
           3.74%  evolution  libcairo.so.2.10800.6           [.] 0x000000000203bd
           3.61%   metacity  libpthread-2.9.so               [.] 0x00000000007a3d
      Reported-by: NPekka Enberg <penberg@cs.helsinki.fi>
      Tested-by: NPekka Enberg <penberg@cs.helsinki.fi>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1261148583-20395-1-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b5b60fda
  9. 16 12月, 2009 8 次提交
    • A
      perf diff: Use perf_session__fprintf_hists just like 'perf record' · c351c281
      Arnaldo Carvalho de Melo 提交于
      That means that almost everything you can do with 'perf report'
      can be done with 'perf diff', for instance:
      
      $ perf record -f find / > /dev/null
      [ perf record: Woken up 1 times to write data ]
      [ perf record: Captured and wrote 0.062 MB perf.data (~2699
      samples) ] $ perf record -f find / > /dev/null
      [ perf record: Woken up 1 times to write data ]
      [ perf record: Captured and wrote 0.062 MB perf.data (~2687
      samples) ] perf diff | head -8
           9.02%     +1.00%     find  libc-2.10.1.so               [.] _IO_vfprintf_internal
           2.91%     -1.00%     find  [kernel]                     [k] __kmalloc
           2.85%     -1.00%     find  [kernel]                     [k] ext4_htree_store_dirent
           1.99%     -1.00%     find  [kernel]                     [k] _atomic_dec_and_lock
           2.44%                find  [kernel]                     [k] half_md4_transform
      $
      
      So if you want to zoom into libc:
      
      $ perf diff --dsos libc-2.10.1.so | head -8
          37.34%                find  [.] _IO_vfprintf_internal
          10.34%                find  [.] __GI_memmove
           8.25%     +2.00%     find  [.] _int_malloc
           5.07%     -1.00%     find  [.] __GI_mempcpy
           7.62%     +2.00%     find  [.] _int_free
      $
      
      And if there were multiple commands using libc, it is also
      possible to aggregate them all by using --sort symbol:
      
      $ perf diff --dsos libc-2.10.1.so --sort symbol | head -8
          37.34%             [.] _IO_vfprintf_internal
          10.34%             [.] __GI_memmove
           8.25%     +2.00%  [.] _int_malloc
           5.07%     -1.00%  [.] __GI_mempcpy
           7.62%     +2.00%  [.] _int_free
      $
      
      The displacement column now is off by default, to use it:
      
      perf diff -m --dsos libc-2.10.1.so --sort symbol | head -8
          37.34%                   [.] _IO_vfprintf_internal
          10.34%                   [.] __GI_memmove
           8.25%     +2.00%        [.] _int_malloc
           5.07%     -1.00%    +2  [.] __GI_mempcpy
           7.62%     +2.00%    -1  [.] _int_free
      $
      
      Using -t/--field-separator can be used for scripting:
      
      $ perf diff -t, -m --dsos libc-2.10.1.so --sort symbol | head -8
      37.34, , ,[.] _IO_vfprintf_internal
      10.34, , ,[.] __GI_memmove
      8.25,+2.00%, ,[.] _int_malloc
      5.07,-1.00%,  +2,[.] __GI_mempcpy
      7.62,+2.00%,  -1,[.] _int_free
      6.99,+1.00%,  -1,[.] _IO_new_file_xsputn
      1.89,-2.00%,  +4,[.] __readdir64
      $
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260978567-550-1-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c351c281
    • A
      perf report: Fix cut'n'paste error recently introduced · 125c4fad
      Arnaldo Carvalho de Melo 提交于
      Introduced in:
      
      d599db3f
      "perf report: Generalize perf_session__fprintf_hists()"
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260973631-28035-3-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      125c4fad
    • A
      perf session: Move perf report specific hits out of perf_session__fprintf_hists · 3e6055ab
      Arnaldo Carvalho de Melo 提交于
      Those don't make sense for tools such as 'perf diff'.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260973631-28035-2-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3e6055ab
    • A
      perf tools: Move hist entries printing routines from perf report · 4ecf84d0
      Arnaldo Carvalho de Melo 提交于
      Will be used in other tools such as 'perf diff'.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260973631-28035-1-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4ecf84d0
    • A
      perf report: Generalize perf_session__fprintf_hists() · d599db3f
      Arnaldo Carvalho de Melo 提交于
      Pull it out of builtin-report - further changes will be made and it
      will then be reusable in 'perf diff' as well.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260914682-29652-4-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d599db3f
    • A
      perf symbols: Move symbol filtering to event__preprocess_sample() · c410a338
      Arnaldo Carvalho de Melo 提交于
      So that --dsos, --comm, --symbols can bem used in more tools,
      like in perf diff:
      
      $ perf record -f find / > /dev/null
      $ perf record -f find / > /dev/null
      $ perf diff --dsos /lib64/libc-2.10.1.so | head -5
         1        +22392124     /lib64/libc-2.10.1.so   _IO_vfprintf_internal
         2         +6410655     /lib64/libc-2.10.1.so   __GI_memmove
         3    +1   +9192692     /lib64/libc-2.10.1.so   _int_malloc
         4    -1  -15158605     /lib64/libc-2.10.1.so   _int_free
         5           +45669     /lib64/libc-2.10.1.so   _IO_new_file_xsputn
      $
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260914682-29652-3-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c410a338
    • A
      perf symbols: Adopt the strlists for dso, comm · 655000e7
      Arnaldo Carvalho de Melo 提交于
      Will be used in perf diff too.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260914682-29652-2-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      655000e7
    • A
      perf symbols: Make symbol_conf global · 75be6cf4
      Arnaldo Carvalho de Melo 提交于
      This simplifies a lot of functions, less stuff to be done by
      tool writers.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260914682-29652-1-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      75be6cf4
  10. 15 12月, 2009 5 次提交
  11. 14 12月, 2009 8 次提交
  12. 12 12月, 2009 1 次提交
    • A
      perf tools: Introduce perf_session class · 94c744b6
      Arnaldo Carvalho de Melo 提交于
      That does all the initialization boilerplate, opening the file,
      reading the header, checking if it is valid, etc.
      
      And that will as well have the threads list, kmap (now) global
      variable, etc, so that we can handle two (or more) perf.data files
      describing sessions to compare.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260573842-19720-1-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      94c744b6
  13. 07 12月, 2009 1 次提交
    • O
      perf: Make common SAMPLE_EVENT parser · 180f95e2
      OGAWA Hirofumi 提交于
      Currently, sample event data is parsed for each commands, and it
      is assuming that the data is not including other data. (E.g.
      timechart, trace, etc. can't parse the event if it has
      PERF_SAMPLE_CALLCHAIN)
      
      So, even if we record the superset data for multiple commands at
      a time, commands can't parse. etc.
      
      To fix it, this makes common sample event parser, and use it to
      parse sample event correctly. (PERF_SAMPLE_READ is unsupported
      for now though, it seems to be not using.)
      Signed-off-by: NOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <87hbs48imv.fsf@devron.myhome.or.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      180f95e2
  14. 28 11月, 2009 4 次提交
    • A
      perf tools: Consolidate symbol resolving across all tools · 1ed091c4
      Arnaldo Carvalho de Melo 提交于
      Now we have a very high level routine for simple tools to
      process IP sample events:
      
      	int event__preprocess_sample(const event_t *self,
      				     struct addr_location *al,
      				     symbol_filter_t filter)
      
      It receives the event itself and will insert new threads in the
      global threads list and resolve the map and symbol, filling all
      this info into the new addr_location struct, so that tools like
      annotate and report can further process the event by creating
      hist_entries in their specific way (with or without callgraphs,
      etc).
      
      It in turn uses the new next layer function:
      
      	void thread__find_addr_location(struct thread *self, u8 cpumode,
      					enum map_type type, u64 addr,
      					struct addr_location *al,
      					symbol_filter_t filter)
      
      This one will, given a thread (userspace or the kernel kthread
      one), will find the given type (MAP__FUNCTION now, MAP__VARIABLE
      too in the near future) at the given cpumode, taking vdsos into
      account (userspace hit, but kernel symbol) and will fill all
      these details in the addr_location given.
      
      Tools that need a more compact API for plain function
      resolution, like 'kmem', can use this other one:
      
      	struct symbol *thread__find_function(struct thread *self, u64 addr,
      					     symbol_filter_t filter)
      
      So, to resolve a kernel symbol, that is all the 'kmem' tool
      needs, its just a matter of calling:
      
      	sym = thread__find_function(kthread, addr, NULL);
      
      The 'filter' parameter is needed because we do lazy
      parsing/loading of ELF symtabs or /proc/kallsyms.
      
      With this we remove more code duplication all around, which is
      always good, huh? :-)
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1259346563-12568-12-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1ed091c4
    • A
      perf tools: Reorganize event processing routines, lotsa dups killed · 62daacb5
      Arnaldo Carvalho de Melo 提交于
      While implementing event__preprocess_sample, that will do all of
      the symbol lookup in one convenient function, I noticed that
      util/process_event.[ch] were not being used at all, then started
      looking if there were other functions that could be shared
      and...
      
      All those functions really don't need to receive offset + head,
      the only thing they did was common to all of them, so do it at
      one place instead.
      
      Stats about number of each type of event processed now is done
      in a central place.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1259346563-12568-11-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      62daacb5
    • A
      perf symbols: Support multiple symtabs in struct thread · 95011c60
      Arnaldo Carvalho de Melo 提交于
      Making the routines that were so far specific to the kernel maps
      useful for all threads.
      
      This is done by making the kernel maps be contained in a kernel
      "thread".
      
      This gets the kernel specific routines closer to the userspace
      counterparts, which will help in reducing the boilerplate for
      resolving a symbol, as will be demonstrated in the next patches.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1259346563-12568-9-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      95011c60
    • A
      perf symbols: Better support for multiple symbol tables per dso · 6a4694a4
      Arnaldo Carvalho de Melo 提交于
      By using an array of rb_roots in struct dso we can, from a
      struct map instance to get the right symbol rb_tree more easily.
      This way we can have just one symbol lookup method for struct
      map instances, map__find_symbol, instead of one per symtab type
      (functions, variables).
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1259346563-12568-6-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6a4694a4
  15. 24 11月, 2009 1 次提交