Enable atrace annotations

Streamline can capture Android trace points that atrace generates. Application-generated atrace macros are converted into either string annotations or counter charts. Select Android ATRACE_TAG_* macros as events for your capture.

Before you begin

  • To collect atrace, your Android device must be rooted and use a Linux kernel version of 3.10 or later.

  • You must have set up and run Streamline with Android device root user access. See Profile your system for instructions on how to do this.

  • Streamline uses a Dalvik executable file called notify.dex to alert applications that atrace annotations are enabled. If you use the TCP device type when capturing from the Start view, you must first manually install notify.dex. Locate the file in <install_directory>/streamline/bin/android/arm64 and copy it onto your device into the same directory as gatord. Use the same executable file for both 64-bit and 32-bit architectures. If required, you can find the java source code for notify.dex in two locations:

Procedure

  1. In the Start view, select your device and application that you want to capture.

  2. In the Configure capture section, select Use advanced mode.

  3. Click Select counters.

    Note

    You can also enable atrace counters in the equivalent Select Counters dialog for a TCP device capture. You must have installed notify.dex to enable atrace, as described in Before you begin.

  4. Drag Android: Atrace into Events to collect. You can find Android Atrace in Available events → Atrace control. Capture events from the Atrace profile do not work without this event.

    Note

    If you expect to see atrace events in this dialog box but none are displayed, click the Warnings tag to see why atrace support is disabled. Ensure your device is compatible and configured as described in the Before you begin section of this topic.

  5. Locate the Atrace profile in Available events → Atrace. Drag each event that you want to collect into Events to collect.

  6. Click Save.

Next steps

Start the capture. In the Streamline GUI, click Start capture.

In your capture, string annotations or counter charts are created from your atrace macros. You can learn more about annotations and where they appear in the Timeline and Log views in the Annotate your code section of the the Streamline User Guide.