diff options
author | Anton Blanchard <anton@samba.org> | 2009-07-16 09:44:29 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-07-18 05:21:31 -0400 |
commit | ed900c054b541254f0ce5cedaf75206e29bd614e (patch) | |
tree | c164aaefa1185744d4372d8ff5b11a86a8e1405a | |
parent | 11b5f81e1b0ea0bc84fe32f0a27054e052b2bf84 (diff) |
perf_counter: Log vfork as a fork event
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 <anton@samba.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090716104817.589309391@samba.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | kernel/fork.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 467746b3f0aa..4812d60b29f8 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -1408,14 +1408,11 @@ long do_fork(unsigned long clone_flags, | |||
1408 | if (clone_flags & CLONE_VFORK) { | 1408 | if (clone_flags & CLONE_VFORK) { |
1409 | p->vfork_done = &vfork; | 1409 | p->vfork_done = &vfork; |
1410 | init_completion(&vfork); | 1410 | init_completion(&vfork); |
1411 | } else if (!(clone_flags & CLONE_VM)) { | ||
1412 | /* | ||
1413 | * vfork will do an exec which will call | ||
1414 | * set_task_comm() | ||
1415 | */ | ||
1416 | perf_counter_fork(p); | ||
1417 | } | 1411 | } |
1418 | 1412 | ||
1413 | if (!(clone_flags & CLONE_THREAD)) | ||
1414 | perf_counter_fork(p); | ||
1415 | |||
1419 | audit_finish_fork(p); | 1416 | audit_finish_fork(p); |
1420 | tracehook_report_clone(regs, clone_flags, nr, p); | 1417 | tracehook_report_clone(regs, clone_flags, nr, p); |
1421 | 1418 | ||