Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions src/store.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,37 +356,37 @@ int log_sample(DIR *proc,
* these are used to paint the tree coherently later
* each parent has a LL of children, and a LL of siblings
*/
if (pid == 1)
continue; /* nothing to do for init atm */

/* kthreadd has ppid=0, which breaks our tree ordering */
if (ps->ppid == 0)
ps->ppid = 1;

parent = ps_first;
while ((parent->next_ps && parent->pid != ps->ppid))
parent = parent->next_ps;

if (parent->pid != ps->ppid) {
/* orphan */
ps->ppid = 1;
parent = ps_first->next_ps;
}

ps->parent = parent;

/*
* append ourselves to the list of children
* TODO: consider if prepending is OK for efficiency here.
*/
{
struct ps_struct **children = &parent->children;
while (*children)
children = &(*children)->next;
*children = ps;
if (pid != 1) {
/* nothing to do for init atm */

/* kthreadd has ppid=0, which breaks our tree ordering */
if (ps->ppid == 0)
ps->ppid = 1;

parent = ps_first;
while ((parent->next_ps && parent->pid != ps->ppid))
parent = parent->next_ps;

if (parent->pid != ps->ppid) {
/* orphan */
ps->ppid = 1;
parent = ps_first->next_ps;
}

ps->parent = parent;

/*
* append ourselves to the list of children
* TODO: consider if prepending is OK for efficiency here.
*/
{
struct ps_struct **children = &parent->children;
while (*children)
children = &(*children)->next;
*children = ps;
}
}
}

/* else -> found pid, append data in ps */

/* below here is all continuous logging parts - we get here on every
Expand Down
Loading