Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2942475pxb; Tue, 12 Jan 2021 02:24:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJy8sCutyt79nEfU/h/fX2uMfmWC8Egm26/vCHRdNXZzHhTfMjS/4kBdPtx0k2QEfT1GOC5Q X-Received: by 2002:aa7:c403:: with SMTP id j3mr2754123edq.217.1610447076090; Tue, 12 Jan 2021 02:24:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610447076; cv=none; d=google.com; s=arc-20160816; b=zOP++XL/Bk6v9YpAtx60BDGtzr+36gU/VOfPYYLZwG8PAW0XxVYts9xbj6V/1fH/O/ vI0hZgK79X3YgdwBB+Ow5GF51XhH/pANGAuM+I2Nickz2j1ftthJ4zPcKrIWuDLPy3il ZeNG2IbEZ5yHS83FfvNALfy3t2K9AOxEDfeBNbUfF9PVwwtOnEmCfr+VoQhGFqQljOPa lmQ2TuzMW0tTnN04QYiXqBLvZl+i0wrA4WeC/5hk7gdxhj3rJu4FMtVmmLQg6azXOHSn 8T7rRRVbqy3XfFQjmpdyC4PSe/7oJwELlq1OuS0lu4GvOeoPjfNgVW8GVPA9Ywk/3xuA I5eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=w2A1ATyBslbOUWcsdsPVk1SrWD1Jobx6nzSCEzkIUbM=; b=qFw/gipn0Adb2Am6m6p49rwoBwHAeXLdceO5AL740O+Yas6qkX6h5XL/xUkYMPA+m4 LC5sUvv4FMrrUbLZUJd4xdmPHz/ftsa2EtS6bvb+6qInIMPAREZ41iMONiI7OH5Iv3dj O6xvAqA3kV6uMCzh7FjcHePSltvJaDjiPkK+JYfCDMbyQoFIxxYk+bU5WbjqhjpvnOdm ohdmG9/Wi3vb5Nm/E3W6th2NvjZDlXVxoPkVygASDePrwzEg2AxHtl/EhVbUfI8hku8T /P5aPstHNhVFeiQ9zbPXYSs70qIGMkUzrMJn2aT3au/OsdqtPguTfAmzy0cHg5LNGgjH qD0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o22si1208911edr.69.2021.01.12.02.24.12; Tue, 12 Jan 2021 02:24:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391633AbhALAZM (ORCPT + 99 others); Mon, 11 Jan 2021 19:25:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:37198 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404209AbhAKXwL (ORCPT ); Mon, 11 Jan 2021 18:52:11 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C583522BED; Mon, 11 Jan 2021 23:51:30 +0000 (UTC) Date: Mon, 11 Jan 2021 18:51:29 -0500 From: Steven Rostedt To: Qiujun Huang Cc: mingo@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] trace: Remove get/put_cpu() from function_trace_init Message-ID: <20210111185129.0d5745f9@gandalf.local.home> In-Reply-To: <20201230140521.31920-1-hqjagain@gmail.com> References: <20201230140521.31920-1-hqjagain@gmail.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 30 Dec 2020 22:05:21 +0800 Qiujun Huang wrote: > Since commit b6f11df26fdc ("trace: Call tracing_reset_online_cpus before > tracer->init()"), get/put_cpu() are not needed anymore. > We can use raw_smp_processor_id() instead. I added both your patches (this one and the trace_ignore_this_task() kernel-doc fix to my queue. Thanks! -- Steve > > Signed-off-by: Qiujun Huang > --- > v2: > Use raw_smp_processor_id() instead of smp_processor_id() > --- > kernel/trace/trace_functions.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c > index c5095dd28e20..f67aec5bb771 100644 > --- a/kernel/trace/trace_functions.c > +++ b/kernel/trace/trace_functions.c > @@ -106,8 +106,7 @@ static int function_trace_init(struct trace_array *tr) > > ftrace_init_array_ops(tr, func); > > - tr->array_buffer.cpu = get_cpu(); > - put_cpu(); > + tr->array_buffer.cpu = raw_smp_processor_id(); > > tracing_start_cmdline_record(); > tracing_start_function_trace(tr);