Message ID | 20231219143300.196456990@goodmis.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-5380-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1982633dyi; Tue, 19 Dec 2023 06:38:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IF2i6QcJMVl3BiV10udo7czObldZ7JeyFHn8aEW54Qym/jtdt7gaKE2mrSUwAEIK/na5Eal X-Received: by 2002:a17:902:d54c:b0:1d3:3952:8885 with SMTP id z12-20020a170902d54c00b001d339528885mr16011764plf.11.1702996739419; Tue, 19 Dec 2023 06:38:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702996739; cv=none; d=google.com; s=arc-20160816; b=zi0F1syOmxiJx8uPptqCK60Kt+OElPQoFMrhbR2kL2Ad3e2+3ZhDEHqyeH870fuBJ9 Dqs5D0NFPQMogx7SE0p+3x93//C5HCETJ+kj9aDZRyY4PlotE/wSONVFFzPljMZRzrny 7dq3HIZy4EghVKkRv+3j0+HdvJWa7nXadvqvUSmGpjI5wZ74sUZBk2FRcKERB+EoN0qH Y0YdCbcFibjvVCpkeo9Q485F0/kSIbx5H8fR1+EFxLKsjqxEAT0Pzz2NKbexeIcZaHxt JFimPdSINfUyv/avwLx6WTfMKvlOf0EHU4JnLxxCyjnFATHsTajX4mcG2BzQcBViATG/ eMBQ== ARC-Message-Signature: i=1; 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=opqU1B1wLK7UMPB3OcOOcErf86XMcOPA+1hWeofFxlE=; fh=mTYg3JJ8i2GBNLFt8qb4bgYwOyk0kmrOzICLbi6qJ1c=; b=k/prK87tsiJv9oOOj8VzKWSyO+mFLLA75BKyZHniA1l+LsyYifNUtWarRRYfEIv37h CuH7MxLhbF6e7u8vIGxV+AVZWRSFBuuVZMr60Iz5oou9XapDtZiomE0eV9+uCDHeVmfd R7yqVVwglx653EqCEgj6VhGKKnbA3bVSOVgTfCGVtzRM2JDk+j25By9q1/pNx/Z5hJz6 BbQmWephADR5e3G5Cwk3PCsBfy/39lP7y4V7/Q7sHMHOoW3pSNLn+nroiR3I/yG7Iuq0 9QOXFXOL82Q0y51TpPhPuzEO+JaXOhSEdQqzf+2ihE3A2pfs0PTjIZavA3iNZWpNCS16 EJVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-5380-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5380-ouuuleilei=gmail.com@vger.kernel.org" Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id b2-20020a170903228200b001cfc170c11asi19935182plh.475.2023.12.19.06.38.59 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 06:38:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5380-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-5380-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5380-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 590F4B21927 for <ouuuleilei@gmail.com>; Tue, 19 Dec 2023 14:36:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D454C1C29C; Tue, 19 Dec 2023 14:32:05 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org 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 7284E20DCF for <linux-kernel@vger.kernel.org>; Tue, 19 Dec 2023 14:32:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5BB32C433CB; Tue, 19 Dec 2023 14:32:01 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from <rostedt@goodmis.org>) id 1rFb9Y-00000003MFu-1jlQ; Tue, 19 Dec 2023 09:33:00 -0500 Message-ID: <20231219143300.196456990@goodmis.org> User-Agent: quilt/0.67 Date: Tue, 19 Dec 2023 09:32:38 -0500 From: Steven Rostedt <rostedt@goodmis.org> To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu <mhiramat@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Mathieu Desnoyers <mathieu.desnoyers@efficios.com>, Andrew Morton <akpm@linux-foundation.org> Subject: [for-next][PATCH 05/10] tracing: Have trace_marker break up by lines by size of trace_seq References: <20231219143233.204534014@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785721509026471940 X-GMAIL-MSGID: 1785721509026471940 |
Series |
tracing: Updates for 6.8
|
|
Commit Message
Steven Rostedt
Dec. 19, 2023, 2:32 p.m. UTC
From: "Steven Rostedt (Google)" <rostedt@goodmis.org> If a trace_marker write is bigger than what trace_seq can hold, then it will print "LINE TOO BIG" message and not what was written. Instead, check if the write is bigger than the trace_seq and break it up by that size. Ideally, we could make the trace_seq dynamic that could hold this. But that's for another time. Link: https://lore.kernel.org/linux-trace-kernel/20231212190422.1eaf224f@gandalf.local.home Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> --- kernel/trace/trace.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 0be30cccabb4..9cf58383d2fb 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -7304,6 +7304,11 @@ tracing_mark_write(struct file *filp, const char __user *ubuf, if (cnt < FAULTED_SIZE) size += FAULTED_SIZE - cnt; + if (size > TRACE_SEQ_BUFFER_SIZE) { + cnt -= size - TRACE_SEQ_BUFFER_SIZE; + goto again; + } + buffer = tr->array_buffer.buffer; event = __trace_buffer_lock_reserve(buffer, TRACE_PRINT, size, tracing_gen_ctx());