summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2021-07-25 08:42:26 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2021-07-25 08:42:26 (GMT)
commit04e35d437e02a37f17075fa63eb93596916ca0ee (patch)
tree30cc57c219622305ac73a715404c23cdd054ff4c /tools
parente09b951017761236f75137498cc3495a12a91f49 (diff)
wasptool: Make mem_free issue data as csv
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/wasptool11
1 files 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'