mirror of
https://github.com/openharmony/developtools_bytrace_standard.git
synced 2026-06-29 10:52:52 -04:00
master
ByTrace
Introduction
ByTrace is a tool for you to trace processes and monitor performance. It encapsulates and extends the ftrace in the kernel and supports tracing in the user space. This tool provides APIs and commands:
- APIs: When developing an application, you can call ByTrace APIs in the application key code to perform tracing.
- Commands: You can enable the desired label to obtain the tracing information. With ByTrace, you can enable 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 corresponding commands to capture traces and dump them to a specified file.
Architecture
Directory Structure
/developtools/bytrace
├── bin # ByTrace code
│ └── include # Header files
│ └── src # Source files
│ └── test # Test cases
├── interfaces # APIs
│ └── innerkits # Header files of internal subsystems
│ └── kits # Header files exposed externally
├── script # Scripts
Usage
The following table lists the commands supported by ByTrace.
** Table 1** Commands supported by ByTrace
The following are some example ByTrace commands:
-
Run the following command to query supported labels:
bytrace -lor
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 traced data:
bytrace -z -b 4096 -t 10 --overwrite ability > /data/mytrace.ftrace
Repositories Involved
Development Tools Subsystem
developtools_bytrace_standard
Description
Languages
C++
90.7%
Python
7.8%
Batchfile
1.5%
