1. 16 3月, 2012 1 次提交
  2. 05 3月, 2012 1 次提交
  3. 14 2月, 2012 2 次提交
  4. 03 2月, 2012 1 次提交
  5. 31 1月, 2012 1 次提交
    • D
      perf tools: Fix broken build by defining _GNU_SOURCE in Makefile · 0a84f007
      David Daney 提交于
      When building on my Debian/mips system, util/util.c fails to build
      because commit 1aed2671 (perf kvm: Do
      guest-only counting by default) indirectly includes stdio.h before the
      feature selection in util.h is done.  This prevents _GNU_SOURCE in
      util.h from enabling the declaration of getline(), from now second
      inclusion of stdio.h, and the build is broken.
      
      There is another breakage in util/evsel.c caused by include ordering,
      but I didn't fully track down the commit that caused it.
      
      The root cause of all this is an inconsistent definition of _GNU_SOURCE,
      so I move the definition into the Makefile so that it is passed to all
      invocations of the compiler and used uniformly for all system header
      files.  All other #define and #undef of _GNU_SOURCE are removed as they
      cause conflicts with the definition passed to the compiler.
      
      All the features.h definitions (_LARGEFILE64_SOURCE _FILE_OFFSET_BITS=64
      and _GNU_SOURCE) are needed by the python glue code too, so they are
      moved to BASIC_CFLAGS, and the misleading comments about BASIC_CFLAGS
      are removed.
      
      This gives me a clean build on x86_64 (fc12) and mips (Debian).
      
      Cc: David Daney <david.daney@cavium.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Joerg Roedel <joerg.roedel@amd.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1326836461-11952-1-git-send-email-ddaney.cavm@gmail.comSigned-off-by: NDavid Daney <david.daney@cavium.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0a84f007
  6. 25 1月, 2012 2 次提交
    • D
      perf tools: Fix broken build by defining _GNU_SOURCE in Makefile · 2ef1ea38
      David Daney 提交于
      When building on my Debian/mips system, util/util.c fails to build
      because commit 1aed2671 (perf kvm: Do
      guest-only counting by default) indirectly includes stdio.h before the
      feature selection in util.h is done.  This prevents _GNU_SOURCE in
      util.h from enabling the declaration of getline(), from now second
      inclusion of stdio.h, and the build is broken.
      
      There is another breakage in util/evsel.c caused by include ordering,
      but I didn't fully track down the commit that caused it.
      
      The root cause of all this is an inconsistent definition of _GNU_SOURCE,
      so I move the definition into the Makefile so that it is passed to all
      invocations of the compiler and used uniformly for all system header
      files.  All other #define and #undef of _GNU_SOURCE are removed as they
      cause conflicts with the definition passed to the compiler.
      
      All the features.h definitions (_LARGEFILE64_SOURCE _FILE_OFFSET_BITS=64
      and _GNU_SOURCE) are needed by the python glue code too, so they are
      moved to BASIC_CFLAGS, and the misleading comments about BASIC_CFLAGS
      are removed.
      
      This gives me a clean build on x86_64 (fc12) and mips (Debian).
      
      Cc: David Daney <david.daney@cavium.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Joerg Roedel <joerg.roedel@amd.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1326836461-11952-1-git-send-email-ddaney.cavm@gmail.comSigned-off-by: NDavid Daney <david.daney@cavium.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2ef1ea38
    • J
      perf bench: Also allow measuring memset() · be3de80d
      Jan Beulich 提交于
      This simply clones the respective memcpy() implementation.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      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/4F16D743020000780006D735@nat28.tlf.novell.comSigned-off-by: NJan Beulich <jbeulich@suse.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      be3de80d
  7. 28 11月, 2011 1 次提交
  8. 21 10月, 2011 1 次提交
  9. 08 10月, 2011 1 次提交
    • A
      perf top: Reuse the 'report' hist_entry/hists classes · ab81f3fd
      Arnaldo Carvalho de Melo 提交于
      This actually fixes several problems we had in the old 'perf top':
      
      1. Unresolved symbols not show, limitation that came from the old
         "KernelTop" codebase, to solve it we would need to do changes
         that would make sym_entry have most of the hist_entry fields.
      2. It was using the number of samples, not the sum of sample->period.
      
      And brings the --sort code that allows us to have all the views in
      'perf report', for instance:
      
      [root@emilia ~]# perf top --sort dso
      PerfTop: 5903 irqs/sec kernel:77.5% exact: 0.0% [1000Hz cycles], (all, 8 CPUs)
      ------------------------------------------------------------------------------
      
          31.59%  libcrypto.so.1.0.0
          21.55%  [kernel]
          18.57%  libpython2.6.so.1.0
           7.04%  libc-2.12.so
           6.99%  _backend_agg.so
           4.72%  sshd
           1.48%  multiarray.so
           1.39%  libfreetype.so.6.3.22
           1.37%  perf
           0.71%  libgobject-2.0.so.0.2200.5
           0.53%  [tg3]
           0.48%  libglib-2.0.so.0.2200.5
           0.44%  libstdc++.so.6.0.13
           0.40%  libcairo.so.2.10800.8
           0.38%  libm-2.12.so
           0.34%  umath.so
           0.30%  libgdk-x11-2.0.so.0.1800.9
           0.22%  libpthread-2.12.so
           0.20%  libgtk-x11-2.0.so.0.1800.9
           0.20%  librt-2.12.so
           0.15%  _path.so
           0.13%  libpango-1.0.so.0.2800.1
           0.11%  libatlas.so.3.0
           0.09%  ft2font.so
           0.09%  libpangoft2-1.0.so.0.2800.1
           0.08%  libX11.so.6.3.0
           0.07%  [vdso]
           0.06%  cyclictest
      ^C
      
      All the filter lists can be used as well: --dsos, --comms, --symbols,
      etc.
      
      The 'perf report' TUI is also reused, being possible to apply all the
      zoom operations, do annotation, etc.
      
      This change will allow multiple simplifications in the symbol system as
      well, that will be detailed in upcoming changesets.
      
      Cc: David Ahern <dsahern@gmail.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>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-xzaaldxq7zhqrrxdxjifk1mh@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ab81f3fd
  10. 24 9月, 2011 1 次提交
  11. 08 8月, 2011 2 次提交
  12. 21 7月, 2011 1 次提交
  13. 16 7月, 2011 1 次提交
  14. 16 6月, 2011 1 次提交
  15. 26 5月, 2011 1 次提交
  16. 07 5月, 2011 1 次提交
  17. 19 4月, 2011 3 次提交
  18. 30 3月, 2011 1 次提交
    • R
      perf tools: Fix NO_NEWT=1 python build error · 1b7155f7
      Robert Richter 提交于
      Fix the following build error:
      
           GEN python/perf.so
       In file included from util/evsel.h:10,
                        from util/python.c:6:
       util/hist.h:106:18: error: newt.h: No such file or directory
       error: command 'x86_64-pc-linux-gnu-gcc' failed with exit status 1
       make: *** [python/perf.so] Error 1
      
      by passing BASIC_CFLAGS to setup.py. BASIC_CFLAGS variable contains
      the -DNO_NEWT_SUPPORT switch which prevents building python c
      extension with newt.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      LKML-Reference: <20110329180236.GA19366@erda.amd.com>
      Signed-off-by: NRobert Richter <robert.richter@amd.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1b7155f7
  19. 15 3月, 2011 1 次提交
    • A
      perf evlist: New command to list the names of events present in a perf.data file · 43adec95
      Arnaldo Carvalho de Melo 提交于
      [root@emilia ~]# perf record -a -e sched:* -e timer:timer* sleep 5
      [ perf record: Woken up 1 times to write data ]
      [ perf record: Captured and wrote 0.172 MB perf.data (~7530 samples) ]
      [root@emilia ~]# perf evlist
      sched:sched_kthread_stop
      sched:sched_kthread_stop_ret
      sched:sched_wakeup
      sched:sched_wakeup_new
      sched:sched_switch
      sched:sched_migrate_task
      sched:sched_process_free
      sched:sched_process_exit
      sched:sched_wait_task
      sched:sched_process_wait
      sched:sched_process_fork
      sched:sched_stat_wait
      sched:sched_stat_sleep
      sched:sched_stat_iowait
      sched:sched_stat_runtime
      sched:sched_pi_setprio
      timer:timer_init
      timer:timer_start
      timer:timer_expire_entry
      timer:timer_expire_exit
      timer:timer_cancel
      [root@emilia ~]#
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      43adec95
  20. 18 2月, 2011 4 次提交
    • M
      perf tools: Makefile: Remove various and sundry cruft · a3d1ee10
      Michael Witten 提交于
      This commit squashes several commits that remove:
      
       unnecessary uname calls
       `sh -c'
       BUILT_INS and QUIET_BUILT_IN
      
          They have no effect, and the `fixup-builtins' and `check-builtins.sh'
          scripts don't even exist.
      
       RUNTIME_PREFIX
      
          It's currently never anything but unset, and it's apparently
          only meaningful when Microsoft Windows is the operating system
          (according to the source for git).
      
       TEST_PROGRAMS
       EXTRA_PROGRAMS
       unused SHELL_PATH_SQ portions
       unused test for V=2
       useless exports
      
          Only when `V' is undefined (that is, only when the value of `V'
          is empty) is `export V' performed, which just has the effect of
          placing the empty-valued variable `V' in the environment.
      
          The only other script to make use of `V' is `Documentation/Makefile',
          which only checks whether `V' is undefined (that is, whether the value
          of `V' is empty); hence, the `export V' has no effect whatsoever.
      
          Similarly, `export QUIET_GEN' is useless because it will only have
          a non-empty value when `V' has an empty-value, and when `V' has
          an empty-value, `QUIET_GEN' is always explicitly set in every
          script in which it is used.
      
          `DESTDIR' is only ever defined by the user via the environment
          or the command line, both of which are automatically exported
          to sub-make processes. Furthermore, no non-make sub-scripts
          make use of `DESTDIR' as an environment variable.
      
          No other scripts use `perfexec_instdir'.
      
       unused QUIET_SUBDIR{0,1}
       TAR and RPMBUILD
       PTHREAD_LIBS
       Maintainer's dist rules and commands
       distclean target
       Test suite coverage testing
       PRINT_DIR and NO_SUBDIR
       `configure' target
       NO_CURL
       @@PERF_VERSION@@ substitution
      
          Without the sed command, all of the rule's commands can be reduced
          to a single line that copies a file and sets the permissions properly
          in the process.
      
       `make test' echo line
       template_instdir
       PERF-BUILD-OPTIONS
       double-colon rules
      
          The use of double-colon rules seems misguided or vestigial git.
      
       Essentially hard-coded $(SCRIPTS) expansion
      Signed-off-by: NMichael Witten <mfwitten@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a3d1ee10
    • M
      perf tools: Makefile: Remove tool-specific cruft · 0a54fb63
      Michael Witten 提交于
      This commit squashes several commits that remove:
      
       NO_C99_FORMAT
       CURLDIR and EXPATDIR
       NO_DEFLATE_BOUND
       CC_LD_DYNPATH and NO_R_TO_GCC_LINKER
       NO_PERL_MAKEMAKER
       INTERNAL_QSORT
       NO_EXTERNAL_GREP
       NO_PERL
       SCRIPT_PERL
       PERL_PATH_SQ
      Signed-off-by: NMichael Witten <mfwitten@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0a54fb63
    • M
      perf tools: Makefile: Remove platform-specific cruft · 8796cb9d
      Michael Witten 提交于
      While it makes sense that this tool could be used on
      other platforms at least to parse data, there doesn't
      appear to be any real support for such usage.
      
      This commit squashes several commits that remove:
      
       SNPRINTF_RETURNS_BOGUS
       FREAD_READS_DIRECTORIES
       NO_D_{INO,TYPE}_IN_DIRENT
       NO_STRCASESTR
       NO_MEMMEM
       NO_STRTOUMAX and NO_STRTOULL
       NO_SETENV
       NO_UNSETENV
       NO_MKDTEMP
       NEEDS_LIBICONV
       NEEDS_SOCKET
       NO_MMAP
       NO_PTHREADS
       NO_PREAD
       NO_TRUSTABLE_FILEMODE
       NO_IPV6 and NO_SOCKADDR_STORAGE
       NO_ICONV and OLD_ICONV
       NO_NSEC, USE_NSEC, and USE_ST_TIMESPEC
       NO_ST_BLOCKS_IN_STRUCT_STAT
       NO_FINK and NO_DARWIN_PORTS
       NO_SYS_SELECT_H
       NO_HSTRERROR
       DIR_HAS_BSD_GROUP_SEMANTICS and FORCE_DIR_SET_GID
       NEEDS_NSL, NO_UINTMAX_T, NO_INET_{N,P}TON
       COMPAT_{CFLAGS,OBJS}
       Executable extension `X'
      Signed-off-by: NMichael Witten <mfwitten@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8796cb9d
    • M
      perf tools: Makefile: Remove vestigial git-specific cruft · 006cdc32
      Michael Witten 提交于
      This commit squashes several commits that remove:
      
       NO_SYMLINK_HEAD
       NO_SVN_TESTS
       NO_FAST_WORKING_DIRECTORY
       USE_STDEV
       SHA1/SSL cruft
       makefile rules
      Signed-off-by: NMichael Witten <mfwitten@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      006cdc32
  21. 17 2月, 2011 2 次提交
  22. 16 2月, 2011 1 次提交
    • S
      perf tool: Add cgroup support · 023695d9
      Stephane Eranian 提交于
      This patch adds the ability to filter monitoring based on container groups
      (cgroups) for both perf stat and perf record. It is possible to monitor
      multiple cgroup in parallel. There is one cgroup per event. The cgroups to
      monitor are passed via a new -G option followed by a comma separated list of
      cgroup names.
      
      The cgroup filesystem has to be mounted. Given a cgroup name, the perf tool
      finds the corresponding directory in the cgroup filesystem and opens it. It
      then passes that file descriptor to the kernel.
      
      Example:
      
      $ perf stat -B -a -e cycles:u,cycles:u,cycles:u -G test1,,test2 -- sleep 1
       Performance counter stats for 'sleep 1':
      
            2,368,667,414  cycles                   test1
            2,369,661,459  cycles
            <not counted>  cycles                   test2
      
              1.001856890  seconds time elapsed
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <4d590290.825bdf0a.7d0a.4890@mx.google.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      023695d9
  23. 07 2月, 2011 1 次提交
  24. 05 2月, 2011 1 次提交
    • A
      perf annotate: Move annotate functions to util/ · 78f7defe
      Arnaldo Carvalho de Melo 提交于
      They will be used by perf top, so that we have just one set of routines
      to do annotation.
      
      Rename "struct sym_priv" to "struct annotation", etc, to clarify this
      code a bit.
      
      Rename "struct sym_ext" to "struct source_line", to give it a meaningful
      name, that clarifies that it is a the result of an addr2line call, that
      is sorted by percentage one particular source code line appeared in the
      annotation.
      
      And since we're moving things around also rename 'sym_hist->ip' to
      'sym_hist->addr' as we want to do data structure annotation at some
      point.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      78f7defe
  25. 02 2月, 2011 3 次提交
    • A
      perf tools: Don't try to build python bindings if Python.h not available · 978f626c
      Arnaldo Carvalho de Melo 提交于
      Just leverage the test done for python support in 'python script',
      emitting a warning about losing those features if python-dev[el] is not
      installed.
      Reported-by: NPeter 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: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      978f626c
    • A
      perf tools: Fix up 'make clean' target · 568bb7b8
      Arnaldo Carvalho de Melo 提交于
      It wasn't using $(OUTPUT) to rm *.o and there were some funny looking
      automake files that never get created but were being deleted anyway.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      568bb7b8
    • A
      perf tools: Remove verbose build messages for the python binding · 067187fc
      Arnaldo Carvalho de Melo 提交于
      Also now it builds it in a well known location:
      
      [acme@felicio linux]$ rm -rf ../build/perf/
      [acme@felicio linux]$ mkdir ../build/perf
      [acme@felicio linux]$ make -j2 O=~acme/git/build/perf -C tools/perf/
      <SNIP>
      [acme@felicio linux]$ ls -la ../build/perf/python/
      total 152
      -rwxrwxr-x 1 acme acme 147957 Feb  1 14:56 perf.so
      drwxrwxr-x 3 acme acme     17 Feb  1 14:56 temp
      [acme@felicio linux]$
      
      [root@felicio ~]# strip ~acme/git/build/perf/python/perf.so
      [root@felicio ~]# ls -la ~acme/git/build/perf/python/perf.so
      -rwxrwxr-x 1 acme acme 46264 Feb  1 14:58 /home/acme/git/build/perf/python/perf.so
      
      [root@felicio ~]# export PYTHONPATH=~acme/git/build/perf/python/
      [root@felicio ~]# ~acme/git/linux/tools/perf/python/twatch.py
      cpu:  0, pid: 7751, tid: 7751 { type: exit, pid: 7751, ppid: 7751, tid: 7751, ptid: 7751, time: 54562393512356}
      cpu:  0, pid: 13700, tid: 13700 { type: fork, pid: 7756, ppid: 13700, tid: 7756, ptid: 13700, time: 54562393746739}
      cpu:  1, pid: 7756, tid: 7756 { type: fork, pid: 7757, ppid: 7756, tid: 7757, ptid: 7756, time: 54562394246152}
      cpu:  1, pid: 7757, tid: 7757 { type: comm, pid: 7757, tid: 7757, comm: awk }
      cpu:  1, pid: 7757, tid: 7757 { type: exit, pid: 7757, ppid: 7757, tid: 7757, ptid: 7757, time: 54562395456813}
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      067187fc
  26. 01 2月, 2011 2 次提交
    • A
      perf top: Introduce slang based TUI · c0443df1
      Arnaldo Carvalho de Melo 提交于
      Disabled by default as there are features found in the stdio based one
      that aren't implemented, like live annotation, filtering knobs data
      entry.
      
      Annotation hopefully will get somehow merged with the 'perf annotate'
      code.
      
      To use it:
      
      perf top --tui
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c0443df1
    • A
      perf top: Move display agnostic routines to util/top.[ch] · 8c3e10eb
      Arnaldo Carvalho de Melo 提交于
      Paving the way for a slang browser a la 'perf report --tui'.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8c3e10eb
  27. 30 1月, 2011 1 次提交
    • A
      perf tools: Initial python binding · 877108e4
      Arnaldo Carvalho de Melo 提交于
      First clarifying that this kind of binding is not a replacement or an
      equivalent to the 'perf script' way of using python with perf.
      
      The 'perf script' way is to process events and look at a given script
      for some python function that matches the events to pass each event for
      processing.
      
      This is a python module, i.e. everything is driven from the python
      script, that merely uses "import perf" or "from perf import".
      
      perf script is focused on tracepoints, this binding is focused on profiling as
      an initial target. More work is needed to make available tracepoint specific
      variables as event variables accessible via this binding.
      
      There is one example of such usage model, in
      tools/perf/python/twatch.py, a tool to watch "cycles" events together
      with task (fork, exit) and comm perf events.
      
      For now, due to me not being able to grok how python distutils cope with
      building C extensions outside the sources dir the install target just
      builds it, I'm using it as:
      
      [root@emilia linux]# export PYTHONPATH=~acme/git/build/perf/lib.linux-x86_64-2.6/
      [root@emilia linux]# tools/perf/python/twatch.py
      cpu:  4, pid: 30126, tid: 30126 { type: mmap, pid: 30126, tid: 30126, start: 0x4, length: 0x82e9ca03, offset: 0, filename:  }
      cpu:  6, pid:   47, tid:   47 { type: mmap, pid: 47, tid: 47, start: 0x6, length: 0xbef87c36, offset: 0, filename:  }
      cpu:  1, pid:    0, tid:    0 { type: mmap, pid: 0, tid: 0, start: 0x1, length: 0x775d1904, offset: 0, filename:  }
      cpu:  7, pid:    0, tid:    0 { type: mmap, pid: 0, tid: 0, start: 0x7, length: 0xc750aeb6, offset: 0, filename:  }
      cpu:  5, pid: 2255, tid: 2255 { type: mmap, pid: 2255, tid: 2255, start: 0x5, length: 0x76669635, offset: 0, filename:  }
      cpu:  0, pid:    0, tid:    0 { type: mmap, pid: 0, tid: 0, start: 0, length: 0x6422ef6b, offset: 0, filename:  }
      cpu:  2, pid: 2255, tid: 2255 { type: mmap, pid: 2255, tid: 2255, start: 0x2, length: 0xe078757a, offset: 0, filename:  }
      cpu:  1, pid: 5769, tid: 5769 { type: fork, pid: 30127, ppid: 5769, tid: 30127, ptid: 5769, time: 103893991270534}
      cpu:  6, pid: 30127, tid: 30127 { type: comm, pid: 30127, tid: 30127, comm: ls }
      cpu:  6, pid: 30127, tid: 30127 { type: exit, pid: 30127, ppid: 30127, tid: 30127, ptid: 30127, time: 103893993273024}
      
      The first 8 mmap events in this 8 way machine are a mistery that is still being
      investigated.
      
      More of the tools/perf/util/ APIs will be exposed via this python binding as
      the need arises. For now the focus is on creating events and processing them,
      symbol resolution is an obvious next step, with tracepoint variables as a close
      second step.
      
      Cc: Clark Williams <williams@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      877108e4
  28. 28 1月, 2011 1 次提交
    • M
      perf tools: Add strfilter for general purpose string filter · 68baa431
      Masami Hiramatsu 提交于
      Add strfilter for general purpose string filter.
      
      Every filter rules are descrived by glob matching pattern and '!' prefix
      which means Logical NOT.
      
      A strfilter consists of those filter rules connected with '&' and '|'.
      
      A set of rules can be folded by using '(' and ')'.
      
      It also accepts spaces around rules and those operators.
      
      Format:
      <rule> ::= <glob-exp> | "!" <rule> | <rule> <op> <rule> | "(" <rule> ")"
      <op> ::= "&" | "|"
      
      e.g.:
      
       "(add* | del*) & *timer" filter rules pass strings which start with add
       or del and end with timer.
      
      This will be used by perf probe --filter.
      
      Changes in V2:
       - Fix to check result of strdup() and strfilter__alloc().
       - Encapsulate and simplify interfaces as like regex(3).
      
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      Cc: Franck Bui-Huu <fbuihuu@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <20110120141530.25915.12673.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      68baa431