summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorJoel Fernandes <joelaf@google.com>2017-07-07 01:00:22 +0200
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2017-07-07 15:04:23 +0200
commitbd45d34d25720a820021c8ea45de5cd607eace64 (patch)
tree8a35793343ba6b641944622a17728bf44b0a1c4c /kernel
parenttracing: Treat recording comm for idle task as a success (diff)
downloadlinux-bd45d34d25720a820021c8ea45de5cd607eace64.tar.xz
linux-bd45d34d25720a820021c8ea45de5cd607eace64.zip
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: Michael Sartain <mikesart@gmail.com> Signed-off-by: Joel Fernandes <joelaf@google.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 6722d86f2af5..aee11e3a394f 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2006,7 +2006,11 @@ int trace_find_tgid(int pid)
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;
tgid_map[tsk->pid] = tsk->tgid;