1. 25 4月, 2012 2 次提交
    • S
      perf: Build libtraceevent.a · d0e7b850
      Steven Rostedt 提交于
      Have building perf also build libtraceevent.a. Currently, perf does
      not use the code within libtraceevent.a, but it soon will.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      d0e7b850
    • S
      perf: Separate out trace-cmd parse-events from perf files · 4ace73ee
      Steven Rostedt 提交于
      Move the trace-event-parse.c code that originally came from trace-cmd into
      their own files. The new file will be called trace-parse-events.c, as
      the name of trace-cmd's file was parse-events.c too, but it conflicted
      with the parse-events.c file in perf that parses the command line.
      
      This tries to update the code with mimimal changes.
      
      Perf specific code stays in the trace-event-parse.[ch] files and
      the common parsing code is now in trace-parse-events.c and
      trace-parse-events.h.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      4ace73ee
  2. 15 4月, 2012 1 次提交
  3. 13 4月, 2012 1 次提交
  4. 12 4月, 2012 4 次提交
  5. 30 3月, 2012 1 次提交
  6. 26 3月, 2012 1 次提交
  7. 20 3月, 2012 1 次提交
    • P
      perf report: Add a simple GTK2-based 'perf report' browser · c31a9457
      Pekka Enberg 提交于
      This patch adds a simple GTK2-based browser to 'perf report' that's
      based on the TTY-based browser in builtin-report.c.
      
      To launch "perf report" using the new GTK interface just type:
      
        $ perf report --gtk
      
      The interface is somewhat limited in features at the moment:
      
        - No callgraph support
      
        - No KVM guest profiling support
      
        - No color coding for percentages
      
        - No sorting from the UI
      
        - ..and many, many more!
      
      That said, I think this patch a reasonable start to build future features on.
      Signed-off-by: NPekka Enberg <penberg@kernel.org>
      Cc: Colin Walters <walters@verbum.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1202231952410.6689@tux.localdomain
      [ committer note: Added #pragma to make gtk no strict prototype problem go
        away as suggested by Colin Walters modulo avoiding push/pop ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c31a9457
  8. 17 3月, 2012 2 次提交
    • J
      perf tools: Add perf pmu object to access pmu format definition · cd82a32e
      Jiri Olsa 提交于
      Adding pmu object which provides interface to pmu's sysfs
      event format definition located at:
        ${sysfs_mount}/bus/event_source/devices/${pmu}/format
      
      Following interface is exported:
        struct perf_pmu* perf_pmu__find(char *name);
        - this function returns pmu object, which is then
          passed as a handle to other interface functions
      
        int perf_pmu__config(struct perf_pmu *pmu, struct perf_event_attr *attr,
                             struct list_head *head_terms);
        - this function configures perf_event_attr struct based
          on pmu's format definitions and config terms data,
          containined in head_terms list.
      
      Parser generator is used to retrive the pmu's format definition.
      The generated parser is part of the patch. Added makefile rule
      'pmu-parser' to generate the parser code out of the bison/flex
      sources.
      
      Added builtin test 'Test perf pmu format parsing', which could
      be run like:
      	perf test pmu
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/n/tip-errz96u1668gj9wlop1zhpht@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cd82a32e
    • J
      perf tools: Add parser generator for events parsing · 89812fc8
      Jiri Olsa 提交于
      Changing event parsing to use flex/bison parse generator.
      The event syntax stays as it was.
      
      grammar description:
      
      events: events ',' event | event
      
      event:  event_def PE_MODIFIER_EVENT | event_def
      
      event_def: event_legacy_symbol sep_dc     |
                 event_legacy_cache sep_dc      |
                 event_legacy_breakpoint sep_dc |
                 event_legacy_tracepoint sep_dc |
                 event_legacy_numeric sep_dc    |
                 event_legacy_raw sep_dc
      
      event_legacy_symbol:      PE_NAME_SYM
      
      event_legacy_cache:       PE_NAME_CACHE_TYPE '-' PE_NAME_CACHE_OP_RESULT '-' PE_NAME_CACHE_OP_RESULT |
                                PE_NAME_CACHE_TYPE '-' PE_NAME_CACHE_OP_RESULT  |
                                PE_NAME_CACHE_TYPE
      
      event_legacy_raw:         PE_SEP_RAW PE_VALUE
      
      event_legacy_numeric:     PE_VALUE ':' PE_VALUE
      
      event_legacy_breakpoint:  PE_SEP_BP ':' PE_VALUE ':' PE_MODIFIER_BP
      
      event_breakpoint_type:    PE_MODIFIER_BPTYPE | empty
      
      PE_NAME_SYM:              cpu-cycles|cycles                              |
                                stalled-cycles-frontend|idle-cycles-frontend   |
                                stalled-cycles-backend|idle-cycles-backend     |
                                instructions                                   |
                                cache-references                               |
                                cache-misses                                   |
                                branch-instructions|branches                   |
                                branch-misses                                  |
                                bus-cycles                                     |
                                cpu-clock                                      |
                                task-clock                                     |
                                page-faults|faults                             |
                                minor-faults                                   |
                                major-faults                                   |
                                context-switches|cs                            |
                                cpu-migrations|migrations                      |
                                alignment-faults                               |
                                emulation-faults
      
      PE_NAME_CACHE_TYPE:       L1-dcache|l1-d|l1d|L1-data             |
                                L1-icache|l1-i|l1i|L1-instruction      |
                                LLC|L2                                 |
                                dTLB|d-tlb|Data-TLB                    |
                                iTLB|i-tlb|Instruction-TLB             |
                                branch|branches|bpu|btb|bpc            |
                                node
      
      PE_NAME_CACHE_OP_RESULT:  load|loads|read                        |
                                store|stores|write                     |
                                prefetch|prefetches                    |
                                speculative-read|speculative-load      |
                                refs|Reference|ops|access              |
                                misses|miss
      
      PE_MODIFIER_EVENT:        [ukhp]{0,5}
      
      PE_MODIFIER_BP:           [rwx]
      
      PE_SEP_BP:                'mem'
      
      PE_SEP_RAW:               'r'
      
      sep_dc:                   ':' |
      
      Added flex/bison files for event grammar parsing. The generated
      parser is part of the patch. Added makefile rule 'event-parser'
      to generate the parser code out of the bison/flex sources.
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/n/tip-u4pfig5waq3ll2bfcdex8fgi@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      89812fc8
  9. 16 3月, 2012 1 次提交
  10. 14 3月, 2012 1 次提交
    • I
      perf tools, x86: Build perf on older user-space as well · eae7a755
      Ingo Molnar 提交于
      On ancient systems I get this build failure:
      
        util/../../../arch/x86/include/asm/unistd.h:67:29: error: asm/unistd_64.h: No such file or directory
        In file included from util/cache.h:7,
                         from builtin-test.c:8:
        util/../perf.h: In function ‘sys_perf_event_open’:In file included from util/../perf.h:16
        perf.h:170: error: ‘__NR_perf_event_open’ undeclared (first use in this function)
      
      The reason is that this old system does not have the split
      unistd.h headers yet, from which to pick up the syscall
      definitions.
      
      Add the syscall numbers to the already existing i386 and x86_64
      blocks in perf.h, and also provide empty include file stubs.
      
      With this patch perf builds and works fine on 5 years old
      user-space as well.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Link: http://lkml.kernel.org/n/tip-jctwg64le1w47tuaoeyftsg9@git.kernel.orgSigned-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      eae7a755
  11. 05 3月, 2012 1 次提交
  12. 14 2月, 2012 2 次提交
  13. 03 2月, 2012 1 次提交
  14. 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
  15. 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
  16. 28 11月, 2011 1 次提交
  17. 21 10月, 2011 1 次提交
  18. 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
  19. 24 9月, 2011 1 次提交
  20. 08 8月, 2011 2 次提交
  21. 21 7月, 2011 1 次提交
  22. 16 7月, 2011 1 次提交
  23. 16 6月, 2011 1 次提交
  24. 26 5月, 2011 1 次提交
  25. 07 5月, 2011 1 次提交
  26. 19 4月, 2011 3 次提交
  27. 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
  28. 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
  29. 18 2月, 2011 2 次提交
    • 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