2 # -*- coding: utf-8 -*-
5 This script parses debug log events related to Lua memory (de)allocations ( lines
6 starting wiht "LT: ") and produces a data for gnuplot program
10 ./simu 2>&1 | grep "^LT" | ../radio/util/lua_trace2plot.py > data.plot
11 gnuplot -e 'set xtics rotate; plot "data.plot" using 2:xtic(1) ; pause mouse close'
14 from __future__
import print_function
20 inputFile
= sys
.argv
[1]
21 inp
= open(inputFile
, "r")
33 line
= line
.strip('\r\n')
36 if line
.startswith("LT:"):
42 data
= parts
[1].strip("[").strip("]").split(",")
48 print("'%s'\t%d" % (line
, memUsed
))
52 print("'%s'\t%d" % (line
, memUsed
))