From 7e80a381d8ffeb6282d476b9956d6a3d8fa63a04 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Thu, 11 May 2017 14:22:28 +0100 Subject: ftrace: fix get_trace when outfile is directory If the path passed into get_trace() is a directory, the collector is supposed to use the name of the output file on target for the file on the host. Until now however, os.path.dirname() was mistakenly called on the target location (returning the containing directory rather than the base name of the file). --- devlib/trace/ftrace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devlib/trace/ftrace.py b/devlib/trace/ftrace.py index 7affed5..6a2ef84 100644 --- a/devlib/trace/ftrace.py +++ b/devlib/trace/ftrace.py @@ -202,7 +202,7 @@ class FtraceCollector(TraceCollector): def get_trace(self, outfile): if os.path.isdir(outfile): - outfile = os.path.join(outfile, os.path.dirname(self.target_output_file)) + outfile = os.path.join(outfile, os.path.basename(self.target_output_file)) self.target.execute('{} extract -o {}'.format(self.target_binary, self.target_output_file), timeout=TIMEOUT, as_root=True) -- cgit v1.2.3