Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp873367pxv; Thu, 1 Jul 2021 11:12:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylUwD+LK5LNULTGmYOkmWHKpAi1rPiK4PVcX3aC/U/hTA0sx6CEWkLiB+zHOYTifHad8VI X-Received: by 2002:a05:6402:5111:: with SMTP id m17mr1502073edd.219.1625163161806; Thu, 01 Jul 2021 11:12:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625163161; cv=none; d=google.com; s=arc-20160816; b=YfHvTwb4eJoC+K6QwDXmXjKSEte+nWk9ZLhNqyeJ7g5YMZR4T/WEVTKv54HcU9SNK1 hIRQZ1hXncSbhLqaTQL5LBr52hH7NSy9E0kysKzbh6AujvI1uHm2HPAzKLXeAuVM+B8Y UCZ5wVed2YTHCPs/Nl+U1/k7uFyESCbyAkt223exun9ZxmcrRWwgWm7SuhZfiRzIS8wx LPytK+smy4WN0VVTKg4xtX5CM16dv6hfYcBIzjqwwjoArjQT8RW+Hql824k1P/dNeazB odjE1WEv1iJ4ajcQmpsfxSlXYnDDRN+lV7BB7b0QEN1Pl/FqgnCFCf9VySApNhnuRfz2 8LWg== 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=yW8+e+1413zSw8DxoaEwtFXaw3A+dHfTQb9HXsgPc+c=; b=hS639fJpY20WzeZn+MxyTmPHVAbwHLSYi+Boo22kktb6H6pj+UHgsGgMZKBrf80YA5 jG998vD2pqRv4XC1UoVIdS1IXiILZfX9LSk9xK8g7qgMmpuOC3AgwLXhJbLSWpglBow/ Svm9RC76lcsI6AAy92HLmY07qptEIozwtiKUk1bm26m2SExBb/CMm8X4NM08TjtRLm5L FuSwEBlHbVoPhPMDUeDuUkxEd3AUKeHZNzPtWpfcLwaqTLLhQHgAKc8Ud/vj5UfCYNV6 JXoVm//HcJYRG2ErejuH9Yzbn92h7Qu81P2qi3u6N3iRAMcXT2Aw35/dOF05jeVazgNh mcCg== 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 k26si422618eds.589.2021.07.01.11.12.17; Thu, 01 Jul 2021 11:12:41 -0700 (PDT) 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 S233909AbhGASKa (ORCPT + 99 others); Thu, 1 Jul 2021 14:10:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:35866 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233305AbhGASK1 (ORCPT ); Thu, 1 Jul 2021 14:10:27 -0400 Received: from oasis.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 A22E6611F1; Thu, 1 Jul 2021 18:07:56 +0000 (UTC) Date: Thu, 1 Jul 2021 14:07:54 -0400 From: Steven Rostedt To: Paul Burton Cc: Joel Fernandes , linux-kernel@vger.kernel.org, Ingo Molnar , stable@vger.kernel.org Subject: Re: [PATCH 1/2] tracing: Simplify & fix saved_tgids logic Message-ID: <20210701140754.5847a50f@oasis.local.home> In-Reply-To: References: <20210630003406.4013668-1-paulburton@google.com> X-Mailer: Claws Mail 3.17.3 (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 Thu, 1 Jul 2021 10:31:59 -0700 Paul Burton wrote: > I was tempted to just add the redundant checks anyway (pick your battles > and all) but for show() in particular it wound up making things seem > non-sensical to me ("display the value describing this non-NULL pointer > into tgid_map only if tgid_map is not NULL?"). I agree with your assessment, and will actually take your first patch, as I don't think the comment is that helpful, not to mention, we don't use '//' comments in the kernel, so that would have to be changed. But for cases like this, I usually have something like: if (WARN_ON_ONCE(!tgid_map)) return -1; Because the logic is what makes tgid_map not being NULL, but as experience has taught me, the logic can sometimes be mistaken, at least as time goes by. And things that are protected by logic, deserve a WARN*() when it doesn't go as planned. We can always add that later, if needed. -- Steve