Skip to content

Commit

Permalink
perf_counter: Log vfork as a fork event
Browse files Browse the repository at this point in the history
Right now we don't output vfork events. Even though we should
always see an exec after a vfork, we may get perfcounter
samples between the vfork and exec. These samples can lead to
some confusion when parsing perfcounter data.

To keep things consistent we should always log a fork event. It
will result in a little more log data, but is less confusing to
trace parsing tools.

Signed-off-by: Anton Blanchard <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
antonblanchard authored and Ingo Molnar committed Jul 18, 2009
1 parent 11b5f81 commit ed900c0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -1408,14 +1408,11 @@ long do_fork(unsigned long clone_flags,
if (clone_flags & CLONE_VFORK) {
p->vfork_done = &vfork;
init_completion(&vfork);
} else if (!(clone_flags & CLONE_VM)) {
/*
* vfork will do an exec which will call
* set_task_comm()
*/
perf_counter_fork(p);
}

if (!(clone_flags & CLONE_THREAD))
perf_counter_fork(p);

audit_finish_fork(p);
tracehook_report_clone(regs, clone_flags, nr, p);

Expand Down

0 comments on commit ed900c0

Please sign in to comment.