diff options
Diffstat (limited to 'tracecmd-test.py')
-rw-r--r-- | tracecmd-test.py | 36 |
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 | |||
3 | from ctracecmd import * | ||
4 | |||
5 | # Let's move the following into a new Trace object constructor | ||
6 | filename = "trace.dat" | ||
7 | trace_file = open(filename) | ||
8 | handle = tracecmd_open(trace_file.fileno()) | ||
9 | tracecmd_read_headers(handle) | ||
10 | tracecmd_init_data(handle) | ||
11 | |||
12 | # These should be members, i.e. Trace.cpus | ||
13 | pe = tracecmd_get_pevent(handle) | ||
14 | cpus = tracecmd_cpus(handle) | ||
15 | print "Trace %s contains data for %d cpus" % (filename, cpus) | ||
16 | |||
17 | # FIXME: this doesn't print anything... | ||
18 | tracecmd_print_events(handle) | ||
19 | |||
20 | print "Cycling through the events for each CPU" | ||
21 | for 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 | ||