gstrace
Function Description
gstrace, provided by openGauss, is used to trace the kernel code execution path, record kernel data structure, and analyze code performance. The number of trace points and data are fixed in the version and cannot be dynamically added or deleted.
WARNING:
- The specified memory variables dumped from the kernel are used only for diagnosis and analysis. Registers or memory addresses will not be randomly and directly specified. The read memory addresses are hard-coded in the development, and no register or memory is read or modified randomly.
- Trace points may involve sensitive data. Before collecting information to be traced, you need to obtain authorization and permission from the customer.
- openGauss does not point on sensitive information or trace user-related data.
- The trace is used only for diagnosis. Enabling the trace function affects the performance, and the impact depends on the load and the modules to be traced.
- The permission of the trace tool is 0700, which indicates that only database users can read, write, and execute the trace tool.
NOTE: If the process is stopped abnormally, the gstrace_trace_cfg_* file will exist in the /dev/shm directory. You can manually delete the file.
Syntax
gstrace [start|stop|config|dump|detailcodepath|analyze] [-p <port>][-s <BUFFER_SIZE>] [-f <DUMP_FILE>] [-o <OUTPUT_FILE>] [-t <STEP_SIZE>]
Parameter Description
Table 1 gs_trace parameters
Example
Start the tracing.
gstrace start -p 207787
Stop the tracing.
gstrace stop -p 207787
Check the configurations for tracing.
gstrace config -p 207787
dump trace
gstrace dump -p 207787 -o /data/207787.dump
Parses dumped details.
gstrace detail -f /data/207787.dump -o /data/207787.detail
Parse dumped codepath.
gstrace codepath -f /data/207787.dump -o /data/207787.codepath
Analyze the global performance.
gstrace analyze -f /data/207787.dump -o /data/207787.perf
Analyze the segment performance.
gstrace analyze -f /data/207787.dump -o /data/207787.perf -t 1
Feedback