diff options
| author | Mac Mollison <mollison@cs.unc.edu> | 2010-12-15 09:53:23 -0500 |
|---|---|---|
| committer | Mac Mollison <mollison@cs.unc.edu> | 2010-12-15 09:53:23 -0500 |
| commit | c364f1d807eeb246ca67184246fd2c8d7933b8b6 (patch) | |
| tree | 4146a91547d660e055a4d60f023fe7879075d11a /unit-trace | |
| parent | 51e246d367d043913a882080abde3d8bae5ce4d4 (diff) | |
Improve behavior when out-of-order record detected
In order to sort records from different files into a single
stream (in order of timestamp), unit-trace uses per-cpu buffers;
the length of the buffers was previously hardcoded. If that
length proved insufficient (resulting in out-of-order records),
before this commit, unit-trace produced a FATAL ERROR and
terminated.
Now, unit-trace merely keeps a record of all out-of-order
records and prints a warning at the end, listing them.
The motivation for this change was the observation that
at least some times, grossly out-of-order errors were at
the very beginning of the trace (e.g. task system release),
so they don't really matter. If we know the IDs of the records
that are unordered, we are able to check (with the -o output)
to see if their misordering actually matters or not.
Moreover, the buffer size can now be specified with -b, and
the previously hard-coded value (200) is the default. Making
this number smaller greatly improves runtime, and vice versa.
I suspect that further investigation into the problem of sorting
records will show that the current method is overkill; down the
road, we may be able to replace this method with something much
faster. (The current method has the advantage that it is extremely
scalable, but I don't think that pays off for the size of traces
we typically examine.)
Diffstat (limited to 'unit-trace')
| -rwxr-xr-x | unit-trace | 12 |
1 files changed, 9 insertions, 3 deletions
| @@ -35,6 +35,8 @@ parser.add_option("-e", "--earliest", default=0, type=int, dest="earliest", | |||
| 35 | help="Earliest timestamp of interest") | 35 | help="Earliest timestamp of interest") |
| 36 | parser.add_option("-l", "--latest", default=0, type=int, dest="latest", | 36 | parser.add_option("-l", "--latest", default=0, type=int, dest="latest", |
| 37 | help="Latest timestamp of interest") | 37 | help="Latest timestamp of interest") |
| 38 | parser.add_option("-b", "--bufsize", dest="buffsize", default=200, type=int, | ||
| 39 | help="Per-CPU buffer size for sorting records") | ||
| 38 | (options, traces) = parser.parse_args() | 40 | (options, traces) = parser.parse_args() |
| 39 | traces = list(traces) | 41 | traces = list(traces) |
| 40 | if len(traces) < 1: | 42 | if len(traces) < 1: |
| @@ -50,7 +52,7 @@ import unit_trace | |||
| 50 | 52 | ||
| 51 | # Read events from traces | 53 | # Read events from traces |
| 52 | from unit_trace import trace_reader | 54 | from unit_trace import trace_reader |
| 53 | stream = trace_reader.trace_reader(traces) | 55 | stream = trace_reader.trace_reader(traces, options.buffsize) |
| 54 | 56 | ||
| 55 | # Skip over records | 57 | # Skip over records |
| 56 | if options.skipnum > 0: | 58 | if options.skipnum > 0: |
| @@ -100,7 +102,7 @@ if options.gedf is True: | |||
| 100 | # This might cause a performance bottleneck that could be eliminated by | 102 | # This might cause a performance bottleneck that could be eliminated by |
| 101 | # checking how many we actually need :-) | 103 | # checking how many we actually need :-) |
| 102 | import itertools | 104 | import itertools |
| 103 | stream1, stream2, stream3 = itertools.tee(stream,3) | 105 | stream1, stream2, stream3, stream4 = itertools.tee(stream,4) |
| 104 | 106 | ||
| 105 | # Call standard out printer | 107 | # Call standard out printer |
| 106 | if options.stdout is True: | 108 | if options.stdout is True: |
| @@ -117,7 +119,11 @@ if options.num_inversions > -1: | |||
| 117 | from unit_trace import gedf_inversion_stat_printer | 119 | from unit_trace import gedf_inversion_stat_printer |
| 118 | gedf_inversion_stat_printer.gedf_inversion_stat_printer(stream2,options.num_inversions) | 120 | gedf_inversion_stat_printer.gedf_inversion_stat_printer(stream2,options.num_inversions) |
| 119 | 121 | ||
| 122 | # Print any warnings | ||
| 123 | from unit_trace import warning_printer | ||
| 124 | warning_printer.warning_printer(stream3) | ||
| 125 | |||
| 120 | # Call visualizer | 126 | # Call visualizer |
| 121 | if options.visualize is True: | 127 | if options.visualize is True: |
| 122 | from unit_trace import viz | 128 | from unit_trace import viz |
| 123 | viz.visualizer.visualizer(stream3, options.time_per_maj) | 129 | viz.visualizer.visualizer(stream4, options.time_per_maj) |
