From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5428FC433E6 for ; Fri, 22 Jan 2021 22:13:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1C03F23B1B for ; Fri, 22 Jan 2021 22:13:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730975AbhAVWNM (ORCPT ); Fri, 22 Jan 2021 17:13:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:35856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729227AbhAVWMy (ORCPT ); Fri, 22 Jan 2021 17:12:54 -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 52C3623B09; Fri, 22 Jan 2021 22:12:13 +0000 (UTC) Date: Fri, 22 Jan 2021 17:12:11 -0500 From: Steven Rostedt To: Sebastian Andrzej Siewior Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Thomas Gleixner Subject: Re: [PATCH 3/3] tracing: Remove NULL check from current in tracing_generic_entry_update(). Message-ID: <20210122171211.3d1de176@gandalf.local.home> In-Reply-To: <20210112230057.2374308-4-bigeasy@linutronix.de> References: <20210112230057.2374308-1-bigeasy@linutronix.de> <20210112230057.2374308-4-bigeasy@linutronix.de> 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, 13 Jan 2021 00:00:57 +0100 Sebastian Andrzej Siewior wrote: > I can't imagine when or why `current' would return a NULL pointer. This > check was added in commit > 72829bc3d63cd ("ftrace: move enums to ftrace.h and make helper function global") > > but it doesn't give me hint why it was needed. > > Assume `current' never returns a NULL pointer and remove the check. I'm guessing this is unrelated to the patch series, and I can take this now separately. -- Steve > > Signed-off-by: Sebastian Andrzej Siewior > --- > include/linux/trace_events.h | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h > index aa9123878e126..252dfcabda3c1 100644 > --- a/include/linux/trace_events.h > +++ b/include/linux/trace_events.h > @@ -152,10 +152,8 @@ static inline void tracing_generic_entry_update(struct trace_entry *entry, > unsigned short type, > unsigned int trace_ctx) > { > - struct task_struct *tsk = current; > - > entry->preempt_count = trace_ctx & 0xff; > - entry->pid = (tsk) ? tsk->pid : 0; > + entry->pid = current->pid; > entry->type = type; > entry->flags = trace_ctx >> 16; > }