diff options
author | Joel Fernandes <joelaf@google.com> | 2017-07-06 16:00:21 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-05-22 10:38:20 +0200 |
commit | 39746bd89b422c30cbd05bf9f9ca144075f291f1 (patch) | |
tree | fcdd46f7dd8c967facd134dfce7f7f81a8a26d20 /kernel | |
parent | 150381302389fa01425396489a21dc7c53383a5b (diff) | |
download | linux-stable-39746bd89b422c30cbd05bf9f9ca144075f291f1.tar.gz linux-stable-39746bd89b422c30cbd05bf9f9ca144075f291f1.tar.bz2 linux-stable-39746bd89b422c30cbd05bf9f9ca144075f291f1.zip |
tracing: Treat recording comm for idle task as a success
commit eaf260ac04d9b4cf9f458d5c97555bfff2da526e upstream.
Currently we stop recording comm for non-idle tasks when switching from/to idle
task since we treat that as a record failure. Fix that by treat recording of
comm for idle task as a success.
Link: http://lkml.kernel.org/r/20170706230023.17942-1-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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/trace.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 37664eb48fb7..24ea07cad8ca 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -1564,7 +1564,11 @@ static int trace_save_cmdline(struct task_struct *tsk) { unsigned pid, idx; - if (!tsk->pid || unlikely(tsk->pid > PID_MAX_DEFAULT)) + /* treat recording of idle task as a success */ + if (!tsk->pid) + return 1; + + if (unlikely(tsk->pid > PID_MAX_DEFAULT)) return 0; /* |