elf: fix pid usage

We want the pid from the event.
This commit is contained in:
Christian Hergert
2021-09-21 15:35:37 -07:00
parent 11ae2fa395
commit bf8a851a57

View File

@ -187,12 +187,12 @@ sysprof_elf_symbol_resolver_load (SysprofSymbolResolver *resolver,
if (type == SYSPROF_CAPTURE_FRAME_FILE_CHUNK)
{
const SysprofCaptureFileChunk *ev;
int pid;
int out_pid;
if (!(ev = sysprof_capture_reader_read_file (reader)))
break;
pi = sysprof_elf_symbol_resolver_get_process (self, pid);
pi = sysprof_elf_symbol_resolver_get_process (self, ev->frame.pid);
if (strcmp (ev->path, "/.flatpak-info") == 0)
{
@ -208,7 +208,7 @@ sysprof_elf_symbol_resolver_load (SysprofSymbolResolver *resolver,
}
else if (g_str_has_prefix (ev->path, "/proc/") &&
g_str_has_suffix (ev->path, "/mountinfo") &&
sscanf (ev->path, "/proc/%u/mountinfo", &pid) == 1)
sscanf (ev->path, "/proc/%u/mountinfo", &out_pid) == 1)
{
if (pi->mountinfo_data == NULL)
pi->mountinfo_data = g_byte_array_new ();