1. 22 11月, 2009 1 次提交
  2. 20 11月, 2009 1 次提交
    • L
      perf: Add 'perf kmem' tool · ba77c9e1
      Li Zefan 提交于
      This tool is mostly a perf version of kmemtrace-user.
      
      The following information is provided by this tool:
      
       - the total amount of memory allocated and fragmentation per
         call-site
      
       - the total amount of memory allocated and fragmentation per
         allocation
      
       - total memory allocated and fragmentation in the collected
         dataset - ...
      
      Sample output:
      
       # ./perf kmem record
       ^C
       # ./perf kmem --stat caller --stat alloc -l 10
      
       ------------------------------------------------------------------------------
       Callsite          | Total_alloc/Per |  Total_req/Per  |  Hit   | Fragmentation
       ------------------------------------------------------------------------------
       0xc052f37a        |   790528/4096   |   790528/4096   |    193 |    0.000%
       0xc0541d70        |   524288/4096   |   524288/4096   |    128 |    0.000%
       0xc051cc68        |   481600/200    |   481600/200    |   2408 |    0.000%
       0xc0572623        |   297444/676    |   297440/676    |    440 |    0.001%
       0xc05399f1        |    73476/164    |    73472/164    |    448 |    0.005%
       0xc05243bf        |    51456/256    |    51456/256    |    201 |    0.000%
       0xc0730d0e        |    31844/497    |    31808/497    |     64 |    0.113%
       0xc0734c4e        |    17152/256    |    17152/256    |     67 |    0.000%
       0xc0541a6d        |    16384/128    |    16384/128    |    128 |    0.000%
       0xc059c217        |    13120/40     |    13120/40     |    328 |    0.000%
       0xc0501ee6        |    11264/88     |    11264/88     |    128 |    0.000%
       0xc04daef0        |     7504/682    |     7128/648    |     11 |    5.011%
       0xc04e14a3        |     4216/191    |     4216/191    |     22 |    0.000%
       0xc05041ca        |     3524/44     |     3520/44     |     80 |    0.114%
       0xc0734fa3        |     2104/701    |     1620/540    |      3 |   23.004%
       0xc05ec9f1        |     2024/289    |     2016/288    |      7 |    0.395%
       0xc06a1999        |     1792/256    |     1792/256    |      7 |    0.000%
       0xc0463b9a        |     1584/144    |     1584/144    |     11 |    0.000%
       0xc0541eb0        |     1024/16     |     1024/16     |     64 |    0.000%
       0xc06a19ac        |      896/128    |      896/128    |      7 |    0.000%
       0xc05721c0        |      772/12     |      768/12     |     64 |    0.518%
       0xc054d1e6        |      288/57     |      280/56     |      5 |    2.778%
       0xc04b562e        |      157/31     |      154/30     |      5 |    1.911%
       0xc04b536f        |       80/16     |       80/16     |      5 |    0.000%
       0xc05855a0        |       64/64     |       36/36     |      1 |   43.750%
       ------------------------------------------------------------------------------
      
       ------------------------------------------------------------------------------
       Alloc Ptr         | Total_alloc/Per |  Total_req/Per  |  Hit   | Fragmentation
       ------------------------------------------------------------------------------
       0xda884000        |  1052672/4096   |  1052672/4096   |    257 |    0.000%
       0xda886000        |   262144/4096   |   262144/4096   |     64 |    0.000%
       0xf60c7c00        |    16512/128    |    16512/128    |    129 |    0.000%
       0xf59a4118        |    13120/40     |    13120/40     |    328 |    0.000%
       0xdfd4b2c0        |    11264/88     |    11264/88     |    128 |    0.000%
       0xf5274600        |     7680/256    |     7680/256    |     30 |    0.000%
       0xe8395000        |     5948/594    |     5464/546    |     10 |    8.137%
       0xe59c3c00        |     5748/479    |     5712/476    |     12 |    0.626%
       0xf4cd1a80        |     3524/44     |     3520/44     |     80 |    0.114%
       0xe5bd1600        |     2892/482    |     2856/476    |      6 |    1.245%
       ...               | ...             | ...             | ...    | ...
       ------------------------------------------------------------------------------
      
      SUMMARY
      =======
      Total bytes requested: 2333626
      Total bytes allocated: 2353712
      Total bytes wasted on internal fragmentation: 20086
      Internal fragmentation: 0.853375%
      
      TODO:
      - show sym+offset in 'callsite' column
      - show cross node allocation stats
      - collect more useful stats?
      - ...
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Acked-by: NPekka Enberg <penberg@cs.helsinki.fi>
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
      Cc: linux-mm@kvack.org <linux-mm@kvack.org>
      LKML-Reference: <4B064AF5.9060208@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ba77c9e1
  3. 19 11月, 2009 1 次提交
  4. 17 11月, 2009 2 次提交
    • M
      perf tools: Support static build · 75138650
      Michael S. Tsirkin 提交于
      This makes it possible to build perf statically, by
      performing:
      
        make LDFLAGS=-static
      
      Since static libraries are only searched in the order they are
      specified, move library list from LDFLAGS to EXTLIBS, so that
      they are put at the end of linker command line.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <20091029152002.GA5406@redhat.com>
      [ v2: resolved conflicts ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      75138650
    • A
      perf buildid-list: New plumbing command · c34984b2
      Arnaldo Carvalho de Melo 提交于
      With this we can list the buildids in a perf.data file so that
      we can pipe them to other, distro specific tools that from the
      buildids can figure out separate packages (foo-debuginfo) where
      we can find the matching symtabs so that perf report can do its
      job.
      
      E.g:
      
      [acme@doppio linux-2.6-tip]$ perf buildid-list | head -5
      8e08b117e5458ad3f85da16d42d0fc5cd21c5869
      520c2387a587cc5acfcf881e27dba1caaeab4b1f
      ec8dd400904ddfcac8b1c343263a790f977159dc
      7caedbca5a6d8ab39a7fe44bd28c07d3e14a3f3f
      379bb828fd08859dbea73279f04abefabc95a6a3
      [acme@doppio linux-2.6-tip]$ perf buildid-list -v | head -5
      8e08b117e5458ad3f85da16d42d0fc5cd21c5869 /sbin/init
      520c2387a587cc5acfcf881e27dba1caaeab4b1f /lib64/ld-2.10.1.so
      ec8dd400904ddfcac8b1c343263a790f977159dc /lib64/libc-2.10.1.so
      7caedbca5a6d8ab39a7fe44bd28c07d3e14a3f3f /sbin/udevd
      379bb828fd08859dbea73279f04abefabc95a6a3 /lib64/libdl-2.10.1.so
      [acme@doppio linux-2.6-tip]$
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <1258396365-29217-5-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c34984b2
  5. 11 11月, 2009 1 次提交
  6. 09 11月, 2009 1 次提交
  7. 08 11月, 2009 1 次提交
  8. 27 10月, 2009 1 次提交
    • A
      perf tools: Generalize event synthesizing routines · 234fbbf5
      Arnaldo Carvalho de Melo 提交于
      Because we will need it in 'perf top' to support userspace
      symbols for existing threads.
      
      Now we pass a callback that will receive the synthesized event
      and then write it to the output file in 'perf record' and in the
      upcoming patch for 'perf top' we will just immediatelly create
      the in memory representation of threads and maps.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Mike Galbraith <efault@gmx.de>
      LKML-Reference: <1256592199-9608-2-git-send-email-acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      234fbbf5
  9. 26 10月, 2009 2 次提交
    • P
      perf tools: Remove -Wcast-align · ec29b8d2
      Paul Mundt 提交于
      The present use of -Wcast-align causes the build to blow up on
      SH due to generating a "cast increases required alignment of
      target type" error on each invocation of list_for_each_entry().
      
      It seems that this was previously reported and killed off in the
      ia64 support patch, but nothing seems to have happened with
      that. Presumably the same problem still remains there, too.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      LKML-Reference: <20091026054000.GA13517@linux-sh.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ec29b8d2
    • M
      perf tools: Fix compatibility with libelf 0.8 and autodetect · 84087126
      Marti Raudsepp 提交于
      The Makefile now automatically defines LIBELF_NO_MMAP when
      libelf 0.8.x is detected. libelf 0.8 is still maintained and
      some distributions such as Arch Linux use it instead of
      elfutils.
      Signed-off-by: NMarti Raudsepp <marti@juffo.org>
      Cc: Lucas De Marchi <lucas.de.marchi@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Mike Galbraith <efault@gmx.de>
      LKML-Reference: <1256400636.3007.16.camel@newn>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      84087126
  10. 23 10月, 2009 1 次提交
    • F
      perf tools: Drop asm/types.h wrapper · 802da5f2
      Frederic Weisbecker 提交于
      Wrapping the kernel headers is dangerous when it comes to arch
      headers. Once we wrap asm/types.h, it will also replace the
      glibc asm/types.h, not only the kernel one.
      
      This results in build errors on some machines.
      
      Drop this wrapper and do its work from linux/types.h wrapper,
      also the glibc asm/types.h can already handle most of the type
      definition it was doing (typedef __u64, __u32, etc...).
      
      Todo: Check the others asm/*.h wrappers to prevent from other
      conflicts.
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Anton Blanchard <anton@samba.org>
      LKML-Reference: <1256246604-17156-3-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      802da5f2
  11. 21 10月, 2009 1 次提交
    • S
      perf tools: Add 'make DEBUG=1' to remove the -O6 cflag · 60d526f7
      Steven Rostedt 提交于
      When using gdb to debug perf, it is practically impossible to
      use when perf is compiled with -O6. For developers, this patch
      adds the DEBUG feature to the make command line so that a
      developer can easily remove the optimization flag.
      
      LKML-Reference: <1255590330.8392.446.camel@twins>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <20091020232033.984323261@goodmis.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      60d526f7
  12. 20 10月, 2009 2 次提交
  13. 19 10月, 2009 2 次提交
  14. 17 10月, 2009 2 次提交
    • M
      perf: Add DIE_IF() macro for error checking · 9769833b
      Masami Hiramatsu 提交于
      Add DIE_IF() macro and replace ERR_IF() with it, and use
      linux/stringify.h.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <20091017000818.16556.82452.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      9769833b
    • M
      perf: Check libdwarf APIs for perf probe · 4c20194c
      Masami Hiramatsu 提交于
      Check libdwarf APIs for perf probe in tools/perf/Makefile. Since
      dwarf_get_ranges() has been added from libdwarf 20081231 (and
      it's the newest function used in probe-finder.c), this just
      checks whether the function is defined.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <20091017000752.16556.92051.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4c20194c
  15. 13 10月, 2009 2 次提交
    • M
      perf probe: Add perf probe command support without libdwarf · 23e8ec0d
      Masami Hiramatsu 提交于
      Enables 'perf probe' even if libdwarf is not installed. If libdwarf is
      not found, 'perf probe' just disables dwarf support. Users can use
      'perf probe' to set up new events by using kprobe_events format.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      LKML-Reference: <20091007222830.1684.25665.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      23e8ec0d
    • M
      perf: Add perf probe subcommand, a kprobe-event setup helper · 4ea42b18
      Masami Hiramatsu 提交于
      Add perf probe subcommand that implements a kprobe-event setup helper
      to the perf command.
      This allows user to define kprobe events using C expressions (C line
      numbers, C function names, and C local variables).
      
      Usage
      -----
       perf probe [<options>] -P 'PROBEDEF' [-P 'PROBEDEF' ...]
      
          -k, --vmlinux <file>  vmlinux/module pathname
          -P, --probe <p|r:[GRP/]NAME FUNC[+OFFS][@src]|@src:LINE [ARG ...]>
                                probe point definition, where
      		p:	kprobe probe
      		r:	kretprobe probe
      		GRP:	Group name (optional)
      		NAME:	Event name
      		FUNC:	Function name
      		OFFS:	Offset from function entry (in byte)
      		SRC:	Source code path
      		LINE:	Line number
      		ARG:	Probe argument (local variable name or
      			kprobe-tracer argument format is supported.)
      
      Changes in v4:
       - Add _GNU_SOURCE macro for strndup().
      
      Changes in v3:
       - Remove -r option because perf always be used for online kernel.
       - Check malloc/calloc results.
      
      Changes in v2:
       - Check synthesized string length.
       - Rename perf kprobe to perf probe.
       - Use spaces for separator and update usage comment.
       - Check error paths in parse_probepoint().
       - Check optimized-out variables.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      LKML-Reference: <20091008211737.29299.14784.stgit@dhcp-100-2-132.bos.redhat.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      4ea42b18
  16. 12 10月, 2009 1 次提交
    • I
      perf tools: Fix the NO_64BIT build on pure 64-bit systems · 55621ccf
      Ingo Molnar 提交于
      Randy Dunlap reported that 'make NO_64BIT=1' fails to build
      a pure 32-b it binary on 64-bit/64-bit x86 systems.
      
      The reason is that we dont pass in the -m32 and GCC defaults
      to -m64.
      
      So pass it in - and also extend the warning message about libelf
      dependencies - glibc-dev[el] is needed as well beyond the libelf
      library.
      Reported-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: Message-Id: <20091005131729.78444bfb.randy.dunlap@oracle.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      55621ccf
  17. 08 10月, 2009 1 次提交
    • F
      perf tools: Unify perf.data mapping and events handling · 016e92fb
      Frederic Weisbecker 提交于
      This librarizes the perf.data file mapping and handling in various
      perf tools, roughly reducing the amount of code and fixing the
      places that mmap from beginning of the file whereas we want to mmap
      from the beginning of the data, leading to page fault because the
      mmap window is too small since the trace info are written in the
      file too.
      
      TODO:
      
       - convert perf timechart too
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arjan van de Ven <arjan@infradead.org>
      LKML-Reference: <20091007104729.GD5043@nowhere>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      016e92fb
  18. 05 10月, 2009 1 次提交
    • A
      perf tools: Remove show_mask bitmask · ec218fc4
      Arnaldo Carvalho de Melo 提交于
      As it was not being exposed via any command line and with --dsos/--comms
      we can do this and even more, like asking for just kernel + some module:
      
      [root@doppio linux-2.6-tip]# perf report --dsos \[kernel\],\[drm\]
      --vmlinux /home/acme/git/build/tip-recvmmsg/vmlinux --modules | head -15
       # Samples: 619669
       #
       # Overhead          Command  Shared Object  Symbol
       # ........  ...............  .............  ......
       #
            7.12%          swapper  [kernel]       [k] read_hpet
            6.86%             init  [kernel]       [k] read_hpet
            6.22%             init  [kernel]       [k] mwait_idle_with_hints
            5.34%          swapper  [kernel]       [k] mwait_idle_with_hints
            3.01%          firefox  [kernel]       [.] vread_hpet
            2.14%             Xorg  [drm]          [k] drm_clflush_pages
            2.09%           pidgin  [kernel]       [.] vread_hpet
            1.58%     npviewer.bin  [kernel]       [.] vread_hpet
            1.37%          swapper  [kernel]       [k] hpet_next_event
            1.23%             Xorg  [kernel]       [k] read_hpet
      [root@doppio linux-2.6-tip]#
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      LKML-Reference: <20091003233048.GA30535@ghostprotocols.net>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ec218fc4
  19. 02 10月, 2009 1 次提交
    • A
      perf tools: Rewrite and improve support for kernel modules · 439d473b
      Arnaldo Carvalho de Melo 提交于
      Representing modules as struct map entries, backed by a DSO, etc,
      using /proc/modules to find where the module is loaded.
      
      DSOs now can have a short and long name, so that in verbose mode we
      can show exactly which .ko or vmlinux image was used.
      
      As kernel modules now are a DSO separate from the kernel, we can
      ask for just the hits for a particular set of kernel modules, just
      like we can do with shared libraries:
      
      [root@doppio linux-2.6-tip]# perf report -n --vmlinux
      /home/acme/git/build/tip-recvmmsg/vmlinux --modules --dsos \[drm\] | head -15
          84.58%      13266             Xorg  [k] drm_clflush_pages
           4.02%        630             Xorg  [k] trace_kmalloc.clone.0
           3.95%        619             Xorg  [k] drm_ioctl
           2.07%        324             Xorg  [k] drm_addbufs
           1.68%        263             Xorg  [k] drm_gem_close_ioctl
           0.77%        120             Xorg  [k] drm_setmaster_ioctl
           0.70%        110             Xorg  [k] drm_lastclose
           0.68%        106             Xorg  [k] drm_open
           0.54%         85             Xorg  [k] drm_mm_search_free
      [root@doppio linux-2.6-tip]#
      
      Specifying --dsos /lib/modules/2.6.31-tip/kernel/drivers/gpu/drm/drm.ko
      would have the same effect. Allowing specifying just 'drm.ko' is left
      for another patch.
      
      Processing kallsyms so that per kernel module struct map are
      instantiated was also left for another patch. That will allow
      removing the module name from each of its symbols.
      
      struct symbol was reduced by removing the ->module backpointer and
      moving it (well now the map) to struct symbol_entry in perf top,
      that is its only user right now.
      
      The total linecount went down by ~500 lines.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Avi Kivity <avi@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      439d473b
  20. 01 10月, 2009 1 次提交
  21. 30 9月, 2009 2 次提交
    • A
      perf tools: Use rb_tree for maps · 1b46cddf
      Arnaldo Carvalho de Melo 提交于
      Threads can have many and kernel modules will be represented as a
      tree of maps as well.
      
      Ah, and for a perf.data with 146607 samples:
      
      Before:
      
      [root@doppio ~]# perf stat -r 5 perf report > /dev/null
      
       Performance counter stats for 'perf report' (5 runs):
      
           699.823680  task-clock-msecs         #      0.991 CPUs    ( +-   0.454% )
                   74  context-switches         #      0.000 M/sec   ( +-   1.709% )
                    2  CPU-migrations           #      0.000 M/sec   ( +-  17.008% )
                23114  page-faults              #      0.033 M/sec   ( +-   0.000% )
           1381257019  cycles                   #   1973.721 M/sec   ( +-   0.290% )
           1456894438  instructions             #      1.055 IPC     ( +-   0.007% )
             18779818  cache-references         #     26.835 M/sec   ( +-   0.380% )
               641799  cache-misses             #      0.917 M/sec   ( +-   1.200% )
      
          0.705972729  seconds time elapsed   ( +-   0.501% )
      
      [root@doppio ~]#
      
      After
      
       Performance counter stats for 'perf report' (5 runs):
      
           691.261451  task-clock-msecs         #      0.993 CPUs    ( +-   0.307% )
                   72  context-switches         #      0.000 M/sec   ( +-   0.829% )
                    6  CPU-migrations           #      0.000 M/sec   ( +-  18.409% )
                23127  page-faults              #      0.033 M/sec   ( +-   0.000% )
           1366395876  cycles                   #   1976.670 M/sec   ( +-   0.153% )
           1443136016  instructions             #      1.056 IPC     ( +-   0.012% )
             17956402  cache-references         #     25.976 M/sec   ( +-   0.325% )
               661924  cache-misses             #      0.958 M/sec   ( +-   1.335% )
      
          0.696127275  seconds time elapsed   ( +-   0.377% )
      
      I.e. we see some speedup too.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      LKML-Reference: <20090928174846.GA3361@ghostprotocols.net>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1b46cddf
    • J
      perf tools: Put common histogram functions in their own file · 3d1d07ec
      John Kacur 提交于
      Move histogram related functions into their own files (hist.c and
      hist.h) and make use of them in builtin-annotate.c and
      builtin-report.c.
      Signed-off-by: NJohn Kacur <jkacur@redhat.com>
      Acked-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <alpine.LFD.2.00.0909281531180.8316@localhost.localdomain>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3d1d07ec
  22. 25 9月, 2009 1 次提交
  23. 21 9月, 2009 1 次提交
    • I
      perf: Do the big rename: Performance Counters -> Performance Events · cdd6c482
      Ingo Molnar 提交于
      Bye-bye Performance Counters, welcome Performance Events!
      
      In the past few months the perfcounters subsystem has grown out its
      initial role of counting hardware events, and has become (and is
      becoming) a much broader generic event enumeration, reporting, logging,
      monitoring, analysis facility.
      
      Naming its core object 'perf_counter' and naming the subsystem
      'perfcounters' has become more and more of a misnomer. With pending
      code like hw-breakpoints support the 'counter' name is less and
      less appropriate.
      
      All in one, we've decided to rename the subsystem to 'performance
      events' and to propagate this rename through all fields, variables
      and API names. (in an ABI compatible fashion)
      
      The word 'event' is also a bit shorter than 'counter' - which makes
      it slightly more convenient to write/handle as well.
      
      Thanks goes to Stephane Eranian who first observed this misnomer and
      suggested a rename.
      
      User-space tooling and ABI compatibility is not affected - this patch
      should be function-invariant. (Also, defconfigs were not touched to
      keep the size down.)
      
      This patch has been generated via the following script:
      
        FILES=$(find * -type f | grep -vE 'oprofile|[^K]config')
      
        sed -i \
          -e 's/PERF_EVENT_/PERF_RECORD_/g' \
          -e 's/PERF_COUNTER/PERF_EVENT/g' \
          -e 's/perf_counter/perf_event/g' \
          -e 's/nb_counters/nb_events/g' \
          -e 's/swcounter/swevent/g' \
          -e 's/tpcounter_event/tp_event/g' \
          $FILES
      
        for N in $(find . -name perf_counter.[ch]); do
          M=$(echo $N | sed 's/perf_counter/perf_event/g')
          mv $N $M
        done
      
        FILES=$(find . -name perf_event.*)
      
        sed -i \
          -e 's/COUNTER_MASK/REG_MASK/g' \
          -e 's/COUNTER/EVENT/g' \
          -e 's/\<event\>/event_id/g' \
          -e 's/counter/event/g' \
          -e 's/Counter/Event/g' \
          $FILES
      
      ... to keep it as correct as possible. This script can also be
      used by anyone who has pending perfcounters patches - it converts
      a Linux kernel tree over to the new naming. We tried to time this
      change to the point in time where the amount of pending patches
      is the smallest: the end of the merge window.
      
      Namespace clashes were fixed up in a preparatory patch - and some
      stylistic fallout will be fixed up in a subsequent patch.
      
      ( NOTE: 'counters' are still the proper terminology when we deal
        with hardware registers - and these sed scripts are a bit
        over-eager in renaming them. I've undone some of that, but
        in case there's something left where 'counter' would be
        better than 'event' we can undo that on an individual basis
        instead of touching an otherwise nicely automated patch. )
      Suggested-by: NStephane Eranian <eranian@google.com>
      Acked-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Acked-by: NPaul Mackerras <paulus@samba.org>
      Reviewed-by: NArjan van de Ven <arjan@linux.intel.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: <linux-arch@vger.kernel.org>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      cdd6c482
  24. 19 9月, 2009 2 次提交
  25. 13 9月, 2009 1 次提交
    • I
      perf: Add 'perf sched' tool · 0a02ad93
      Ingo Molnar 提交于
      This turn-key tool allows scheduler measurements to be
      conducted and the results be displayed numerically.
      
      First baby step towards that goal: clone the new command off of
      perf trace.
      
      Fix a few other details along the way:
      
       - add (minimal) perf trace documentation
      
       - reorder a few places
      
       - list perf trace in the mainporcelain list as well
         as it's a very useful utility.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0a02ad93
  26. 02 9月, 2009 1 次提交
    • I
      perf tools: Clean up warnings list in the Makefile · 61562445
      Ingo Molnar 提交于
      Make it easier to turn warnings on/off by using a separate
      line for each warning added.
      
      Some of the warnings have too much of a nuisance factor and
      we might want to turn them off in the future.
      
      Cc: Arjan van de Ven <arjan@infradead.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      61562445
  27. 17 8月, 2009 1 次提交
    • F
      perf tools: Add perf trace · 5f9c39dc
      Frederic Weisbecker 提交于
      This adds perf trace into the set of perf tools.
      
      It is written to fetch the tracepoint samples from perf events
      and display them, according to the events information given by
      the debugfs files through the util/trace* tools.
      
      It is a rough first shot and doesn't yet handle the cpu,
      timestamps fields and some other things.
      
      Example:
      
       perf record -f -e workqueue:workqueue_execution:record -F 1 -a
       perf trace
      
             kblockd/0-236   [000]     0.000000: workqueue_execution: thread=:236 func=cfq_kick_queue+0x0
           kondemand/0-360   [000]     0.000000: workqueue_execution: thread=:360 func=do_dbs_timer+0x0
           kondemand/0-360   [000]     0.000000: workqueue_execution: thread=:360 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
           kondemand/1-361   [000]     0.000000: workqueue_execution: thread=:361 func=do_dbs_timer+0x0
      
      Todo:
      
      - A lot of things!
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: "Luis Claudio R. Goncalves" <lclaudio@uudg.org>
      Cc: Clark Williams <williams@redhat.com>
      Cc: Jon Masters <jonathan@jonmasters.org>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Cc: Zhaolei <zhaolei@cn.fujitsu.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
      Cc: Masami Hiramatsu <mhiramat@redhat.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: "Frank Ch. Eigler" <fche@redhat.com>
      Cc: Roland McGrath <roland@redhat.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Jiaying Zhang <jiayingz@google.com>
      Cc: Anton Blanchard <anton@samba.org>
      LKML-Reference: <1250518688-7207-4-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5f9c39dc
  28. 16 8月, 2009 3 次提交
    • F
      perf tools: Substract -Wformat-nonliteral from Wformat=2 in extra flags · 0d31b82d
      Frederic Weisbecker 提交于
      The soon coming perf trace needs to use printf with dynamically
      built formats.
      
      But we are using -Wformat=2 which is a shortcut for the
      following set: -Wformat -Wformat-security -Wformat-y2k
      -Wformat-nonliteral
      
      -Wformat-nonliteral warns when it can't check formats because
      they are not builtin constant strings, but we want to feature
      dynamic formats. What we want instead is Wformat=2 minus
      -Wformat-nonliteral, which is what this patch does.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      LKML-Reference: <1250437927-25490-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0d31b82d
    • I
      perf: Build with stack-protector and with -D_FORTIFY_SOURCE=2 · 35ba15b7
      Ingo Molnar 提交于
      Up our defences a bit.
      Suggested-by: NArjan van de Ven <arjan@infradead.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      35ba15b7
    • I
      perf: Enable more compiler warnings · 83a0944f
      Ingo Molnar 提交于
      Related to a shadowed variable bug fix Valdis Kletnieks noticed
      that perf does not get built with -Wshadow, which could have
      helped us avoid the bug.
      
      So enable -Wshadow and also enable the following warnings on
      perf builds, in addition to the already enabled -Wall -Wextra
      -std=gnu99 warnings:
      
       -Wcast-align
       -Wformat=2
       -Wshadow
       -Winit-self
       -Wpacked
       -Wredundant-decls
       -Wstack-protector
       -Wstrict-aliasing=3
       -Wswitch-default
       -Wswitch-enum
       -Wno-system-headers
       -Wundef
       -Wvolatile-register-var
       -Wwrite-strings
       -Wbad-function-cast
       -Wmissing-declarations
       -Wmissing-prototypes
       -Wnested-externs
       -Wold-style-definition
       -Wstrict-prototypes
       -Wdeclaration-after-statement
      
      And change/fix the perf code to build cleanly under GCC 4.3.2.
      
      The list of warnings enablement is rather arbitrary: it's based
      on my (quick) reading of the GCC manpages and trying them on
      perf.
      
      I categorized the warnings based on individually enabling them
      and looking whether they trigger something in the perf build.
      If i liked those warnings (i.e. if they trigger for something
      that arguably could be improved) i enabled the warning.
      
      If the warnings seemed to come from language laywers spamming
      the build with tons of nuisance warnings i generally kept them
      off. Most of the sign conversion related warnings were in
      this category. (A second patch enabling some of the sign
      warnings might be welcome - sign bugs can be nasty.)
      
      I also kept warnings that seem to make sense from their manpage
      description and which produced no actual warnings on our code
      base. These warnings might still be turned off if they end up
      being a nuisance.
      
      I also left out a few warnings that are not supported in older
      compilers.
      
      [ Note that these changes might break the build on older
        compilers i did not test, or on non-x86 architectures that
        produce different warnings, so more testing would be welcome. ]
      
      Reported-by: Valdis.Kletnieks@vt.edu
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      83a0944f
  29. 15 8月, 2009 1 次提交
  30. 12 8月, 2009 1 次提交