Esempio n. 1
0
File: ftrace.py Progetto: credp/lisa
    def get_data(self):
        if self.output_path is None:
            raise RuntimeError("Output path was not set.")
        self.target.execute('{0} extract -o {1}; chmod 666 {1}'.format(
            self.target_binary, self.target_output_file),
                            timeout=TIMEOUT,
                            as_root=True)

        # The size of trace.dat will depend on how long trace-cmd was running.
        # Therefore timout for the pull command must also be adjusted
        # accordingly.
        pull_timeout = 10 * (self.stop_time - self.start_time)
        self.target.pull(self.target_output_file,
                         self.output_path,
                         timeout=pull_timeout)
        output = CollectorOutput()
        if not os.path.isfile(self.output_path):
            self.logger.warning('Binary trace not pulled from device.')
        else:
            output.append(CollectorOutputEntry(self.output_path, 'file'))
            if self.autoreport:
                textfile = os.path.splitext(self.output_path)[0] + '.txt'
                if self.report_on_target:
                    self.generate_report_on_target()
                    self.target.pull(self.target_text_file,
                                     textfile,
                                     timeout=pull_timeout)
                else:
                    self.report(self.output_path, textfile)
                output.append(CollectorOutputEntry(textfile, 'file'))
            if self.autoview:
                self.view(self.output_path)
        return output
Esempio n. 2
0
    def get_data(self):
        if self.output_path is None:
            raise RuntimeError("Output path was not set.")

        output = CollectorOutput()

        for label in self.labels:
            if self.command == 'record':
                self._wait_for_data_file_write(label, self.output_path)
                path = self._pull_target_file_to_host(label, 'rpt', self.output_path)
                output.append(CollectorOutputEntry(path, 'file'))
            else:
                path = self._pull_target_file_to_host(label, 'out', self.output_path)
                output.append(CollectorOutputEntry(path, 'file'))
        return output
Esempio n. 3
0
 def get_data(self):
     if self.output_path is None:
         raise RuntimeError("Output path was not set.")
     with open(self.output_path, 'wt') as f:
         f.write(self.dmesg_out + '\n')
     return CollectorOutput(
         [CollectorOutputEntry(self.output_path, 'file')])
Esempio n. 4
0
 def get_data(self):
     if self._collecting:
         raise RuntimeError("get_data was called whilst collecting")
     if self.output_path is None:
         raise RuntimeError("No data collected.")
     return CollectorOutput(
         [CollectorOutputEntry(self.output_path, 'file')])
Esempio n. 5
0
 def get_data(self):
     if self._systrace_process:
         raise RuntimeError("Tracing is underway, call stop() first")
     if self.output_path is None:
         raise RuntimeError("No data collected.")
     return CollectorOutput(
         [CollectorOutputEntry(self.output_path, 'file')])
Esempio n. 6
0
 def get_data(self):
     if self.output_path is None:
         raise RuntimeError("No data collected.")
     return CollectorOutput(
         [CollectorOutputEntry(self.output_path, 'file')])