mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v4 0/5] perf script: Add general event support to event handler of python script
@ 2012-06-28  9:15 Feng Tang
  2012-06-28  9:15 ` [PATCH v4 1/5] perf script: Add general python handler to process non-tracepoint events Feng Tang
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Feng Tang @ 2012-06-28  9:15 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, David Ahern, Peter Zijlstra,
	Ingo Molnar, linux-kernel
  Cc: Robert Richter, Andi Kleen, Stephane Eranian, Feng Tang

Hi all,

Current python script can only handle trace point type of events, this
patch serie try to follow Robert Richter's idea in commit 37a058ea0
	"perf script: Add generic perl handler to process events"
to similarly add a python handler for general events other than
trace points.

Also in v4, we added 2 RFC python scripts: EventClass.py as a libary and
event_analyzing_sample.py as a sample to show to handle the general
events.

Here is a sample output of using the 2 scripts:

feng@feng-i7:/dev/shm$perf record -a tree
feng@feng-i7:/dev/shm$perf script -s process_event.py

One note for the histgram is: the sample number may be very large,
so we print out '#' log2(num) times for each number.

---------------------------------
There is 100 records in gen_events table
Statistics about the general events grouped by thread/symbol/dso:

            comm   number         histgram
==========================================
         swapper       56     ######
            tree       20     #####
            perf       10     ####
            sshd        8     ####
     kworker/7:2        4     ###
     ksoftirqd/7        1     #
 plugin-containe        1     #

                          symbol   number         histgram
==========================================================
           native_write_msr_safe       40     ######
                  __lock_acquire        8     ####
             ftrace_graph_caller        4     ###
           prepare_ftrace_return        4     ###
                      intel_idle        3     ##
              native_sched_clock        3     ##
                  Unknown_symbol        2     ##
                      do_softirq        2     ##
                    lock_release        2     ##
           lock_release_holdtime        2     ##
               trace_graph_entry        2     ##
                        _IO_putc        1     #
                  __d_lookup_rcu        1     #
                      __do_fault        1     #
                      __schedule        1     #
                  _raw_spin_lock        1     #
                       delay_tsc        1     #
             generic_exec_single        1     #
                generic_fillattr        1     #

                                     dso   number         histgram
==================================================================
                       [kernel.kallsyms]       95     #######
                     /lib/libc-2.12.1.so        5     ###

Thanks,
Feng

Feng Tang (5):
  perf script: Add general python handler to process non-tracepoint
    events
  perf script: Replace "struct thread" with "struct addr_location" as a
    parameter for "process_event()"
  perf script/python: Pass event/thread/dso name and symbol info to
    event handler in python
  perf script: Add a python library EventClass.py
  perf script: Add event_analyzing_sample.py as a sample for general
    event handling

 tools/perf/builtin-script.c                        |    5 +-
 .../Perf-Trace-Util/lib/Perf/Trace/EventClass.py   |   95 ++++++++++
 .../perf/scripts/python/event_analyzing_sample.py  |  193 ++++++++++++++++++++
 .../perf/util/scripting-engines/trace-event-perl.c |   13 +-
 .../util/scripting-engines/trace-event-python.c    |   95 +++++++++-
 tools/perf/util/trace-event-scripting.c            |    2 +-
 tools/perf/util/trace-event.h                      |    5 +-
 7 files changed, 391 insertions(+), 17 deletions(-)
 create mode 100755 tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
 create mode 100644 tools/perf/scripts/python/event_analyzing_sample.py


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-06-28  9:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-28  9:15 [PATCH v4 0/5] perf script: Add general event support to event handler of python script Feng Tang
2012-06-28  9:15 ` [PATCH v4 1/5] perf script: Add general python handler to process non-tracepoint events Feng Tang
2012-06-28  9:15 ` [PATCH v4 2/5] perf script: Replace "struct thread" with "struct addr_location" as a parameter for "process_event()" Feng Tang
2012-06-28  9:15 ` [PATCH v4 3/5] perf script/python: Pass event/thread/dso name and symbol info to event handler in python Feng Tang
2012-06-28  9:15 ` [PATCH v4 RFC 4/5] perf script: Add a python library EventClass.py Feng Tang
2012-06-28  9:15 ` [PATCH v4 RFC 5/5] perf script: Add event_analyzing_sample.py as a sample for general event handling Feng Tang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®