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:
change the harness binary to spawn a "perf record" child process which run the benchmarks and do the sampling
just do "perf record $harness-binary" hoping it will sample the child process too.
"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