perf_counter: Add a comm hook for pure fork()s
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Wed, 3 Jun 2009 09:23:56 +0000 (11:23 +0200)
committerIngo Molnar <mingo@elte.hu>
Wed, 3 Jun 2009 12:14:30 +0000 (14:14 +0200)
I noticed missing COMM events and found that we missed
reporting them for pure forks.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Kacur <jkacur@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/fork.c

index 23bf757ed3211c95dcecee505e5cd0c3825e6416..b7d7a9f0bd7ad243cac307fa33a5cc5b40bcefeb 100644 (file)
@@ -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);