From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751712AbbIFJPG (ORCPT ); Sun, 6 Sep 2015 05:15:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56168 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750897AbbIFJOz (ORCPT ); Sun, 6 Sep 2015 05:14:55 -0400 Date: Sun, 6 Sep 2015 17:20:16 +0800 From: Minfei Huang To: Sasha Levin Cc: rostedt@goodmis.org, mingo@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ftrace: allow dumping traces without tracking trace started cpus Message-ID: <20150906092016.GA20381@dhcp-128-25.nay.redhat.com> References: <1441385156-27279-1-git-send-email-sasha.levin@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1441385156-27279-1-git-send-email-sasha.levin@oracle.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/04/15 at 12:45pm, Sasha Levin wrote: > We don't init iter->started when dumping the ftrace buffer, and there's no > real need to do so - so allow skipping that check if the iter doesn't have > an initialized ->started cpumask. > > Signed-off-by: Sasha Levin > --- > kernel/trace/trace.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c > index 6e79408..0dc647f 100644 > --- a/kernel/trace/trace.c > +++ b/kernel/trace/trace.c > @@ -2671,13 +2671,14 @@ static void test_cpu_buff_start(struct trace_iterator *iter) > if (!(iter->iter_flags & TRACE_FILE_ANNOTATE)) > return; > > - if (cpumask_test_cpu(iter->cpu, iter->started)) > + if (iter->started && cpumask_test_cpu(iter->cpu, iter->started)) > return; Ftrace will initialize the variable iter->started in the function trace_init_global_iter. Otherwise kernel will panic during calling the function cpumask_test_cpu. So it is safe to call the function cpumask_test_cpu without doing checking. Thanks Minfei