gstrace
Function
gstrace is used to trace the kernel code execution path, record the kernel data structure, and analyze code performance. The limited trace points and data are fixed in the version and cannot be dynamically added or deleted.
WARNING
- The data of the memory variable specified by the kernel dump is used for diagnosis and analysis. There is no behavior of directly specifying any register or memory address. The read memory addresses are hard-coded in the development phase, and no register or memory is read or modified randomly.
- Trace points may involve sensitive data. Before collecting trace information, you need to negotiate with the customer and obtain authorization and permission.
- openGauss does not dot sensitive information, and therefore does not trace user-related data.
- The trace function is used only for diagnosis. Enabling the trace function affects the performance. The impact varies depending on the load and the trace module.
- The permission of the Trace tool is 0700, which indicates read, write, and execution by database users only.
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 trace function.
gstrace start -p 8000 -
Stop the trace function.
gstrace stop -p 8000 -
Check the trace configuration information.
gstrace config -p 8000 -
dump trace
gstrace dump -p 8000 -o /data/8000.dump -
Parse dump details.
gstrace detail -f /data/8000.dump -o /data/8000.detail -
Parse dump codepath.
gstrace codepath -f /data/8000.dump -o /data/8000.codepath -
Analyze global performance.
gstrace analyze -f /data/8000.dump -o /data/8000.perf -
Analyze fragment performance.
gstrace analyze -f /data/8000.dump -o /data/8000.perf -t 1