Commit cc59c9e8 authored by Lai Jiangshan's avatar Lai Jiangshan Committed by Ingo Molnar
Browse files

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 $$
 # echo 1 > set_ftrace_pid
 # cat set_ftrace_pid

Since we write virtual PID to set_ftrace_pid, we need get
virtual PID when we read it.
Signed-off-by: default avatarLai Jiangshan <>
Cc: Steven Rostedt <>
Cc: Frederic Weisbecker <>
LKML-Reference: <>
Signed-off-by: default avatarIngo Molnar <>
parent be6f164a
......@@ -2264,7 +2264,7 @@ ftrace_pid_read(struct file *file, char __user *ubuf,
if (ftrace_pid_trace == ftrace_swapper_pid)
r = sprintf(buf, "swapper tasks\n");
else if (ftrace_pid_trace)
r = sprintf(buf, "%u\n", pid_nr(ftrace_pid_trace));
r = sprintf(buf, "%u\n", pid_vnr(ftrace_pid_trace));
r = sprintf(buf, "no pid\n");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment