aboutsummaryrefslogtreecommitdiffstats
path: root/tracecmd-test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tracecmd-test.py')
-rw-r--r--tracecmd-test.py36
1 files changed, 0 insertions, 36 deletions
diff --git a/tracecmd-test.py b/tracecmd-test.py
deleted file mode 100644
index e35523b..0000000
--- a/tracecmd-test.py
+++ /dev/null
@@ -1,36 +0,0 @@
1#!/usr/bin/env python
2
3from ctracecmd import *
4
5# Let's move the following into a new Trace object constructor
6filename = "trace.dat"
7trace_file = open(filename)
8handle = tracecmd_open(trace_file.fileno())
9tracecmd_read_headers(handle)
10tracecmd_init_data(handle)
11
12# These should be members, i.e. Trace.cpus
13pe = tracecmd_get_pevent(handle)
14cpus = tracecmd_cpus(handle)
15print "Trace %s contains data for %d cpus" % (filename, cpus)
16
17# FIXME: this doesn't print anything...
18tracecmd_print_events(handle)
19
20print "Cycling through the events for each CPU"
21for cpu in range(0,cpus):
22 print "CPU", cpu
23 rec = tracecmd_read_data(handle, cpu)
24 while True:
25 if rec:
26 # these should be members of a Record object
27 pid = pevent_data_pid(pe, rec)
28 comm = pevent_data_comm_from_pid(pe, pid)
29 type = pevent_data_type(pe, rec)
30 event = pevent_data_event_from_type(pe, type)
31 print "\t%f %s: pid=%d comm=%s type=%d" % \
32 (record_ts_get(rec), event_name_get(event), pid, comm, type)
33
34 rec = tracecmd_read_data(handle, cpu)
35 else:
36 break