From e16a4328b033241efd8cf7ab9a7795ad0e5fd054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20L=C3=A5ng?= Date: Thu, 9 Nov 2017 21:02:07 +0100 Subject: [PATCH] Bias --dump-spec towards earlier edges over later This is an attempted fix aimed at a perceived flaw in --dump-spec, in that it generates specs that are "technically correct", by only matching one trace due to containing IIDs that are unique to that trace, but "miss the point" in what characterises the trace. This change does sometimes result in larger specs, but hopefully closer to what a human would write. --- src/TraceDumper.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/TraceDumper.cpp b/src/TraceDumper.cpp index 29f67f0bf..aa2c484ae 100644 --- a/src/TraceDumper.cpp +++ b/src/TraceDumper.cpp @@ -316,15 +316,14 @@ namespace TraceDumper { */ static void delete_implied(trace_set_spec &set, const DPORDriver::Result &res) { for (trace_spec &spec : set) { - for (auto it = spec.begin(); it != spec.end();) { + for (auto it = spec.end(); it != spec.begin();) { + --it; auto traces = get_traces(res); for (auto it2 = spec.begin(); it2 != spec.end(); ++it2) { if (it2 != it) filter_traces(traces, *it2); } if (traces.size() == 1) { it = spec.erase(it); - } else { - ++it; } } }