| Index: telemetry/telemetry/internal/platform/tracing_agent/atrace_tracing_agent.py
|
| diff --git a/telemetry/telemetry/internal/platform/tracing_agent/atrace_tracing_agent.py b/telemetry/telemetry/internal/platform/tracing_agent/atrace_tracing_agent.py
|
| index 5a939dfa15b247243fb3f91d4739caef894816a7..9e1f1a4ebdf7ff73a92856b5735704d9064455f2 100644
|
| --- a/telemetry/telemetry/internal/platform/tracing_agent/atrace_tracing_agent.py
|
| +++ b/telemetry/telemetry/internal/platform/tracing_agent/atrace_tracing_agent.py
|
| @@ -9,34 +9,13 @@ from telemetry.timeline import trace_data
|
| from devil.android.sdk import version_codes
|
|
|
|
|
| -class AtraceOpts(object):
|
| - '''Object that holds Atrace options.
|
| -
|
| - In systrace, the atrace options are provided by an object generated
|
| - by argparse. Since we're not using the command line options here and we
|
| - want to hard-code the relevant options, we create an object here
|
| - to do so.
|
| - '''
|
| -
|
| - def __init__(self, serial_number, app_name):
|
| - self.compress_trace_data = True
|
| - self.trace_time = None
|
| - self.trace_buf_size = None
|
| - self.app_name = (','.join(app_name) if isinstance(app_name, list)
|
| - else app_name)
|
| - self.kfuncs = None
|
| - self.fix_threads = True
|
| - self.fix_tgids = True
|
| - self.fix_circular = True
|
| - self.device_serial_number = serial_number
|
| -
|
| class AtraceTracingAgent(tracing_agent.TracingAgent):
|
| def __init__(self, platform_backend):
|
| super(AtraceTracingAgent, self).__init__(platform_backend)
|
| self._device = platform_backend.device
|
| self._categories = None
|
| self._atrace_agent = atrace_agent.AtraceAgent()
|
| - self._options = None
|
| + self._config = None
|
|
|
| @classmethod
|
| def IsSupported(cls, platform_backend):
|
| @@ -46,10 +25,16 @@ class AtraceTracingAgent(tracing_agent.TracingAgent):
|
| def StartAgentTracing(self, config, timeout):
|
| if not config.enable_atrace_trace:
|
| return False
|
| - self._categories = config.atrace_config.categories
|
| - self._options = AtraceOpts(str(self._device), config.atrace_config.app_name)
|
| - return self._atrace_agent.StartAgentTracing(
|
| - self._options, self._categories, timeout)
|
| +
|
| + app_name = (','.join(config.atrace_config.app_name) if
|
| + isinstance(config.atrace_config.app_name, list) else
|
| + config.atrace_config.app_name)
|
| + self._config = atrace_agent.AtraceConfig(config.atrace_config.categories,
|
| + None, None, app_name, True, True,
|
| + True, True, None, None,
|
| + str(self._device), None,
|
| + 'android')
|
| + return self._atrace_agent.StartAgentTracing(self._config, timeout)
|
|
|
| def StopAgentTracing(self):
|
| self._atrace_agent.StopAgentTracing()
|
|
|