aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2022-10-05 11:51:00 -0700
committerTim Newsome <tim@sifive.com>2022-10-12 08:53:50 -0700
commitbed28d5ec7c8cbc8ff22d059d954d20802df152b (patch)
tree96dff595949116df57e2d9d1f51d8675f41f13a4 /tools
parent4270857a76ccc5b840bf229ccb972e5d57b030b6 (diff)
downloadriscv-openocd-bed28d5ec7c8cbc8ff22d059d954d20802df152b.zip
riscv-openocd-bed28d5ec7c8cbc8ff22d059d954d20802df152b.tar.gz
riscv-openocd-bed28d5ec7c8cbc8ff22d059d954d20802df152b.tar.bz2
filter_openocd: Prefer high repetitions.
I'd rather see "these 10 lines were repeated 100 times" than "these 100 lines were repeated 10 times." Change-Id: I88fcf86b10c5fb0ba1d19b21fe054065da90fedd Signed-off-by: Tim Newsome <tim@sifive.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/filter_openocd_log.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/filter_openocd_log.py b/tools/filter_openocd_log.py
index 076be20..666e166 100755
--- a/tools/filter_openocd_log.py
+++ b/tools/filter_openocd_log.py
@@ -50,7 +50,7 @@ def shorten_buffer(outfd, buf, current_repetition):
repetitions.append((matched_lines + length, length))
if repetitions:
- repetitions.sort(key=lambda entry: (entry[0] * (entry[1] / entry[0]), -entry[1]))
+ repetitions.sort(key=lambda entry: -entry[1])
matched_lines, length = repetitions[-1]
repeated = int(matched_lines / length)
if repeated * length >= 3: