Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753213AbdGGB3a (ORCPT ); Thu, 6 Jul 2017 21:29:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:53084 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753165AbdGGB33 (ORCPT ); Thu, 6 Jul 2017 21:29:29 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 27E2D22B53 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Thu, 6 Jul 2017 21:29:24 -0400 From: Steven Rostedt To: Joel Fernandes Cc: LKML , Michael Sartain , kernel-team@android.com, Ingo Molnar Subject: Re: [PATCH] tracing: Fix issues recording task information Message-ID: <20170706212924.12693708@gandalf.local.home> In-Reply-To: References: <20170706001147.29213-1-joelaf@google.com> <20170706085902.0af6c9a6@gandalf.local.home> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1505 Lines: 47 On Thu, 6 Jul 2017 16:17:18 -0700 Joel Fernandes wrote: > Hi Steven, > > On Thu, Jul 6, 2017 at 5:59 AM, Steven Rostedt wrote: > [..] > >> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c > >> index b66a1c8805f3..27b981a46389 100644 > >> --- a/kernel/trace/trace.c > >> +++ b/kernel/trace/trace.c > >> @@ -1918,7 +1918,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; > > > > Make this a separate patch. This should go to stable. > > Actually I am not sure if this should be marked for stable since > before we were doing: > tracing_record_cmdline(prev); > tracing_record_cmdline(next); > in probe_sched_switch, thus even if prev was the idle task, it would > still goto record the next. Ah right. I wasn't sure when that change was made. I should have looked deeper into it. > > IMO it becomes an issue only with the new stuff where we record > cmdline for prev and next in the same call > (tracing_record_taskinfo_sched_switch). Anyway I already broke it up > into a different patch and sent it out. Let me know if anything else > needs to be done here, thanks. OK, I'll take a look at it tomorrow. Thanks, -- Steve