You can use functions described in this chapter to introspect ELF and DWARF for query profiling.
You can use functions described in this chapter to introspect [ELF](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format) and [DWARF](https://en.wikipedia.org/wiki/DWARF) for query profiling.
!!! warning "Warning"
These functions are slow and may impose security considerations.
...
...
@@ -16,7 +16,9 @@ ClickHouse saves profiler reports to the [trace_log](../../operations/system_tab
## addressToLine {#addresstoline}
Converts virtual memory address inside ClickHouse server process to the filename and the number of a string in ClickHouse source code, using the debug information installed by the `clickhouse-common-static-dbg` package.
Converts virtual memory address inside ClickHouse server process to the filename and the line number in ClickHouse source code.
If you use official ClickHouse packages, you need to install the `clickhouse-common-static-dbg` package.
-`address_of_binary_instruction` ([UInt64](../../data_types/int_uint.md)) — Address of code instruction that have been executed at the moment of sampling.
-`address_of_binary_instruction` ([UInt64](../../data_types/int_uint.md)) — Address of instruction in a running process.
**Returned value**
- Source code filename and the number of string in this file.
- Source code filename and the line number in this file delimited by colon.
For example, `/build/obj-x86_64-linux-gnu/../dbms/src/Common/ThreadPool.cpp:199`, where `199` is a line number.
- Name of a binary, if the function couldn't find the debug information.
- Empty string, if the address is not valid.
Type: [String](../../data_types/string.md).
...
...
@@ -44,9 +51,38 @@ SET allow_introspection_functions=1
Selecting the first string from the `trace_log` system table:
-`address_of_binary_instruction` ([UInt64](../../data_types/int_uint.md)) — Address of code instruction that have been executed at the moment of sampling.
-`address_of_binary_instruction` ([UInt64](../../data_types/int_uint.md)) — Address of instruction in a running process.
**Returned value**
- Symbol from ClickHouse object files.
- Empty string, if the address is not valid.
Type: [String](../../data_types/string.md).
...
...
@@ -106,9 +136,38 @@ SET allow_introspection_functions=1
Selecting the first string from the `trace_log` system table:
The [arrayMap](higher_order_functions.md#higher_order_functions-array-map) function allows to process each individual element of the `trace` array by the `demangle` function. The result of this processing you see in the `trace_functions` column of output.