bytrace Usage Guidelines
Overview
bytrace is a tool for you to trace processes and analyze performance. It encapsulates and extends the kernel ftrace and supports event tracking in the user space. With bytrace, you can open a user-space or kernel-space label you want to view (run the bytrace -l command to query all the supported labels) and run the --trace_begin and -o filename (or --output filename) commands to capture traces and dump them to a specified file.
How to Develop
bytrace supports the following commands:
Table 1 Commands
Usage Example
The following are some examples of bytrace commands:
- Run the following command to query supported labels:
bytrace -l
Alternatively, you can run the following command:
bytrace --list_categories
- Run the following command to capture traces whose label is ability, with the buffer size set to 4096 KB and bytrace uptime set to 10s:
bytrace -b 4096 -t 10 --overwrite ability > /data/mytrace.ftrace
- Run the following command to set the clock type for traces to mono:
bytrace --trace_clock mono -b 4096 -t 10 --overwrite ability > /data/mytrace.ftrace
- Run the following command to compress the captured trace:
bytrace -z -b 4096 -t 10 --overwrite ability > /data/mytrace.ftrace