Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp118384lqs; Mon, 4 Mar 2024 17:42:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWAzwmd1s40IdCwzLPVtGpoWkZz5LUN7BMG+2iwpX2naIAwHNa2/mLiZGQ2Eom3/wXn2h0DgSFS9M/tEltW69qVLA9hf4sE+y6A9ssLRA== X-Google-Smtp-Source: AGHT+IFDzkFV8Cd4OeRuD51Cuv4kO8fip9ZksQ+MDMilyCiy0HUSXChTI68EdPbNUbhjPUptClEN X-Received: by 2002:a17:90a:5587:b0:29b:1759:c5df with SMTP id c7-20020a17090a558700b0029b1759c5dfmr8431386pji.26.1709602961645; Mon, 04 Mar 2024 17:42:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709602961; cv=pass; d=google.com; s=arc-20160816; b=kMWXYmPW1wq7a2PkP+zPY0L21LpchyDjQs8X2niy+7CxvmEjjrbYPNCjsT0ZwZpXQG YwQACYdIiWxGuqFeSXkkk2KUxoMaPAKNf8+ZBhEPOOcCmD0yFEeEl027cPMALHLV1ENY lP0D3dncT9dfa9wVi0mQD5oomhAhoDyqRAdI60yHNrw6ufXGsolDAleR7U3hpplUHfQ1 9/EPHbsWXQPXZ6Fof+C9vLQeiqrDzKFXjqyErVXf/kmX2afcB/444RbZK/fKNXDvHkbm 4pi4tyKuTY8tibzj5qABBXqGnwRqPmohn+bxlGMLzixZT2awNDJ2k+2h3KheXQSuetSd Zc7Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=AsNNXMKzKEGo/GAY59JD4aux+NcUpldqS7dFtFg82MA=; fh=uuHaOYjP8DrNWms6G8ace3ZMXqRYZY5l1dJVn5wQeS8=; b=h+aeR5d6U2k1K8hWcTfZDOnnmzxVQCr2DdzotafaxCp3AL088iOhDNfDKFo9yXhdS2 PKiddYaLp4CPKpUO6nQQfT8WNfsel3gLU4hUX9ulZvGgq0D4mQDaQ2cpHOuQBEiarXFw vfgSd4Jz8ZPGjaS5QImLnGIPPl1fNXFj+rXxv6xD5Wg1uwu6DO0mRZ6N6bTxGBg1Gh7g 6aWhButnY+XCLqOOMX3xwYfSNraEVMLAPZDwImdscyrrxDK2TtUBAeqB+Xq/IjQLLKH3 fC3vdznDjl9hnaZyVOX7ZljewtFjobYKGHm7VRceywB6BSK/RTqjXt4nhxsJa2Xbdpxb RnCw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=whQ0YrKl; arc=pass (i=1 spf=pass spfdomain=efficios.com dkim=pass dkdomain=efficios.com dmarc=pass fromdomain=efficios.com); spf=pass (google.com: domain of linux-kernel+bounces-91508-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91508-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r19-20020a17090b051300b00298f693c1f9si9221722pjz.32.2024.03.04.17.42.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 17:42:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91508-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=whQ0YrKl; arc=pass (i=1 spf=pass spfdomain=efficios.com dkim=pass dkdomain=efficios.com dmarc=pass fromdomain=efficios.com); spf=pass (google.com: domain of linux-kernel+bounces-91508-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91508-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 534B6286C8E for ; Tue, 5 Mar 2024 01:42:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 12B3417C7B; Tue, 5 Mar 2024 01:42:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="whQ0YrKl" Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) (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 9CC635CBD; Tue, 5 Mar 2024 01:42:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=167.114.26.122 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709602955; cv=none; b=Bqf2KFSG0hdSCpIBKOSxmBSm5Bct82BRi2KDCT2R98Bz5Wbnc4jGDvtrK7FKy4BxZHdWBey59nZKH1VE/E5PRPafdZUA6WZIpEjFZcXGoNPJi2b789E9TI9M6bFhCZ9/oFXrssSROl4cHvoQHMp8d1+dloHVvrJ2vikrBe+JSc0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709602955; c=relaxed/simple; bh=/Lpzc2sxxlqM30kwm13wev3MJZHwTfo3SXYSvymjDmE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Six146rlge0gJT5GMxs7zrYUV1SDsMYyUd19eDHu5sU1Rmhj8EJ/fOt07UkatNpS7u2ALmqlOEOOIZUo30N3f0t7xhtw0/+bxqNlh8K62FSD69Sxyi2BanrtZLztFmzno+5QrPdBVHwbctS3OpPqf+JtL4jZkYcJbJZ9YyOP3rc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com; spf=pass smtp.mailfrom=efficios.com; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b=whQ0YrKl; arc=none smtp.client-ip=167.114.26.122 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=efficios.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1709602952; bh=/Lpzc2sxxlqM30kwm13wev3MJZHwTfo3SXYSvymjDmE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=whQ0YrKl8jau36tWYE2sKAAO+dkAAqBa47z2PlZZT4kasnOfChkBIr2HzAt4F6NOp cXEURfs9f5Df2z8SFS658r/VaF862xkAvxTUN3hucMPdB/pzmfFOLvvxk/3iYY2jOU SxOhtFEAulHkS5sQUhMpd9+eBn8bgwu7c0WBOrP9MGaZ7cNM2qw2dxW/botCHnpBya 6cTBDGCsGknyRyN5t9PeBN/224Ku6MU5tplImmVTs64ad8boFU0ZVF0KxhV5atpbrH ZMMN1Hrt+2zIC0KFjFyeiEwxe63sSXqzQEn5JnMpJRmas9Fya8OIirnNtubASsIfn0 axhkcRHFGDw0w== Received: from [IPV6:2606:6d00:100:4000:cacb:9855:de1f:ded2] (unknown [IPv6:2606:6d00:100:4000:cacb:9855:de1f:ded2]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4Tpdbr4NG6zfYg; Mon, 4 Mar 2024 20:42:32 -0500 (EST) Message-ID: <91f27ba1-15a4-402d-8301-e2b9d23f64b0@efficios.com> Date: Mon, 4 Mar 2024 20:42:39 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] tracing: Have trace_marker writes be just half of TRACE_SEQ_SIZE Content-Language: en-US To: Steven Rostedt Cc: LKML , Linux Trace Kernel , Masami Hiramatsu , Linus Torvalds , Sachin Sant References: <20240304192710.4c99677c@gandalf.local.home> <469d31a7-f358-4547-bb17-0979b3515924@efficios.com> <20240304203516.45b7a551@gandalf.local.home> <20240304204119.7503ab0b@gandalf.local.home> From: Mathieu Desnoyers In-Reply-To: <20240304204119.7503ab0b@gandalf.local.home> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2024-03-04 20:41, Steven Rostedt wrote: > On Mon, 4 Mar 2024 20:35:16 -0500 > Steven Rostedt wrote: > >>> BUILD_BUG_ON(TRACING_MARK_MAX_SIZE + sizeof(meta data stuff...) > TRACE_SEQ_SIZE); >> >> That's not the meta size I'm worried about. The sizeof(meta data) is the >> raw event binary data, which is not related to the size of the event output. >> >> # cd /sys/kernel/tracing >> # echo hello > trace_marker >> # cat trace >> [..] >> <...>-999 [001] ..... 2296.140373: tracing_mark_write: hello >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> This is the meta data that is added to trace_seq > > That said, the meta data is most likely not going to be more than 128 bytes > (it shouldn't be more than 80). > > I could do as you suggest and create a separate TRACE_MARKER_SIZE and just > make sure that it's less than TRACE_SEQ_BUFFER_SIZE (as that's the size of > the content) by 128 bytes. > > /* Added meta data should not be more than 128 bytes */ > BUILD_BUG_ON((TRACE_MARKER_MAX_SIZE + 128) > TRACE_SEQ_BUFFER_SIZE); Bonus points if you add #define TRACE_OUTPUT_META_DATA_MAX_LEN 80 and a runtime check in the code generating this header. This would avoid adding an unchecked upper limit. Thanks, Mathieu > > -- Steve -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com