elf: track pid root when building lookaside buffers

We want to know the location of our root if it was specified in the
capture file. Such is useful for decoding symbols that may not be
reported right from perf tooling.

This allows us to try to translate maps for processes in containers.
This commit is contained in:
Christian Hergert
2021-02-24 18:59:35 -08:00
parent b22899474d
commit bd8a8ada26
3 changed files with 61 additions and 35 deletions

View File

@ -24,12 +24,6 @@
#include "sysprof-map-lookaside.h"
struct _SysprofMapLookaside
{
GSequence *seq;
GStringChunk *chunk;
};
static gint
sysprof_map_compare (gconstpointer a,
gconstpointer b,
@ -107,6 +101,16 @@ sysprof_map_lookaside_insert (SysprofMapLookaside *self,
g_sequence_insert_sorted (self->seq, copy, sysprof_map_compare, NULL);
}
void
sysprof_map_lookaside_set_root (SysprofMapLookaside *self,
const char *root)
{
g_assert (self != NULL);
g_assert (root != NULL);
self->root = g_string_chunk_insert_const (self->chunk, root);
}
const SysprofMap *
sysprof_map_lookaside_lookup (SysprofMapLookaside *self,
SysprofCaptureAddress address)