Skip to content
Browse files

sanitycheck: Record time used in BinaryHandler

So the time used to run boards which use the BinaryHandler can be
reported, record the time used from spawning the process until
it finnishes or is killed.
The BinaryHandler is used by the "native" boards, unit tests,
nsim and Renode.

Signed-off-by: Alberto Escolar Piedras <>
  • Loading branch information...
aescolar authored and nashif committed Jul 2, 2019
1 parent 502094b commit 649368c0184212c54ed3990b192adc6c01282c58
Showing with 5 additions and 0 deletions.
  1. +5 −0 scripts/sanitycheck
@@ -581,6 +581,9 @@ class BinaryHandler(Handler):
verbose("Spawning process: " +
" ".join(shlex.quote(word) for word in command) + os.linesep +
"Spawning process in directory: " + self.outdir)

start_time = time.time();

with subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=self.outdir) as proc:
verbose("Spawning BinaryHandler Thread for %s" %
t = threading.Thread(target=self._output_reader, args=(proc, harness, ))
@@ -594,6 +597,8 @@ class BinaryHandler(Handler):
self.returncode = proc.returncode

self.metrics["handler_time"] = time.time() - start_time;

if options.enable_coverage:
returncode =["GCOV_PREFIX=" + self.outdir,
"gcov", self.sourcedir, "-b", "-s", self.outdir], shell=True)

0 comments on commit 649368c

Please sign in to comment.
You can’t perform that action at this time.