Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1923107lql; Wed, 13 Mar 2024 11:58:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXtWCjNXa41uDs/uBt5k8F1XEMA+5GBIYmdVL6juH3GpSS3TF+QVa+CdyyRQztShaU1RSeiJcoLtUSYMQKLUcqkoGKLwFniBj6kK43U+g== X-Google-Smtp-Source: AGHT+IHEV5Lv+4oYXjETRhlvJamu/uitny2PSD0y7ThNnStxgvZQHOOvbBmmomqrRuGmMeYMX6du X-Received: by 2002:a17:906:2b09:b0:a46:275:5c05 with SMTP id a9-20020a1709062b0900b00a4602755c05mr2712657ejg.41.1710356315750; Wed, 13 Mar 2024 11:58:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710356315; cv=pass; d=google.com; s=arc-20160816; b=WogWl8h0azOYIBsk8xedcMpfK+9sQsfF3zFScws3eRalF0/+p07m3OGSRvGl5VARUf WV3Kwlw6Qx1oAGML3vur1R43SkFtZ5jXZ28V9lwYTEr+qnZzhazG4j1CD3SCUGVCoWAA e3lyLXsc+cU7/3HMjHkBXpyrgpK2LGu245GkHyROy3SmjX/FXbT8V/XPw7u0MTDpAv6Q sHeIll+SG6MaZodOakX78b+j81856XDrXyiVFFix7EXInM0GHIE81U1X9VM/7IVwEH8P MAJonud1u7W1uvOwwGgw5zpN+PR3poLzT5g+/pXfcRsgEj5NTxpFjFpX8sYHnCUBx5GD 6rig== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=vyMKO4/h2/oWYbP6G7CLfbonr7M9nhe2sZHzEQ2jpXw=; fh=nPY7Ay+tpT9pLJA9/al1Q0QE4Y9AIA5mgBBWvDrnJhk=; b=sYT2sdPXcmP9rW6KuLAPLWs2tYNis/0TkaNzYR6NkrgJ+WnGMKvzVmhCUe0ePbdd7r M1kCh3lPC/FIfhusqULSmaly+6Gx7iReKV+onymhc85bfRBvSDGCl0XWftCNJj6XfCfs wgfJ2jfrVSHeS/iO8930f3bNceUW1tnLuKCsBHo/kEpKEW7MSydXFKYefbW+HfEzgmbQ ZZkbCw0cmK87605mVJYkqbpwFiY7P76CFf0bbaDEwQ5mJf9p1zLCWxJBfL4b68ibMdG6 v1qV/uk2wSoKyNxpP2ZoC99ETDbfjoAck1dx0Z8NESfLp4wcZc7BvnpnSiR5h59N1lwS GhiA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-102291-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102291-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id kl21-20020a170907995500b00a464a1f3cd2si1530216ejc.314.2024.03.13.11.58.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 11:58:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-102291-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-102291-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102291-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4E2E51F2DEA3 for ; Wed, 13 Mar 2024 18:47:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D0A32657CF; Wed, 13 Mar 2024 17:43:43 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D2D356440; Wed, 13 Mar 2024 17:43:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710351823; cv=none; b=tc3NGzYjA2dtHPEdjI9WEazkMujE1SXTGsTYu1/zzJn52MJPdlC7H2IhowxXCywJvgGEHlBtnSxNGIort7p/IGk5qNMXhUyr38GuX2ofHhvoLQNn8qu7W7Vmygk97EF3xHSZic+aYn/DSO4OtyWVKzxcTNlnu6kSZR+9kwJnVnI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710351823; c=relaxed/simple; bh=lEfOSkBx/BgBbYhtTXBfO/JgZ5df4DjqaraiwmcYBiU=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tSkbY++hg93qpvY0r5yIQINEkvJ8PUBB/VU450GcJYuU7JmCNamTmIIDvuwPcqFr5MyBfrJvR0XwN9MZff9n/PFEEO+N9NngA1XR28TY2bJ44uro0I6bDe2N/rAF0nhD0E6XZCdoUdwKSLxOhMRYmzWorQnPxNqXihMdO9E2Imc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D370C433C7; Wed, 13 Mar 2024 17:43:41 +0000 (UTC) Date: Wed, 13 Mar 2024 13:45:50 -0400 From: Steven Rostedt To: Nathan Chancellor Cc: LKML , Linux Trace Kernel , Masami Hiramatsu , Mathieu Desnoyers , kernel test robot , llvm@lists.linux.dev Subject: Re: [PATCH] tracing: Use strcmp() in __assign_str() WARN_ON() check Message-ID: <20240313134550.68a11319@gandalf.local.home> In-Reply-To: <20240313165903.GA3021536@dev-arch.thelio-3990X> References: <20240312113002.00031668@gandalf.local.home> <20240313165903.GA3021536@dev-arch.thelio-3990X> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 13 Mar 2024 09:59:03 -0700 Nathan Chancellor wrote: > > Reported-by: kernel test robot > > Closes: https://lore.kernel.org/oe-kbuild-all/202402292111.KIdExylU-lkp@intel.com/ > > Fixes: 433e1d88a3be ("tracing: Add warning if string in __assign_str() does not match __string()") > > Is this change destined for 6.9 or 6.10? I applied it to current > trace/core (eb1533d156d3) along with 51270d573a8d but the warning is > still present. I even tried > > __builtin_choose_expr(__is_constexpr((src)), > strcmp((src), __data_offsets.dst##_ptr_), > (src) != __data_offsets.dst##_ptr_)); > > but not even that silenced the warning. I think we will still need a > diag directive to fully silence this warning. Yes, you said that the warning is still there, but the bug it shows should not be. I believe that's because clang still evaluates the (src) != ... even when the source is a contast and it warns about it. But if src is a constant, we do not want to do the !=, we want to do the slower strcmp(). Let me test to make sure that when src is a string "like this" that it does the strcmp(). Otherwise, we may have to always do the strcmp(), which I really would like to avoid. BTW, I triggered another bug with strcmp(): https://lore.kernel.org/all/20240313093454.3909afe7@gandalf.local.home/ -- Steve