Skip to content

Commit

Permalink
sanitycheck: Record time used in BinaryHandler
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
aescolar authored and nashif committed Jul 2, 2019
1 parent 502094b commit 649368c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/sanitycheck
Original file line number Diff line number Diff line change
Expand Up @@ -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" % self.name)
t = threading.Thread(target=self._output_reader, args=(proc, harness, ))
Expand All @@ -594,6 +597,8 @@ class BinaryHandler(Handler):
proc.wait()
self.returncode = proc.returncode

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

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

0 comments on commit 649368c

Please sign in to comment.