[sysprof/wip/chergert/sysprof-3] libsysprof: ignore kernel symbols if embedded resolver is found



commit aea10d3944613bd0b9882ec8d13ca38856a4ed5b
Author: Christian Hergert <chergert redhat com>
Date:   Tue May 28 22:47:27 2019 -0700

    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.

 src/libsysprof/sysprof-kernel-symbol-resolver.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/libsysprof/sysprof-kernel-symbol-resolver.c b/src/libsysprof/sysprof-kernel-symbol-resolver.c
index ee6ec82..5975616 100644
--- a/src/libsysprof/sysprof-kernel-symbol-resolver.c
+++ b/src/libsysprof/sysprof-kernel-symbol-resolver.c
@@ -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))
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]