From 44a8ade3ed5dc4810fd95c41dbe8ec3aa2fb0cf7 Mon Sep 17 00:00:00 2001 From: Gary Bressler Date: Mon, 1 Mar 2010 23:46:44 -0500 Subject: Reorganized tree, along with the visualizer --- sample_script.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 sample_script.py (limited to 'sample_script.py') diff --git a/sample_script.py b/sample_script.py new file mode 100755 index 0000000..c3b7843 --- /dev/null +++ b/sample_script.py @@ -0,0 +1,41 @@ +#!/usr/bin/python + +# This is a sample script for using the tool. I would recommend copying +# this and modifying it to suit your needs for a particular test. Make +# sure you redirect the output to a file (e.g. ./sample_script.py > output). + +# Import the modules we need. You should not need to know about +# their internals. +import trace_reader +import sanitizer +import gedf_test +import stats +import stdout_printer + +# Specify your trace files +g6 = [ +'./sample_traces/st-g6-0.bin', +'./sample_traces/st-g6-1.bin', +'./sample_traces/st-g6-2.bin', +'./sample_traces/st-g6-3.bin', +] + +# Here is an example of a custom filter function. +# It will remove from the error stream all inversion_end records indicating +# an inversion of less than 4000000 time units. Thus, you can grep through +# the output looking 'Inversion end' and find only errors for particularly +# long inversions. This is commented out in the pipeline (below) since you +# probably don't want it in general. +def my_filter(record): + if record.record_type == 'error' and record.type_name == 'inversion_end': + if record.job.inversion_end - record.job.inversion_start < 4000000: + return False + return True + +# Pipeline +stream = trace_reader.trace_reader(g6) # Read events from traces +stream = sanitizer.sanitizer(stream) # Remove garbage events +stream = gedf_test.gedf_test(stream) # Produce G-EDF error records +stream = stats.stats(stream) # Produce a statistics record +#stream = filter(my_filter, stream) # Filter some records before printing +stdout_printer.stdout_printer(stream) # Print records to stdout -- cgit v1.2.2