From 6d8eb948d11251a60ac746d7df5cec3b45b43263 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Tue, 24 Oct 2023 02:18:40 -0500 Subject: [PATCH] Tweaked tracebd.py to prioritize progs over erases Yes, erases are the more costly operation that we should highlight. But, aside from broken code, you can never prog more than you erase. This makes it more useful to priortize progs over erases, so erases without an overlaying prog show up as a relatively unique blue, indicating regions of memory that have been erased but not progged. Too many erased-but-not-progged regions indicate a potentially wastefull algorithm. --- scripts/tracebd.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/tracebd.py b/scripts/tracebd.py index 7b1594ad..dfaccb2b 100755 --- a/scripts/tracebd.py +++ b/scripts/tracebd.py @@ -315,12 +315,12 @@ class Block(int): c = wear_chars[int(w * (len(wear_chars)-1))] f.append(wear_colors[int(w * (len(wear_colors)-1))]) - if erase and self.erased: - c = chars[2] - f.append(colors[2]) - elif prog and self.proged: + if prog and self.proged: c = chars[1] f.append(colors[1]) + elif erase and self.erased: + c = chars[2] + f.append(colors[2]) elif read and self.readed: c = chars[0] f.append(colors[0])