libsysprof: ignore kernel symbols if embedded resolver is found

This ensures that we don't mix symbols from kernels if we can reasonably
expect that the necessary symbols were decoded by the peer.
This commit is contained in:
Christian Hergert
2019-05-28 22:47:27 -07:00
parent 7743a047b6
commit 1ee1a7cc3a

View File

@ -82,6 +82,14 @@ sysprof_kernel_symbol_resolver_load (SysprofSymbolResolver *resolver,
g_assert (SYSPROF_IS_KERNEL_SYMBOL_RESOLVER (self));
g_assert (reader != NULL);
/* If there is an embedded __symbols__ file, then we won't do anything
* because we want to use the symbols from the peer.
*/
if (sysprof_capture_reader_find_file (reader, "__symbols__"))
return;
sysprof_capture_reader_reset (reader);
if (-1 == (data_fd = sysprof_memfd_create ("[sysprof-kallsyms]")) ||
!sysprof_capture_reader_read_file_fd (reader, "/proc/kallsyms", data_fd))
{