Does resource consumption of a process shown using "top" also contains resource consumption of subprocess?

30 Views Asked by At

I have created a function in C which trace system calls.

This function calls the "perf" tracer.

The function is executing the command "perf trace -p pid" using "popen".

I have to measure the resource consumption of the C program using "top" linux command. However, my question is: Does the output shown by "top" also contains the resource consumption of "perf tracer"?

1

There are 1 best solutions below

0
Guy Lawrence-Downs On

Short answer is yes.

Both ps and top calculate consumption directly. You should even be able to track perf tracer's individual consumption using top. Hope this helps :)