Search code examples
androidsystrace

Systrace gives no such option error for --set-tags


I'm following the instructions here to use systrace for my application but I keep getting the following error whenever I try to set the tags for systrace:

systrace.py: error: no such option: --set-tags

This seems to be a rather new issue that just cropped up for me yesterday. Does anyone know what's up? It seems to only be an issue for when I'm trying to systrace on a device running 4.3.


Solution

  • There is no --set-tags option for 4.3. The way systrace works changed significantly, and the documentation hasn't yet been updated. (Edit: it has been updated for 4.3)

    The systrace.py script checks the device version, and forwards the commands to systrace-legacy.py for pre-4.3 devices. That's why the old command still works for older devices.

    An example for a 4.3 device would be:

    python systrace.py gfx view sched dalvik
    

    That is, you just list the tags you want as arguments to the command that starts the tracing.

    I have an example (which also shows off the new app-defined tag feature) here.