According to man pages to consider the execution of child process when counting for events, inherit
bit can be set. inherit
can not be used when using PERF_FORMAT_GROUP. So, how can I include the execution of child process (execution of shell commands with in C source code, for example) so that it can be counted when sampling (PERF_FORMAT_GROUP) using perf_event_open
if PERF_FORMAT_GROUP is not specified, does this indicate that for each recorded sample, each sample record will include struct read_format
equal to the number of events or a sample will be recorded for each event alone.
If you need to use PERF_FORMAT_GROUP
, and that doesn't work with the built-in inherit
, then you have to keep track of the children yourself. You can do that by using ptrace
and then setup perf_event_open
for all child tasks. Then you also have to merge the samples from all event file descriptors.
Edit:
Without PERF_FORMAT_GROUP
, the internal sampling recording is not at the same time. You could of course just setup counting events (instead of a sampling events), and read them at the same time in regular intervals from userspace.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With