diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-28 15:21:10 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-28 15:21:10 -0500 |
commit | b0f4b285d7ed174804658539129a834270f4829a (patch) | |
tree | be7f8dca58075aba2c6a137fcfd4d44c5c333efc /kernel/fork.c | |
parent | be9c5ae4eeec2e85527e95647348b8ea4eb25128 (diff) | |
parent | 5250d329e38cdf7580faeb9c53c17d3588d7d19c (diff) |
Merge branch 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (241 commits)
sched, trace: update trace_sched_wakeup()
tracing/ftrace: don't trace on early stage of a secondary cpu boot, v3
Revert "x86: disable X86_PTRACE_BTS"
ring-buffer: prevent false positive warning
ring-buffer: fix dangling commit race
ftrace: enable format arguments checking
x86, bts: memory accounting
x86, bts: add fork and exit handling
ftrace: introduce tracing_reset_online_cpus() helper
tracing: fix warnings in kernel/trace/trace_sched_switch.c
tracing: fix warning in kernel/trace/trace.c
tracing/ring-buffer: remove unused ring_buffer size
trace: fix task state printout
ftrace: add not to regex on filtering functions
trace: better use of stack_trace_enabled for boot up code
trace: add a way to enable or disable the stack tracer
x86: entry_64 - introduce FTRACE_ frame macro v2
tracing/ftrace: add the printk-msg-only option
tracing/ftrace: use preempt_enable_no_resched_notrace in ring_buffer_time_stamp()
x86, bts: correctly report invalid bts records
...
Fixed up trivial conflict in scripts/recordmcount.pl due to SH bits
being already partly merged by the SH merge.
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 4e8ca23c0ede..6144b36cd897 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); |
@@ -1080,6 +1084,8 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1080 | #ifdef CONFIG_DEBUG_MUTEXES | 1084 | #ifdef CONFIG_DEBUG_MUTEXES |
1081 | p->blocked_on = NULL; /* not blocked yet */ | 1085 | p->blocked_on = NULL; /* not blocked yet */ |
1082 | #endif | 1086 | #endif |
1087 | if (unlikely(ptrace_reparented(current))) | ||
1088 | ptrace_fork(p, clone_flags); | ||
1083 | 1089 | ||
1084 | /* Perform scheduler related setup. Assign this task to a CPU. */ | 1090 | /* Perform scheduler related setup. Assign this task to a CPU. */ |
1085 | sched_fork(p, clone_flags); | 1091 | sched_fork(p, clone_flags); |
@@ -1120,6 +1126,8 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1120 | } | 1126 | } |
1121 | } | 1127 | } |
1122 | 1128 | ||
1129 | ftrace_graph_init_task(p); | ||
1130 | |||
1123 | p->pid = pid_nr(pid); | 1131 | p->pid = pid_nr(pid); |
1124 | p->tgid = p->pid; | 1132 | p->tgid = p->pid; |
1125 | if (clone_flags & CLONE_THREAD) | 1133 | if (clone_flags & CLONE_THREAD) |
@@ -1128,7 +1136,7 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1128 | if (current->nsproxy != p->nsproxy) { | 1136 | if (current->nsproxy != p->nsproxy) { |
1129 | retval = ns_cgroup_clone(p, pid); | 1137 | retval = ns_cgroup_clone(p, pid); |
1130 | if (retval) | 1138 | if (retval) |
1131 | goto bad_fork_free_pid; | 1139 | goto bad_fork_free_graph; |
1132 | } | 1140 | } |
1133 | 1141 | ||
1134 | p->set_child_tid = (clone_flags & CLONE_CHILD_SETTID) ? child_tidptr : NULL; | 1142 | p->set_child_tid = (clone_flags & CLONE_CHILD_SETTID) ? child_tidptr : NULL; |
@@ -1221,7 +1229,7 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1221 | spin_unlock(¤t->sighand->siglock); | 1229 | spin_unlock(¤t->sighand->siglock); |
1222 | write_unlock_irq(&tasklist_lock); | 1230 | write_unlock_irq(&tasklist_lock); |
1223 | retval = -ERESTARTNOINTR; | 1231 | retval = -ERESTARTNOINTR; |
1224 | goto bad_fork_free_pid; | 1232 | goto bad_fork_free_graph; |
1225 | } | 1233 | } |
1226 | 1234 | ||
1227 | if (clone_flags & CLONE_THREAD) { | 1235 | if (clone_flags & CLONE_THREAD) { |
@@ -1258,6 +1266,8 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1258 | cgroup_post_fork(p); | 1266 | cgroup_post_fork(p); |
1259 | return p; | 1267 | return p; |
1260 | 1268 | ||
1269 | bad_fork_free_graph: | ||
1270 | ftrace_graph_exit_task(p); | ||
1261 | bad_fork_free_pid: | 1271 | bad_fork_free_pid: |
1262 | if (pid != &init_struct_pid) | 1272 | if (pid != &init_struct_pid) |
1263 | free_pid(pid); | 1273 | free_pid(pid); |