示例#1
0
    def _ReadTraceV3File(self, tracev3_path, output_writer):
        '''Reads a tracev3 file.

        Args:
          tracev3_path (str): path of the tracev3 file.
          output_writer (OutputWriter): output writer.

        Returns:
          TraceV3: tracev3 file.
        '''
        file_object = virtual_file.VirtualFile(tracev3_path, 'traceV3')
        trace_file = tracev3_file.TraceV3(self._vfs, file_object,
                                          self._ts_list,
                                          self._uuidtext_folder_path, None,
                                          self._caches)

        # TODO: remove log_list_process_func callback from TraceV3.Parse()
        self._output_writer = output_writer
        trace_file.Parse(log_list_process_func=self._ProcessLogsList)
        # trace_file.Parse(log_list_process_func=self.dumpLogToStdout)
        # save the uuid file into self._caches
        if trace_file._catalog is not None:
            for f in trace_file._catalog.FileObjects:
                s = f._file.file_type if f._file is not None else ''
                if s == 'Uuidtext':
                    key = f.Uuid.hex.upper()
                    if key not in self._caches.cached_uuidtext:
                        self._caches.cached_uuidtext[key] = f
                    pass
                elif s == 'Dsc':
                    key = f._file.filename
                    if key not in self._caches.cached_dsc:
                        self._caches.cached_dsc[key] = f
                else:
                    pass
示例#2
0
    def _ReadTraceV3File(self, tracev3_path, output_writer):
        '''Reads a tracev3 file.

        Args:
          tracev3_path (str): path of the tracev3 file.
          output_writer (OutputWriter): output writer.

        Returns:
          TraceV3: tracev3 file.
        '''
        file_object = virtual_file.VirtualFile(tracev3_path, 'traceV3')
        trace_file = tracev3_file.TraceV3(
            self._vfs, file_object, self._ts_list, self._uuidtext_folder_path,
            self._caches)

        # TODO: remove log_list_process_func callback from TraceV3.Parse() 
        self._output_writer = output_writer
        trace_file.Parse(log_list_process_func=self._ProcessLogsList)
示例#3
0
    def _CreateTestFile(self):
        '''Creates a test tracev3 file.

        Returns:
            tuple[VirtualFile, TraceV3]: virtual and tracev3 file objects for
                testing.
        '''
        file_system = virtual_file_system.VirtualFileSystem(
            virtual_file.VirtualFile)

        path = self._GetTestFilePath(['0000000000000030.tracev3'])
        file_entry = virtual_file.VirtualFile(path, filetype='uuidtext')

        timesync = self._CreateTestTimesync()
        timesync_list = [timesync]

        uuidtext_path = self._GetTestFilePath([])

        test_file = tracev3_file.TraceV3(file_system, file_entry,
                                         timesync_list, uuidtext_path)

        return file_entry, test_file