Guest User

Untitled

a guest
Jul 18th, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. # perf script event handlers, generated by perf script -g python
  2. # Licensed under the terms of the GNU GPL License version 2
  3.  
  4. # The common_* event handler fields are the most useful fields common to
  5. # all events. They don't necessarily correspond to the 'common_*' fields
  6. # in the format files. Those fields not available as handler params can
  7. # be retrieved using Python functions of the form common_*(context).
  8. # See the perf-script-python Documentation for the list of available functions.
  9.  
  10. import os
  11. import sys
  12.  
  13. sys.path.append(os.environ['PERF_EXEC_PATH'] + \
  14. '/scripts/python/perf-script-Util/lib/Perf/Trace')
  15.  
  16. from perf_trace_context import *
  17. from Core import *
  18.  
  19. def trace_begin():
  20. print "in trace_begin"
  21.  
  22. def trace_end():
  23. print "in trace_end"
  24.  
  25. def raw_syscalls__sys_enter(event_name, context, common_cpu,
  26. common_secs, common_nsecs, common_pid, common_comm,
  27. id, args):
  28. print_header(event_name, common_cpu, common_secs, common_nsecs,
  29. common_pid, common_comm)
  30.  
  31. print "id=%d, args=%s\n" % \
  32. (id, args),
  33.  
  34. def trace_unhandled(event_name, context, common_cpu, common_secs, common_nsecs,
  35. common_pid, common_comm):
  36. print_header(event_name, common_cpu, common_secs, common_nsecs,
  37. common_pid, common_comm)
  38.  
  39. def print_header(event_name, cpu, secs, nsecs, pid, comm):
  40. print "%-20s %5u %05u.%09u %8u %-20s " % \
  41. (event_name, cpu, secs, nsecs, pid, comm),
Advertisement
Add Comment
Please, Sign In to add comment