From nobody Mon Feb 9 13:03:02 2026 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 633E012F39B for ; Mon, 26 Feb 2024 18:47:51 +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=1708973271; cv=none; b=O7ClPWzF7xl1wMDeLDZrNCkZHqgFr346q8YF0Fh+EURdwxVHbVcntjFI54rQNKmsyRa6fujnAYRXvEp6Y9z0EpSSp/E6yfgljumgNpmPOBPVDqqa765c9aq2RF4fUBNgSbP8Mdxzj7pbf1uNSPFP6El/5kQ5dh/gc5s8Artdgws= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708973271; c=relaxed/simple; bh=8Nw3++8KqkLBDEGgcPa6Hj7GfV5L5E4uJvDO01jI9ng=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=AqKaBSyut2TQCNl4W7JxrHVzqlnKVX6DhrximeXTo0hN7tXJXiOW1Tu1C64RjpOMj+TbrRoMb2oZvqP9y6JAtCoVQ4aV35nMPbNs6jogcLFuAcG5t8xhURJc6qrI38Rb9N2q1RBL8otAnC8vqNEincAoNVtlTjvFIYIKeTr1Lvk= 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 035BCC43601; Mon, 26 Feb 2024 18:47:51 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1reg2x-000000090av-1qPA; Mon, 26 Feb 2024 13:49:51 -0500 Message-ID: <20240226184951.297987021@goodmis.org> User-Agent: quilt/0.67 Date: Mon, 26 Feb 2024 13:49:36 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton Subject: [for-next][PATCH 4/5] tracing: Add warning if string in __assign_str() does not match __string() References: <20240226184932.303400070@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Steven Rostedt (Google)" In preparation to remove the second parameter of __assign_str(), make sure it is really a duplicate of __string() by adding a WARN_ON_ONCE(). Link: https://lore.kernel.org/linux-trace-kernel/20240223161356.63b72403@ga= ndalf.local.home Cc: Mathieu Desnoyers Reviewed-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) --- include/trace/stages/stage6_event_callback.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/trace/stages/stage6_event_callback.h b/include/trace/s= tages/stage6_event_callback.h index 0c0f50bcdc56..935608971899 100644 --- a/include/trace/stages/stage6_event_callback.h +++ b/include/trace/stages/stage6_event_callback.h @@ -35,6 +35,7 @@ do { \ char *__str__ =3D __get_str(dst); \ int __len__ =3D __get_dynamic_array_len(dst) - 1; \ + WARN_ON_ONCE((src) !=3D __data_offsets.dst##_ptr_); \ memcpy(__str__, __data_offsets.dst##_ptr_ ? : \ EVENT_NULL_STR, __len__); \ __str__[__len__] =3D '\0'; \ --=20 2.43.0