From: Peter Zijlstra Date: Wed, 3 Jun 2009 09:23:56 +0000 (+0200) Subject: perf_counter: Add a comm hook for pure fork()s X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=226f62fdd53d5b2c74e242aa11f6ad43d0285d3f;p=linux-beck.git perf_counter: Add a comm hook for pure fork()s I noticed missing COMM events and found that we missed reporting them for pure forks. Signed-off-by: Peter Zijlstra Cc: Mike Galbraith Cc: Paul Mackerras Cc: Corey Ashford Cc: Marcelo Tosatti Cc: Arnaldo Carvalho de Melo Cc: Thomas Gleixner Cc: John Kacur LKML-Reference: Signed-off-by: Ingo Molnar --- diff --git a/kernel/fork.c b/kernel/fork.c index 23bf757ed321..b7d7a9f0bd7a 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1412,6 +1412,12 @@ long do_fork(unsigned long clone_flags, if (clone_flags & CLONE_VFORK) { p->vfork_done = &vfork; init_completion(&vfork); + } else { + /* + * vfork will do an exec which will call + * set_task_comm() + */ + perf_counter_comm(p); } audit_finish_fork(p);