diff options
| author | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-17 15:36:30 -0400 |
|---|---|---|
| committer | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-17 15:46:22 -0400 |
| commit | 5aad2261f7c012aa16a93c7c5bf6bda0081658fb (patch) | |
| tree | d9ff8f87b4613639c214032eb3fcf14967d76b5f /dis/summarize.py | |
| parent | 97c1685def13be3724a6d025f4e12f236777a911 (diff) | |
Add updated DIS post-processing scripts from (rejected) RTSS'20 paper
These are compatible with the outputs of all the DIS stressmarks
as instumented with `extra.h`.
Diffstat (limited to 'dis/summarize.py')
| -rwxr-xr-x | dis/summarize.py | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/dis/summarize.py b/dis/summarize.py index f8f6929..31dcccc 100755 --- a/dis/summarize.py +++ b/dis/summarize.py | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | import sys | 2 | import sys |
| 3 | 3 | ||
| 4 | f = sys.argv[1] | 4 | f = sys.argv[1] |
| 5 | if len(sys.argv) < 2: | ||
| 6 | print("Usage "+sys.argv[0]+" <filename> --inf-precision") | ||
| 5 | res = {} | 7 | res = {} |
| 6 | mem_res = {} | 8 | mem_res = {} |
| 7 | memw_res = {} | 9 | memw_res = {} |
| @@ -48,24 +50,20 @@ def percentile(N, percent, key=lambda x:x): | |||
| 48 | d1 = key(N[int(c)]) * (k-f) | 50 | d1 = key(N[int(c)]) * (k-f) |
| 49 | return d0+d1 | 51 | return d0+d1 |
| 50 | ## end of http://code.activestate.com/recipes/511478/ }}} | 52 | ## end of http://code.activestate.com/recipes/511478/ }}} |
| 51 | """ | 53 | avg_max = 0 |
| 52 | print("Average times:") | 54 | avg_99th = 0 |
| 53 | for r in res.keys(): | 55 | avg_avg = 0 |
| 54 | print(res[r]/samples[r]) | ||
| 55 | |||
| 56 | print("Average memory read:") | ||
| 57 | for r in mem_res.keys(): | ||
| 58 | print(mem_res[r]/samples[r]) | ||
| 59 | |||
| 60 | print("Average memory write:") | ||
| 61 | for r in memw_res.keys(): | ||
| 62 | print(memw_res[r]/samples[r]) | ||
| 63 | |||
| 64 | print("Max times:") | ||
| 65 | for r in max_res.keys(): | ||
| 66 | print(max_res[r]) | ||
| 67 | """ | ||
| 68 | print("Name\t\tAverage\t\tMax\t\t99th %\t\tAvg Mem Read\tAvg Mem Write\t") | 56 | print("Name\t\tAverage\t\tMax\t\t99th %\t\tAvg Mem Read\tAvg Mem Write\t") |
| 69 | for r in res.keys(): | 57 | for r in sorted(res.keys()): |
| 70 | # print(r + "\t\t" + str(res[r]/samples[r]) + "\t\t" + str(max_res[r])) | 58 | # print(r + "\t\t" + str(res[r]/samples[r]) + "\t\t" + str(max_res[r])) |
| 71 | print("{:12}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}".format(r, sum(res[r])/len(res[r]), max(res[r]), percentile(sorted(res[r]), 0.99), mem_res[r]/samples[r], memw_res[r]/samples[r])) | 59 | avg_avg += sum(res[r])/len(res[r]) |
| 60 | avg_max += max(res[r]) | ||
| 61 | avg_99th += percentile(sorted(res[r]), 0.99) | ||
| 62 | if len(sys.argv) > 2 and sys.argv[2] == "--inf-precision": | ||
| 63 | print("{:12}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}".format(r, sum(res[r])/len(res[r]), max(res[r]), percentile(sorted(res[r]), 0.99), mem_res[r]/samples[r], memw_res[r]/samples[r])) | ||
| 64 | else: | ||
| 65 | print("{:12.12}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}".format(r, sum(res[r])/len(res[r]), max(res[r]), percentile(sorted(res[r]), 0.99), mem_res[r]/samples[r], memw_res[r]/samples[r])) | ||
| 66 | |||
| 67 | print("Average average:", avg_avg/len(res.keys())) | ||
| 68 | print("Average max:", avg_max/len(res.keys())) | ||
| 69 | print("Average 99th:", avg_99th/len(res.keys())) | ||
