diff options
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 495da2e9a8b4..7b93da72d4a2 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <linux/mount.h> | 47 | #include <linux/mount.h> |
48 | #include <linux/audit.h> | 48 | #include <linux/audit.h> |
49 | #include <linux/memcontrol.h> | 49 | #include <linux/memcontrol.h> |
50 | #include <linux/ftrace.h> | ||
50 | #include <linux/profile.h> | 51 | #include <linux/profile.h> |
51 | #include <linux/rmap.h> | 52 | #include <linux/rmap.h> |
52 | #include <linux/acct.h> | 53 | #include <linux/acct.h> |
@@ -80,6 +81,8 @@ DEFINE_PER_CPU(unsigned long, process_counts) = 0; | |||
80 | 81 | ||
81 | __cacheline_aligned DEFINE_RWLOCK(tasklist_lock); /* outer */ | 82 | __cacheline_aligned DEFINE_RWLOCK(tasklist_lock); /* outer */ |
82 | 83 | ||
84 | DEFINE_TRACE(sched_process_fork); | ||
85 | |||
83 | int nr_processes(void) | 86 | int nr_processes(void) |
84 | { | 87 | { |
85 | int cpu; | 88 | int cpu; |
@@ -137,6 +140,7 @@ void free_task(struct task_struct *tsk) | |||
137 | prop_local_destroy_single(&tsk->dirties); | 140 | prop_local_destroy_single(&tsk->dirties); |
138 | free_thread_info(tsk->stack); | 141 | free_thread_info(tsk->stack); |
139 | rt_mutex_debug_task_free(tsk); | 142 | rt_mutex_debug_task_free(tsk); |
143 | ftrace_graph_exit_task(tsk); | ||
140 | free_task_struct(tsk); | 144 | free_task_struct(tsk); |
141 | } | 145 | } |
142 | EXPORT_SYMBOL(free_task); | 146 | EXPORT_SYMBOL(free_task); |
@@ -1136,6 +1140,8 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1136 | } | 1140 | } |
1137 | } | 1141 | } |
1138 | 1142 | ||
1143 | ftrace_graph_init_task(p); | ||
1144 | |||
1139 | p->pid = pid_nr(pid); | 1145 | p->pid = pid_nr(pid); |
1140 | p->tgid = p->pid; | 1146 | p->tgid = p->pid; |
1141 | if (clone_flags & CLONE_THREAD) | 1147 | if (clone_flags & CLONE_THREAD) |
@@ -1144,7 +1150,7 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1144 | if (current->nsproxy != p->nsproxy) { | 1150 | if (current->nsproxy != p->nsproxy) { |
1145 | retval = ns_cgroup_clone(p, pid); | 1151 | retval = ns_cgroup_clone(p, pid); |
1146 | if (retval) | 1152 | if (retval) |
1147 | goto bad_fork_free_pid; | 1153 | goto bad_fork_free_graph; |
1148 | } | 1154 | } |
1149 | 1155 | ||
1150 | p->set_child_tid = (clone_flags & CLONE_CHILD_SETTID) ? child_tidptr : NULL; | 1156 | p->set_child_tid = (clone_flags & CLONE_CHILD_SETTID) ? child_tidptr : NULL; |
@@ -1237,7 +1243,7 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1237 | spin_unlock(¤t->sighand->siglock); | 1243 | spin_unlock(¤t->sighand->siglock); |
1238 | write_unlock_irq(&tasklist_lock); | 1244 | write_unlock_irq(&tasklist_lock); |
1239 | retval = -ERESTARTNOINTR; | 1245 | retval = -ERESTARTNOINTR; |
1240 | goto bad_fork_free_pid; | 1246 | goto bad_fork_free_graph; |
1241 | } | 1247 | } |
1242 | 1248 | ||
1243 | if (clone_flags & CLONE_THREAD) { | 1249 | if (clone_flags & CLONE_THREAD) { |
@@ -1274,6 +1280,8 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1274 | cgroup_post_fork(p); | 1280 | cgroup_post_fork(p); |
1275 | return p; | 1281 | return p; |
1276 | 1282 | ||
1283 | bad_fork_free_graph: | ||
1284 | ftrace_graph_exit_task(p); | ||
1277 | bad_fork_free_pid: | 1285 | bad_fork_free_pid: |
1278 | if (pid != &init_struct_pid) | 1286 | if (pid != &init_struct_pid) |
1279 | free_pid(pid); | 1287 | free_pid(pid); |