public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/5] perf script: Add general event support to event handler of python script
@ 2012-08-08  9:57 Feng Tang
  2012-08-08  9:57 ` [PATCH v5 1/5] perf script: Add general python handler to process non-tracepoint events Feng Tang
                   ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: Feng Tang @ 2012-08-08  9:57 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 Arnaldo and 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
tracepoints.

The first 3 patches have been reviewed and modified several times, 
and 1/2 have your signed-off, Could you consider to pick them up?
I've have rebased them on top of you perf/core branch with top
commit 9782243.

Also in v4, we added 2 RFC python scripts: EventClass.py as a libary and
process_event.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

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

               comm   number         histgram
=============================================
            swapper       51     =====#
               perf       10     =
               tree        4     ####
        kworker/1:3        1     #
               sshd        1     #

                          symbol   number         histgram
==========================================================
           native_write_msr_safe       40     ====
                  __lock_acquire        5     #####
                      intel_idle        2     ##
              native_sched_clock        2     ##
                   __might_sleep        1     #
                     __slab_free        1     #
                   cpuidle_enter        1     #
             generic_exec_single        1     #
              generic_permission        1     #
             hpet_msi_next_event        1     #
                        irq_exit        1     #
                  ktime_get_real        1     #
                    load_balance        1     #
                          memset        1     #
                      n_tty_poll        1     #
           prepare_ftrace_return        1     #
                 sched_clock_cpu        1     #
smp_call_function_single_interrupt        1     #
                          strtok        1     #
                task_waking_fair        1     #
       tick_nohz_stop_sched_tick        1     #

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



Please help to revew, thanks.

- Feng

-----------------------------
Change logs:
	Since v4:
	* rebased with Arnaldo's git perf/core branch on top of
	  commmit 9782243

	Since v3:
	* Add 2 RFC scripts: EventClass.py and process_event.py
	* Rebased upon 3.5-rc4 d1346a6
	* Add a check for whether the dso info exist
	
	Since v2:
	* Correct some __unused usage
	* Add a new parameter: event name to event handler

	Since v1:
	* Use dictory as the paramter passwd from c to python
	* Use "process_event" name to comply with perl


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 |   11 +-
 .../util/scripting-engines/trace-event-python.c    |   85 +++++++++-
 tools/perf/util/trace-event-scripting.c            |    2 +-
 tools/perf/util/trace-event.h                      |    5 +-
 7 files changed, 384 insertions(+), 12 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] 19+ messages in thread

end of thread, other threads:[~2012-08-21 15:36 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-08  9:57 [PATCH v5 0/5] perf script: Add general event support to event handler of python script Feng Tang
2012-08-08  9:57 ` [PATCH v5 1/5] perf script: Add general python handler to process non-tracepoint events Feng Tang
2012-08-09  0:54   ` Namhyung Kim
2012-08-21 15:30   ` [tip:perf/core] " tip-bot for Feng Tang
2012-08-08  9:57 ` [PATCH v5 2/5] perf script: Replace "struct thread" with "struct addr_location" as a parameter for "process_event()" Feng Tang
2012-08-21 15:31   ` [tip:perf/core] perf script: Replace "struct thread" with " struct " tip-bot for Feng Tang
2012-08-08  9:57 ` [PATCH v5 3/5] perf script/python: Pass event/thread/dso name and symbol info to event handler in python Feng Tang
2012-08-09  1:06   ` Namhyung Kim
2012-08-21 15:32   ` [tip:perf/core] perf scripts python: Pass event/thread/ dso " tip-bot for Feng Tang
2012-08-08  9:57 ` [PATCH v5 4/5] perf script: Add a python library EventClass.py Feng Tang
2012-08-09  1:10   ` Namhyung Kim
2012-08-21 15:35   ` [tip:perf/core] perf scripts python: " tip-bot for Feng Tang
2012-08-08  9:57 ` [PATCH v5 5/5] perf script: Add event_analyzing_sample.py as a sample for general event handling Feng Tang
2012-08-09  1:30   ` Namhyung Kim
2012-08-09  4:30     ` Feng Tang
2012-08-09  5:19       ` Namhyung Kim
2012-08-09  5:28         ` Feng Tang
2012-08-09  5:46           ` Namhyung Kim
2012-08-21 15:36   ` [tip:perf/core] perf scripts python: Add event_analyzing_sample. py " tip-bot for Feng Tang

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