From patchwork Mon Feb 26 18:49:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 206854 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2268076dyb; Mon, 26 Feb 2024 10:48:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV+xLVsNCHaBleaDVAIAPMQLhnt5bjBVhoXRhSM3VQDTiS6BiALfummcVHJYSuW8f+vhhKRROKL13rs2BQ1OT+oD5Pa5Q== X-Google-Smtp-Source: AGHT+IE7T59cX2GOlTtryL9QB6JH5OQWjjZIEIHZMM/oGMmYKurLCDsx8HKcdTjAjdRvo4MK2SVN X-Received: by 2002:a05:622a:44a:b0:42e:74a8:57ce with SMTP id o10-20020a05622a044a00b0042e74a857cemr8301421qtx.41.1708973330112; Mon, 26 Feb 2024 10:48:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708973330; cv=pass; d=google.com; s=arc-20160816; b=nOtywZCpC4kBQmNhJwsgCsSEL2GXzET0uEFej68AQiXp3tXu9ELe+qoFV8l/ToLXyj PmS43fzEl2QsaeoQ/v+dd8K6Tw1toJ/EhVXFQSRqT22qlwWOb14Ok6cEjWaCrEY5dsei /lcU65ToNLeUVFqVlgcXECrtUfpM0GkCytcqXH+2tFAELIFrqft8cdsBWM7UxsqlR0LS KdUybJFfHJ/K9oChyQfn3/dk2o8lQyJkmtZydbKdgX/c5c1FZeI/a1elKj6B/WHKsWgI nmZtHe9vbN9gTGZoD0Pw7pX+4+92KnPgpVzcHd3hrnys5o6hR+TEFiW9iaetMJf9f/gq 4S0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:subject:cc:to:from:date:user-agent:message-id; bh=WU7n3KWtXCv+LQcTdMMLqdBGyHdj2Zm/EBoQU6C55xs=; fh=mTYg3JJ8i2GBNLFt8qb4bgYwOyk0kmrOzICLbi6qJ1c=; b=u6k5lDf889dVI9NHuiGwhCpbhBraFNnhpX19v5sJ2J4cqZG+cbZvgN+6LnasvnJQ8A k9VYZhIognQWdeJc3FnUQMLvcsJ9z7Lwh9VatkGakZpx03qBQdWIyK+2HDRH6UsfiQIE yPfGSkx8iM6VK9KFtyTqbj3CWgUqu9X7Ws5Kcv8ylWdZYOiNfW5D2t5NkmdORDWagvEK sNG4tYxUt1Ul94s75jrPDUjWaQwAcMDqGIlLooB56caysboENqbJkABQlPnVTNYh6s/T HsMgknAjMlCdq3bewDPPUuJ/jdbg6JV0Q5Psqs8y1D+aG4FY67j+q64C4EDHSgZTx1Zn JL6Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-82158-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82158-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f41-20020a05622a1a2900b0042dd382928fsi6101518qtb.356.2024.02.26.10.48.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 10:48:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82158-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-82158-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82158-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E33471C2409A for ; Mon, 26 Feb 2024 18:48:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0E7CF130AF9; Mon, 26 Feb 2024 18:47:53 +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 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791988418447440464 X-GMAIL-MSGID: 1791988418447440464 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@gandalf.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/stages/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__ = __get_str(dst); \ int __len__ = __get_dynamic_array_len(dst) - 1; \ + WARN_ON_ONCE((src) != __data_offsets.dst##_ptr_); \ memcpy(__str__, __data_offsets.dst##_ptr_ ? : \ EVENT_NULL_STR, __len__); \ __str__[__len__] = '\0'; \