Skip to content

Commit

Permalink
Fix for trace checker
Browse files Browse the repository at this point in the history
Change-Id: Ib8a0df7b7bb0da2e68b5b4d99ce8025de169f317
  • Loading branch information
rkebichi committed Sep 11, 2020
1 parent 361f099 commit 29da9a7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions script/check_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ def diff_strings(cnt_r, cnt, metric):
for evt2 in events_order[tid]:
if diff_cnt == diff_cnt_r:
if evt != evt2:
print (">I< Difference starts at index: " + str(diff_cnt_r) + ", tid_r " + str(tid_r) + ", tid " + str(tid) + ", with evts " + evt + " and " + evt2 + "\n")
print (">I< Difference starts at tid rank: " + str(cnt_tid) + " event index: " + str(diff_cnt_r) + ", tid_r " + str(tid_r) + ", tid " + str(tid) + ", with evts " + evt + " and " + evt2 + "\n")
found_diff_evt = 1
break
diff_cnt += 1
diff_cnt_r += 1
if found_diff_evt: break
if len(events_order_r[tid_r]) != len(events_order[tid]) and found_diff_evt == 0:
print (">I< Difference starts at index: " + str(min(len(events_order_r[tid_r]), len(events_order[tid]))) + ", with missing evts\n")
print (">I< Difference starts at tid rank: " + str(cnt_tid) + " event index: " + str(min(len(events_order_r[tid_r]), len(events_order[tid]))) + ", with missing evts\n")
break
cnt_tid += 1
cnt_tid_r += 1
Expand Down Expand Up @@ -292,6 +292,10 @@ def gen_events_info(tracefile, trace_level, no_events_cnt, events2ignore, events
if metric == 'or':
for tid in sorted (events_order.keys()) :
res = res + str(events_order[tid])
if metric == 'cnt':
newres = res.split('\n')
newres = sorted(newres)
res = str(newres)
return res

parser = argparse.ArgumentParser(description='check_trace.py: check a trace aainst golden ref. Returns 0 for success, 1 for failure')
Expand Down

0 comments on commit 29da9a7

Please sign in to comment.