PerfettoTraceRecorder

public class PerfettoTraceRecorder
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.PerfettoTraceRecorder


A utility class for recording perfetto trace on a ITestDevice.

Summary

Public constructors

PerfettoTraceRecorder()

Public methods

void startTrace(ITestDevice device, String traceConfigFileName, Map<String, String> extraConfigs)

Starts recording perfetto trace on device.

File stopTrace(ITestDevice device)

Stops recording perfetto trace on the device and pulls the file.

Public constructors

PerfettoTraceRecorder

public PerfettoTraceRecorder ()

Public methods

startTrace

public void startTrace (ITestDevice device, 
                String traceConfigFileName, 
                Map<String, String> extraConfigs)

Starts recording perfetto trace on device. Must call PerfettoTraceRecorder.stopTrace(ITestDevice) afterwards to stop the trace recording.

Parameters
device ITestDevice: A ITestDevice where trace will be recorded.

traceConfigFileName String: Name of the trace config file.

extraConfigs Map: A map of extra configs to be added to the trace config file.

Throws
IOException

stopTrace

public File stopTrace (ITestDevice device)

Stops recording perfetto trace on the device and pulls the file.

Parameters
device ITestDevice: device for which to stop the recording.

Returns
File Returns the host-side perfetto trace file, or null if failed.