Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp97305lqs; Mon, 4 Mar 2024 16:44:00 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXSbix0HFN2KjP/UFeSWi/D2QpduH7sQ5sae2q62Nj5AieCzziWRXMofbb2Zkw3UI9apsNbXsIJS54znzpPfza6vK3AXNyPvjbmeghpKg== X-Google-Smtp-Source: AGHT+IFHTYUVqUpdwzmWxe3zgaiPjZoZKLLYDO9fcWk69L9C4pE0M7BGjibxVOkoZhVx9JLAgtdg X-Received: by 2002:aa7:c44a:0:b0:567:564f:5bd8 with SMTP id n10-20020aa7c44a000000b00567564f5bd8mr2433449edr.32.1709599440016; Mon, 04 Mar 2024 16:44:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709599440; cv=pass; d=google.com; s=arc-20160816; b=hLWrOYtsIp2h6GXBK3WJtlAXnda3BNGFz98m0kvwTKUSzP+KavcXkSsFaonfQ6Z15S S29o+ObKUcqNmJyEgYx3vyukW7Q3K4jbAQmYcqPUFbt4ozAkVR+qR4CyX9hHsnG6MhF/ ICEvdCTNlg7REl6JFeutug9ClqqvE9AMzwccLYSIsvQubKjsXG2qAFD4/9FeEvo4V2X7 zRqiKE3b0dCXGHKJuntHqQjx56ft9589GNPIwOkc/loSoWxmDnFROka3QPVwila0OpJ+ od6AOJO5cU2lfO8KokaVvQrpChNIHH0Ve/NHpEKcmsB3d999F9nyIYlW1fLd6qrtfuG6 GrTQ== 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=mrNHejpABW2qV0pTfb65sdG5Bs9DxgQoXhT9qzQvG8k=; fh=2WM+5XOgPpRtA+h81YGZO28h4DGw5mbbjGUsEjJ6u0w=; b=p7brTWbkDv0SfS39t7Q1SDSBtlnESiobvi2GMjHe6iqpAq+PKxABqxlcvqFnBwZxFG Q/zyyN9CvAPuBMv+WAZLhw2qNyq6htlrYMu9AouoOIdtfW0cn4RNgDyHcr1UB4DoW/qC IRnj+CLeiyTNrCfoqWaSzChur1tJNxD+RzB5BiYUKMDX9HSfh4UIlWi4qfTgx1svIUxe XZ/pY2mT9ClcvisiwdNWRA6QGywJhAjpkNOnv4rP2PXOsY3CjDUb9NtUDqmEL09DWOPk 9cqwOvn3LrkutB0SLJDfpmWmTdfVCi6eAOLNehHVNZW3vb2bQbalw29Lf15rTc1caF8O ErnA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=06WqZyJD; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-91464-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91464-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 28-20020a50875c000000b005664cabfc8esi4407584edv.463.2024.03.04.16.43.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 16:44:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91464-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=06WqZyJD; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-91464-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91464-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 BC5121F21ADD for ; Tue, 5 Mar 2024 00:43:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA83B63A1; Tue, 5 Mar 2024 00:43:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="06WqZyJD" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 B1BA446A0; Tue, 5 Mar 2024 00:43:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709599432; cv=none; b=TvlgZieEbT1wZrV3m5JY8yPeBVOIpewntIa1/L/ozar809JEG+OF4NxDDwseSWo8vWsAwYX/FNr+JhTTXS/8JW8COVfknFUpXtQdOjVnyeblxYahvB8B8Z7ZyAgTmZRKWaR9rruX00vM0hn5ygi2wTEpGRALbULDgQ9BtIw9an0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709599432; c=relaxed/simple; bh=sLNA+WUpbHvwjwTNEbjFW09PC+UWKmO+1c0w4EX9cQ8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=uUxM918EGjhA/QAUDEFmV3cNLOh2sf2C+dSQERp6ru3TzTxTQJ9USJBSmu9nFiaTqxreRvVsklQ4a05XUIYZp2YmBh5HUqgM38efiwkYmfAF5uMYUQCIQsb7ovrEbC4WRUwSQh9NxsYzPNepT27Lx0tE8vIpVyFaeYGqGHF4P88= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=06WqZyJD; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=mrNHejpABW2qV0pTfb65sdG5Bs9DxgQoXhT9qzQvG8k=; b=06WqZyJDiLi03sa1Xbf3MQfh60 vxIy33b5+UJO9HD6XWmczEzGRrj47NcF15+p2Iz7UoVzx6k8Rx+PwqLs17Pq2UvbWkXGki/jSkcJx 2tCxAuHrEevf7Ky0MbeWEaSt+8aQafD4BP5ZBydpTo64QOjLkTi/pFLIfHcZB+5lGNV7+Dxt98WuP xzN1a2Wvs9cq0gNT2aUPoyxmqnRTBIlD7uo5FdDW1IIejmGLV8GucR/DVrUc8rfyTNRXwI+/Kjgij MQcsMNLiopVhqJeKxe87D7ZFx4JsgWWgvSJMbb7Soa8CVqDt4m1zQJZsJZxiJoblu6TVGyvbs4MWB Vb+3R8Dg==; Received: from [50.53.50.0] (helo=[192.168.254.15]) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhIuK-0000000BGNW-1Gi5; Tue, 05 Mar 2024 00:43:48 +0000 Message-ID: Date: Mon, 4 Mar 2024 16:43:46 -0800 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 , LKML , Linux Trace Kernel Cc: Masami Hiramatsu , Mathieu Desnoyers , Linus Torvalds , Sachin Sant References: <20240304192710.4c99677c@gandalf.local.home> From: Randy Dunlap In-Reply-To: <20240304192710.4c99677c@gandalf.local.home> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c > index 8198bfc54b58..d68544aef65f 100644 > --- a/kernel/trace/trace.c > +++ b/kernel/trace/trace.c > @@ -7320,6 +7320,17 @@ tracing_mark_write(struct file *filp, const char __user *ubuf, > if ((ssize_t)cnt < 0) > return -EINVAL; > > + /* > + * TRACE_SEQ_SIZE is the total size of trace_seq buffer used > + * for output. As the print event outputs more than just > + * the string written, keep it smaller than the trace_seq > + * as it could drop the event if the extra data makes it bigger > + * than what the trace_seq can hold. Half he TRACE_SEQ_SIZE the > + * is more than enough. > + */ > + if (cnt > TRACE_SEQ_SIZE / 2) > + cnt = TRACE_SEQ_SIZE / 2; > + > meta_size = sizeof(*entry) + 2; /* add '\0' and possible '\n' */ > again: > size = cnt + meta_size; -- #Randy