An atrace utility developed primarily for identifying the root causes of ANRs during Monkey
testing. Invoking the start command will start asynchronously monitoring the tagged traces in a
circular buffer. Invoking stop will dump the contents of the buffer into an InputStreamSource
that it returns.
To use this for the case mentioned above (identifying ANRs), one has to first implement the start
method at the beginning of the test and the end method immediately at the end of the test. From
here one can choose how to store and handle the data. Most should probably use the systrace
with the --from-file option to generate an HTML viewer.
public CircularAtraceUtil ()
public static FileInputStreamSource endTrace (ITestDevice device)
Stops and dumps atrace asynchronously into a File, which it returns in an InputStreamSource.
public static void startTrace (ITestDevice device,
Starts atrace asynchronously with the tags specified.
ITestDevice: the device whose actions will be monitored
: tags that atrace should monitor; defaults to 'am gfx sched view'
int: the circular buffers size in MB