This will help to identify ambiguous mapping files. One hash should map to one report. LNST would use the last hash from duplicates found in such mapping file, so it's silently masking this issue.
Signed-off-by: Jan Tluka jtluka@redhat.com --- lnst/Controller/PerfRepoMapping.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lnst/Controller/PerfRepoMapping.py b/lnst/Controller/PerfRepoMapping.py index 2cec2d8..3a6cee7 100644 --- a/lnst/Controller/PerfRepoMapping.py +++ b/lnst/Controller/PerfRepoMapping.py @@ -42,7 +42,12 @@ class PerfRepoMapping(object): for line in lines: match = line_re.match(line) if match is not None and len(match.groups()) == 2: - res_dict[match.group(1)] = match.group(2) + h = match.group(1) + if h in res_dict: + logging.warn("Duplicate entry found for hash: %s\n" + "\t %s = %s (previous)\n" + "\t %s (new)" % (h, h, res_dict[h], line)) + res_dict[h] = match.group(2) else: logging.warn("Skipping mapping line, invalid format:\n%s" %line) self._mapping = res_dict
On Fri, Jul 21, 2017 at 04:32:12PM +0200, Jan Tluka wrote:
This will help to identify ambiguous mapping files. One hash should map to one report. LNST would use the last hash from duplicates found in such mapping file, so it's silently masking this issue.
Signed-off-by: Jan Tluka jtluka@redhat.com
lnst/Controller/PerfRepoMapping.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lnst/Controller/PerfRepoMapping.py b/lnst/Controller/PerfRepoMapping.py index 2cec2d8..3a6cee7 100644 --- a/lnst/Controller/PerfRepoMapping.py +++ b/lnst/Controller/PerfRepoMapping.py @@ -42,7 +42,12 @@ class PerfRepoMapping(object): for line in lines: match = line_re.match(line) if match is not None and len(match.groups()) == 2:
res_dict[match.group(1)] = match.group(2)
h = match.group(1)
if h in res_dict:
logging.warn("Duplicate entry found for hash: %s\n"
"\t %s = %s (previous)\n"
"\t %s (new)" % (h, h, res_dict[h], line))
res_dict[h] = match.group(2) else: logging.warn("Skipping mapping line, invalid format:\n%s" %line) self._mapping = res_dict
-- 2.7.5 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@lists.fedorahosted.org
pushed, thanks.
-Ondrej
lnst-developers@lists.fedorahosted.org