From nobody Fri Dec 19 20:34:14 2025 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 DCCEF1361D2; Wed, 13 Mar 2024 16:42:33 +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=1710348154; cv=none; b=s2aEcTPbpor4QbUjmxPK3sK9Bsfav9Brl7gzu9xfw2+D42HzcMuuZ03fIjWDxHL7TBWtd3Aisd6mLyqq3SpNJnaJ3GrwAHOUeJTraj2chC3pGSCM+PPB6njdMumcd8FuR5alqqYo0+wipDG0mz07QtYI3V+QbTWRsKvFN33tmTM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348154; c=relaxed/simple; bh=4zVB3pbegpCJmWix2xtZJr4g8LMPicBl373W8BWcsAs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=miWkDHIgcDXrW6m+begq57wKMM8mbrOwxt/a+raDJNs4T+gxjF/ulMqSBEX+CEQBt1LIbcIQszuIdvora7qBn07wBrLn5sIx3enGp8iMaYFhhhYJ7F/kZwCFgY543wB5kgV9xzI/KIWkO6y1BkZShd+7fsVVRWIv4FhjtJuCjj8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AEf6eXMH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AEf6eXMH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7040C3279A; Wed, 13 Mar 2024 16:42:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348153; bh=4zVB3pbegpCJmWix2xtZJr4g8LMPicBl373W8BWcsAs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AEf6eXMHfLtekMV0zMHOfRLKVMA8HpINahDN2uJAv/N8VVA3keXs7r5PqT8p3Am4n 41SQ3rl4fo8t70TA172HA2PfUhYbRxIFTu8YpNGw0tHphv8PoPBoDONP7CCIaxval4 0dS3u4TH8hjhqNBEahhDMcf4BD3Ibc7xrmeBXe6YVB8bOTLjw8yfyh3ngWfCVB2dcV /tKuf2+Y46w6p+kLqvVzUq4KHlxx34T+BjHRSAzvh0wiw9qOe+osGkn79L030hyR5B DxuJfaTeEUVHsBtIooqMnTFQbPmeVv2Z+hrnQTUUvvn6AnuRH8C3C/YuQflyAhFw8k Ue/6STCGFBpaQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Steven Rostedt (Google)" , Jamal Hadi Salim , "David S . Miller" , Sasha Levin Subject: [PATCH 5.15 06/76] tracing/net_sched: Fix tracepoints that save qdisc_dev() as a string Date: Wed, 13 Mar 2024 12:41:13 -0400 Message-ID: <20240313164223.615640-7-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313164223.615640-1-sashal@kernel.org> References: <20240313164223.615640-1-sashal@kernel.org> 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="utf-8" X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.152-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.15.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.15.152-rc1 X-KernelTest-Deadline: 2024-03-15T16:42+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: quoted-printable From: "Steven Rostedt (Google)" [ Upstream commit 51270d573a8d9dd5afdc7934de97d66c0e14b5fd ] I'm updating __assign_str() and will be removing the second parameter. To make sure that it does not break anything, I make sure that it matches the __string() field, as that is where the string is actually going to be saved in. To make sure there's nothing that breaks, I added a WARN_ON() to make sure that what was used in __string() is the same that is used in __assign_str(). In doing this change, an error was triggered as __assign_str() now expects the string passed in to be a char * value. I instead had the following warning: include/trace/events/qdisc.h: In function =E2=80=98trace_event_raw_event_qd= isc_reset=E2=80=99: include/trace/events/qdisc.h:91:35: error: passing argument 1 of 'strcmp' f= rom incompatible pointer type [-Werror=3Dincompatible-pointer-types] 91 | __assign_str(dev, qdisc_dev(q)); That's because the qdisc_enqueue() and qdisc_reset() pass in qdisc_dev(q) to __assign_str() and to __string(). But that function returns a pointer to struct net_device and not a string. It appears that these events are just saving the pointer as a string and then reading it as a string as well. Use qdisc_dev(q)->name to save the device instead. Fixes: a34dac0b90552 ("net_sched: add tracepoints for qdisc_reset() and qdi= sc_destroy()") Signed-off-by: Steven Rostedt (Google) Reviewed-by: Jamal Hadi Salim Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- include/trace/events/qdisc.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/trace/events/qdisc.h b/include/trace/events/qdisc.h index 59c945b66f9c7..5180da19d837f 100644 --- a/include/trace/events/qdisc.h +++ b/include/trace/events/qdisc.h @@ -81,14 +81,14 @@ TRACE_EVENT(qdisc_reset, TP_ARGS(q), =20 TP_STRUCT__entry( - __string( dev, qdisc_dev(q) ) - __string( kind, q->ops->id ) - __field( u32, parent ) - __field( u32, handle ) + __string( dev, qdisc_dev(q)->name ) + __string( kind, q->ops->id ) + __field( u32, parent ) + __field( u32, handle ) ), =20 TP_fast_assign( - __assign_str(dev, qdisc_dev(q)); + __assign_str(dev, qdisc_dev(q)->name); __assign_str(kind, q->ops->id); __entry->parent =3D q->parent; __entry->handle =3D q->handle; @@ -106,14 +106,14 @@ TRACE_EVENT(qdisc_destroy, TP_ARGS(q), =20 TP_STRUCT__entry( - __string( dev, qdisc_dev(q) ) - __string( kind, q->ops->id ) - __field( u32, parent ) - __field( u32, handle ) + __string( dev, qdisc_dev(q)->name ) + __string( kind, q->ops->id ) + __field( u32, parent ) + __field( u32, handle ) ), =20 TP_fast_assign( - __assign_str(dev, qdisc_dev(q)); + __assign_str(dev, qdisc_dev(q)->name); __assign_str(kind, q->ops->id); __entry->parent =3D q->parent; __entry->handle =3D q->handle; --=20 2.43.0