aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimov <sergei.trofimov@arm.com>2017-05-11 14:22:28 +0100
committerSergei Trofimov <sergei.trofimov@arm.com>2017-05-12 09:14:35 +0100
commit7e80a381d8ffeb6282d476b9956d6a3d8fa63a04 (patch)
tree9eddbdcafa521160250a73febbe38dd500f372cc
parent4dc54728c1173c4ddf16a0a682dccc7fa7cfa795 (diff)
downloaddevlib-7e80a381d8ffeb6282d476b9956d6a3d8fa63a04.tar.gz
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).
-rw-r--r--devlib/trace/ftrace.py2
1 files changed, 1 insertions, 1 deletions
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)