can "perf record" or "perf-record" sample child processes?

Viewed 5041

Assume I have a harness binary which could spawn different benchmarks according to command line option. I am really interested in sampling these benchmarks.

I have 3 options:

  1. change the harness binary to spawn a "perf record" child process which run the benchmarks and do the sampling

  2. just do "perf record $harness-binary" hoping it will sample the child process too.

  3. "perf record -a $harness-binary" which would do a "System-wide collection from all CPUs.". This requires root access, therefore not feasible in my case.

Approach #2 is clean if perf-record really samples the child process. Can somebody help to confirm if this is the case? Pointers to documents or perf code would be highly appreciated.

If approach #2 is feasible and the benchmarks is much more CPU-intensive than the harness, I think the quality of the benchmark sampling should be reasonably good, right?

Thanks

1 Answers
Related