Commit bd45d34d authored by Joel Fernandes's avatar Joel Fernandes Committed by Steven Rostedt (VMware)

tracing: Treat recording tgid for idle task as a success

Currently we stop recording tgid for non-idle tasks when switching from/to idle
task since we treat that as a record failure. Fix that by treat recording of
tgid for idle task as a success.

Link: http://lkml.kernel.org/r/20170706230023.17942-2-joelaf@google.com

Cc: kernel-team@android.com
Cc: Ingo Molnar <mingo@redhat.com>
Reported-by: default avatarMichael Sartain <mikesart@gmail.com>
Signed-off-by: default avatarJoel Fernandes <joelaf@google.com>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent eaf260ac
...@@ -2006,7 +2006,11 @@ int trace_find_tgid(int pid) ...@@ -2006,7 +2006,11 @@ int trace_find_tgid(int pid)
static int trace_save_tgid(struct task_struct *tsk) static int trace_save_tgid(struct task_struct *tsk)
{ {
if (unlikely(!tgid_map || !tsk->pid || tsk->pid > PID_MAX_DEFAULT)) /* treat recording of idle task as a success */
if (!tsk->pid)
return 1;
if (unlikely(!tgid_map || tsk->pid > PID_MAX_DEFAULT))
return 0; return 0;
tgid_map[tsk->pid] = tsk->tgid; tgid_map[tsk->pid] = tsk->tgid;
......
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