mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
capture: rename PidRoot to Overlay and add src/dst
Really what we want to deal with here is tracking an overlay that we may need to be able to decode after the fact (in case processes exit or we need to do post-processing symbol resolution). For the podman case, that is $some_path mapped to root (/), generally speaking. For flatpak though, that would have two mappings, one for /app and another for /usr (possibly more).
This commit is contained in:
@ -162,10 +162,12 @@ sysprof_elf_symbol_resolver_load (SysprofSymbolResolver *resolver,
|
||||
|
||||
sysprof_map_lookaside_insert (lookaside, &map);
|
||||
}
|
||||
else if (type == SYSPROF_CAPTURE_FRAME_PID_ROOT)
|
||||
else if (type == SYSPROF_CAPTURE_FRAME_OVERLAY)
|
||||
{
|
||||
const SysprofCapturePidRoot *ev = sysprof_capture_reader_read_pid_root (reader);
|
||||
const SysprofCaptureOverlay *ev = sysprof_capture_reader_read_overlay (reader);
|
||||
SysprofMapLookaside *lookaside = g_hash_table_lookup (self->lookasides, GINT_TO_POINTER (ev->frame.pid));
|
||||
const char *src = ev->data;
|
||||
const char *dst = &ev->data[ev->src_len+1];
|
||||
|
||||
if (lookaside == NULL)
|
||||
{
|
||||
@ -173,11 +175,9 @@ sysprof_elf_symbol_resolver_load (SysprofSymbolResolver *resolver,
|
||||
g_hash_table_insert (self->lookasides, GINT_TO_POINTER (ev->frame.pid), lookaside);
|
||||
}
|
||||
|
||||
/* Someday we might need to support more layers, but currently
|
||||
* only the base layer (0) is used.
|
||||
*/
|
||||
if (ev->layer == 0)
|
||||
sysprof_map_lookaside_set_root (lookaside, ev->path);
|
||||
/* FIXME: use dst to map to things other than / */
|
||||
if (ev->dst_len == 1 && *dst == '/')
|
||||
sysprof_map_lookaside_set_root (lookaside, src);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -259,12 +259,9 @@ sysprof_proc_source_populate_pid_podman (SysprofProcSource *self,
|
||||
info->layers[i],
|
||||
"diff",
|
||||
NULL);
|
||||
sysprof_capture_writer_add_pid_root (self->writer,
|
||||
SYSPROF_CAPTURE_CURRENT_TIME,
|
||||
-1,
|
||||
pid,
|
||||
path,
|
||||
i);
|
||||
sysprof_capture_writer_add_overlay (self->writer,
|
||||
SYSPROF_CAPTURE_CURRENT_TIME,
|
||||
-1, pid, i, path, "/");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user