Skip to contentSkip to conversation

perf_counter: Add a comm hook for pure fork()s

tip:perfcounters/core tip-bot for Peter Zijlstra 1 participant 1 message Jun 3, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw
Commit-ID:  226f62fdd53d5b2c74e242aa11f6ad43d0285d3f
Gitweb:     http://git.kernel.org/tip/226f62fdd53d5b2c74e242aa11f6ad43d0285d3f
Author:     Peter Zijlstra <[email protected]>
AuthorDate: Wed, 3 Jun 2009 11:23:56 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 3 Jun 2009 14:14:30 +0200

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.

Cc Mike Galbraith <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Corey Ashford <[email protected]>
Cc Marcelo Tosatti <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc John Kacur <[email protected]>

LKML-Reference: <new-submission>

---
 kernel/fork.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
kernel/fork.c +6 -0
index 23bf757..b7d7a9f 100644
@@ -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);