7. Using operf to profile fork/execs

When profiling an application that forks one or more new processes, operf will
record samples for both the parent process and forked processes. This is also true even if the
forked process performs an exec of some sort (e.g., execvp). If the
process does not perform an exec, you will see that opreport
will attribute samples for the forked process to the main application executable. On the other
hand, if the forked process does perform an exec, then opreport
will attribute samples to the executable being exec'ed.

To demonstrate this, consider the following examples.
When using operf to profile a single application (either with the --pid
option or command option), the normal opreport summary output
(i.e., invoking opreport with no options) looks something like the following:

But if you profile an application that does a fork/exec, the opreport summary output
will show samples for both the main application you profiled, as well as the exec'ed program.
An example is shown below where s-m-fork is the main application being profiled, which
in turn forks a process that does an execvp of the memcpyt program.