Configuration File Usage Example
Configuration File (RECORD_CONF)
In both methods of using the tool, you need to use the configuration file to specify the functions to be instrumented. This file can be created by yourself or generated using the symbol tool. It is in plaintext format and each line contains a function symbol name.
An example of the configuration file content (my_app.conf):
1 2 3 4 | _Z4addii connect epoll_wait _ZN12MyNameSpace8MyClass4evalEv # C++ Mangled Name |
The example file specifies the collection of functions such as _Z4addii and epoll_wait.
Custom functions are named according to the following rules:
- For a binary file generated from C++ compilation, function names are rewritten by the
Mangled Name mechanism. You can run the nm binary_file or readelf -s binary_file command to view the rewritten function name. - For a binary file generated from C compilation, use the original function names.
- For the Attach mode, you can enter the original function names in the configuration file. For example, you can enter abc::Service::Func for the following function in the configuration file.
1 2 3 4 5 6
namespace abc { class Service { public: void Func(); } }
If you use a standalone tool package, you can use the symbol binary file to quickly generate a configuration file.
1 | ./symbol /path/to/your_app -e 'Test&Symbol' -o path/to/output.conf |
- The -e option specifies the symbol to be collected. Test&Symbol indicates that all symbols containing Test and Symbol are collected.
- The -o option specifies the path to the configuration file to be generated.
Parent topic: Link Latency Detection