diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2009-03-23 23:03:01 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-24 11:42:49 -0400 |
commit | cc59c9e8d0165c632fd056c4a23e36f917507fb4 (patch) | |
tree | 8ca2b92345345d53ce3b5585cf87d72afddda43c | |
parent | be6f164a02f394675e2ac2077dd354cebef5b4c0 (diff) |
ftrace: show virtual PID
Impact: fix PID output under namespaces
When current namespace is not the global namespace,
pid read from set_ftrace_pid is no correct.
# ~/newpid_namespace_run bash
# echo $$
1
# echo 1 > set_ftrace_pid
# cat set_ftrace_pid
3756
Since we write virtual PID to set_ftrace_pid, we need get
virtual PID when we read it.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Steven Rostedt <srostedt@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <49C84D65.9050606@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | kernel/trace/ftrace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 02d2de9d08ba..bb377112b1bb 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -2264,7 +2264,7 @@ ftrace_pid_read(struct file *file, char __user *ubuf, | |||
2264 | if (ftrace_pid_trace == ftrace_swapper_pid) | 2264 | if (ftrace_pid_trace == ftrace_swapper_pid) |
2265 | r = sprintf(buf, "swapper tasks\n"); | 2265 | r = sprintf(buf, "swapper tasks\n"); |
2266 | else if (ftrace_pid_trace) | 2266 | else if (ftrace_pid_trace) |
2267 | r = sprintf(buf, "%u\n", pid_nr(ftrace_pid_trace)); | 2267 | r = sprintf(buf, "%u\n", pid_vnr(ftrace_pid_trace)); |
2268 | else | 2268 | else |
2269 | r = sprintf(buf, "no pid\n"); | 2269 | r = sprintf(buf, "no pid\n"); |
2270 | 2270 | ||