}
static inline int perftrace_children(
- struct pid_item item,
+ pid_t pid,
struct list new,
struct list *old,
struct timespec diff,
) {
struct pid_item *ptr;
for (ptr = new.data; LIST_POS(ptr, new, struct pid_item) < new.len; ptr++) {
- if (ptr->ppid != item.pid)
+ if (ptr->ppid != pid)
continue;
if (perftrace_pid(*ptr, old, diff, humanize_mem, json_state) < 0)
return -1;
}
static inline int perftrace_recursive(
- struct pid_item item,
+ pid_t pid,
struct list new,
struct list *old,
struct timespec diff,
int ret = 0;
if (list_maybe_grow(&found_pids, ++found_pids.len, sizeof (pid_t)) < 0)
return -1;
- *LIST_AT(found_pids, 0, pid_t) = item.pid;
+ *LIST_AT(found_pids, 0, pid_t) = pid;
do {
last_found = found;
for (
(
arg_pid->mode == '+'
&& perftrace_children(
- *item, new, old, diff, humanize_mem, json_state
+ arg_pid->pid, new, old, diff, humanize_mem, json_state
) < 0
) || (
arg_pid->mode == '*'
&& perftrace_recursive(
- *item, new, old, diff, humanize_mem, json_state
+ arg_pid->pid, new, old, diff, humanize_mem, json_state
) < 0
)
)