def _preprocess_data(self, data): # TODO: add fix_threads and fix_tgids options back in here # once we embed the dump data in the file (b/27504068) data = atrace_agent.strip_and_decompress_trace(data) if self._fix_circular_traces: data = atrace_agent.fix_circular_traces(data) return data
def _preprocess_data(self, data): # TODO: add fix_threads and fix_tgids options back in here # once we embed the dump data in the file (b/27504068) data = atrace_agent.strip_and_decompress_trace(data) if self._fix_circular_traces: data = atrace_agent.fix_circular_traces(data) return data
def test_strip_and_decompress_trace(self): with contextlib.nested(open(ATRACE_DATA_RAW, 'r'), open(ATRACE_DATA_STRIPPED, 'r')) as (f1, f2): atrace_data_raw = f1.read() atrace_data_stripped = f2.read() trace_data = atrace_agent.strip_and_decompress_trace(atrace_data_raw) self.assertEqual(atrace_data_stripped, trace_data)
def test_strip_and_decompress_trace(self): with contextlib.nested(open(ATRACE_DATA_RAW, 'r'), open(ATRACE_DATA_STRIPPED, 'r')) as (f1, f2): atrace_data_raw = f1.read() atrace_data_stripped = f2.read() trace_data = atrace_agent.strip_and_decompress_trace( atrace_data_raw) self.assertEqual(atrace_data_stripped, trace_data)