Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp98512lqs; Mon, 4 Mar 2024 16:47:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUaALrz3E9SasQn7gcymxxUxFiq2cevJZN26/nzk+KGdSQMEXMLTFCdQ2Kb52o31KNK4xaHiHpOMX/tVnD1DTzYcwy3007111+tKAakWg== X-Google-Smtp-Source: AGHT+IGXM4NcQYfwyuWdc+BziS332ZN45Tbu6rsAy8oxJgNScoF8MDsL3VDOcyekwGV6+7gSkh0h X-Received: by 2002:a05:6a00:8607:b0:6e5:e719:e04f with SMTP id hg7-20020a056a00860700b006e5e719e04fmr5826937pfb.10.1709599658483; Mon, 04 Mar 2024 16:47:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709599658; cv=pass; d=google.com; s=arc-20160816; b=xZ8Y+vEvZBZ3vC9k8qKJzz6I2hT5kF01DNBOdnEDBAChLO1ul8dzcz1s79roLO4s/y Z9CA1FBjr2XPqZOLC2qt43XRpU+q9Dc/McPOnaa8XwMumVNc9SJLNN0N9F8lt8hm4sbJ PJvfIAYNTtYkf8m5e4w+U6X2wwuGdSuP/W/AZKe/QZxhWBH1gx7yxGGv2UBlDStkWgcV IRQBVPlmc9tnoIpqy9dlRtynjqGulbznWMi2b6t9+CL6xNd+nxNr8V9uSfcHgSYBvvWg WoS9nu5MbU5hyIbosNbNy7UkHNVG6ZQQnmz2EHrjZ7yw3J4piIbS5CX0QcCqcuaNr2Yw Y/cA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=canW+JRWLVgyEjaKR6QmMgRfoqqaGcPtxPyR4L9LTNw=; fh=0sOazeYN3sDspskX3wJDi6rbnpcZuWqjgPWRr7mfV/8=; b=Mwd4EpAhtDHzUqCKmlJw8VXJn7nJrZkT+yqvf/qf8YXAnytuYyQ5rkFw1VBy6K3L/6 A4P/8M8D4oiHFu1+zthSDbGNpbW+wuYPcGrFJVTFoxNRxa9ZelKf3qEShVlykfcdbhQV /0htXdaPXJGg3ce6K6YbS+4m2fS5hc7qyJuDLuRCx7HquLTs8SF/nLrPxfaYux7/wCSO 7bxa5DWDguOOQ2zzpTlNLrAjioI0+ctagfvxNE5GI5ZVX2mkgRcMIDL7iEd/h+p9fMrF a/KPYyE+iPlFrvJEB7Hmhq2yPdEkSoo8IHxgkDf7FA1ltdg50KWHKEz1yXCQzwNwthsb jYIw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-91466-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91466-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g8-20020a056a0023c800b006e5b1c6a755si7611245pfc.107.2024.03.04.16.47.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 16:47:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91466-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-91466-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91466-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 99835283A85 for ; Tue, 5 Mar 2024 00:47:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 57E327465; Tue, 5 Mar 2024 00:47:21 +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 D20F73210; Tue, 5 Mar 2024 00:47:20 +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=1709599640; cv=none; b=jZbT20p+zdZRWCJLsxrzhGbnfJWB7Tkpa7knX/ziT0BVN/4gydIkkrQ01DQ8azr9lMc86bp+qEZKRKAc9nUdwcaQTC5WUGm0ll1ptFoDGgtN8SCjoFE8QszneQrB/sAmYQ1p52z7wQpv+9e8pjCruyOsO15z5AW0Gu4m0vWgagM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709599640; c=relaxed/simple; bh=3DXoHz0jv23bY60mQlVYQKbh3ernvy1omqureJCjqks=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sMrBnBByDP8GR862qG7L049+1rv88GyDXEtfkLzfAUaVs6WmqiMNYuH4kxhe/AttYzhXk3ZHRkLI0p3nAfp4SpeOofCMOaQabJFKaRjTUPq/az97W59cyFfKIeG4fASaove2QLbt5TWylL/VrPnKb0hGfxYeGowHwQ68OIOQDD8= 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 98D05C433F1; Tue, 5 Mar 2024 00:47:19 +0000 (UTC) Date: Mon, 4 Mar 2024 19:49:08 -0500 From: Steven Rostedt To: Randy Dunlap Cc: LKML , Linux Trace Kernel , Masami Hiramatsu , Mathieu Desnoyers , Linus Torvalds , Sachin Sant Subject: Re: [PATCH] tracing: Have trace_marker writes be just half of TRACE_SEQ_SIZE Message-ID: <20240304194908.6d8d4fba@gandalf.local.home> In-Reply-To: References: <20240304192710.4c99677c@gandalf.local.home> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 4 Mar 2024 16:43:46 -0800 Randy Dunlap wrote: > > 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 I honestly think my 't' key isn't triggering as much. At least when before hitting 'h', as I noticed I've been writing "he", "hey" and "here" a lot, and spell check isn't (obviously) catching it ;-) -- Steve > > > + * 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; > >