#!/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