libsysprof-analyze: record exit time of processes

This will allow us to treat them as a duration in a chart.
This commit is contained in:
Christian Hergert
2023-07-06 14:52:02 -07:00
parent 65a567f0d1
commit 2b29ce8e73
2 changed files with 8 additions and 0 deletions

View File

@ -1069,6 +1069,13 @@ sysprof_document_load_worker (GTask *task,
} }
} }
} }
else if (tainted->type == SYSPROF_CAPTURE_FRAME_EXIT)
{
SysprofProcessInfo *info = g_hash_table_lookup (self->pid_to_process_info, GINT_TO_POINTER (pid));
if (info != NULL)
info->exit_time = t;
}
else if (tainted->type == SYSPROF_CAPTURE_FRAME_MARK) else if (tainted->type == SYSPROF_CAPTURE_FRAME_MARK)
{ {
const SysprofCaptureMark *mark = (const SysprofCaptureMark *)tainted; const SysprofCaptureMark *mark = (const SysprofCaptureMark *)tainted;

View File

@ -34,6 +34,7 @@ typedef struct _SysprofProcessInfo
SysprofSymbol *fallback_symbol; SysprofSymbol *fallback_symbol;
SysprofSymbol *symbol; SysprofSymbol *symbol;
int pid; int pid;
gint64 exit_time;
} SysprofProcessInfo; } SysprofProcessInfo;
SysprofProcessInfo *sysprof_process_info_new (SysprofMountNamespace *mount_namespace, SysprofProcessInfo *sysprof_process_info_new (SysprofMountNamespace *mount_namespace,