mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
Ignore fork events that are just new threads being spawned.
These would cause mysterious new processes to show up.
This commit is contained in:
13
tracker.c
13
tracker.c
@ -493,6 +493,12 @@ process_fork (state_t *state, fork_t *fork)
|
||||
process_t *parent = g_hash_table_lookup (
|
||||
state->processes_by_pid, GINT_TO_POINTER (GET_PID (fork->header)));
|
||||
|
||||
if (GET_PID (fork->header) == fork->child_pid)
|
||||
{
|
||||
/* Just a new thread being spawned */
|
||||
return;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (parent)
|
||||
#endif
|
||||
@ -505,7 +511,12 @@ process_fork (state_t *state, fork_t *fork)
|
||||
#endif
|
||||
|
||||
process->pid = fork->child_pid;
|
||||
process->comm = g_strdup (parent? parent->comm : "<unknown>");
|
||||
|
||||
if (parent)
|
||||
process->comm = g_strdup (parent->comm);
|
||||
else
|
||||
process->comm = g_strdup_printf ("<pid %d>", fork->child_pid);
|
||||
|
||||
process->maps = g_ptr_array_new ();
|
||||
|
||||
if (parent)
|
||||
|
||||
Reference in New Issue
Block a user