Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # perf script event handlers, generated by perf script -g python
- # Licensed under the terms of the GNU GPL License version 2
- # The common_* event handler fields are the most useful fields common to
- # all events. They don't necessarily correspond to the 'common_*' fields
- # in the format files. Those fields not available as handler params can
- # be retrieved using Python functions of the form common_*(context).
- # See the perf-script-python Documentation for the list of available functions.
- import os
- import sys
- sys.path.append(os.environ['PERF_EXEC_PATH'] + \
- '/scripts/python/perf-script-Util/lib/Perf/Trace')
- from perf_trace_context import *
- from Core import *
- def trace_begin():
- print "in trace_begin"
- def trace_end():
- print "in trace_end"
- def raw_syscalls__sys_enter(event_name, context, common_cpu,
- common_secs, common_nsecs, common_pid, common_comm,
- id, args):
- print_header(event_name, common_cpu, common_secs, common_nsecs,
- common_pid, common_comm)
- print "id=%d, args=%s\n" % \
- (id, args),
- def trace_unhandled(event_name, context, common_cpu, common_secs, common_nsecs,
- common_pid, common_comm):
- print_header(event_name, common_cpu, common_secs, common_nsecs,
- common_pid, common_comm)
- def print_header(event_name, cpu, secs, nsecs, pid, comm):
- print "%-20s %5u %05u.%09u %8u %-20s " % \
- (event_name, cpu, secs, nsecs, pid, comm),
Advertisement
Add Comment
Please, Sign In to add comment