From 04e35d437e02a37f17075fa63eb93596916ca0ee Mon Sep 17 00:00:00 2001 From: Daniel Thompson Date: Sun, 25 Jul 2021 09:42:26 +0100 Subject: [PATCH] wasptool: Make mem_free issue data as csv Signed-off-by: Daniel Thompson --- tools/wasptool | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/wasptool b/tools/wasptool index 4bd9b21..f7499c5 100755 --- a/tools/wasptool +++ b/tools/wasptool @@ -11,6 +11,7 @@ import pexpect import time import types import string +import subprocess import sys def draw_pbar(percent, quiet=False, end='\r'): @@ -193,10 +194,14 @@ def handle_battery_level(c): print(f'Battery: {c.run_command("watch.battery.level()")}%') def handle_memory_free(c): - # wasp namespace to avoid having to import into the global space - print(f'Before GC: {c.run_command("wasp.gc.mem_free()"):7}') + before_gc = c.run_command("wasp.gc.mem_free()") c.run_command('wasp.gc.collect()') - print(f'After GC: {c.run_command("wasp.gc.mem_free()"):7}') + after_gc = c.run_command("wasp.gc.mem_free()") + + p = subprocess.run(["git", "describe", "--tags"], capture_output=True) + version = p.stdout.decode('UTF-8').strip() + + print(f'"{version}",{before_gc},{after_gc}') def handle_reset(c, ota=False): cmd = 'reset'