From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Linux Trace Kernel <linux-trace-kernel@vger.kernel.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Sachin Sant <sachinp@linux.ibm.com>
Subject: Re: [PATCH] tracing: Have trace_marker writes be just half of TRACE_SEQ_SIZE
Date: Mon, 4 Mar 2024 21:18:13 -0500 [thread overview]
Message-ID: <cef0b07e-f90d-4759-ae54-0f091e87edab@efficios.com> (raw)
In-Reply-To: <20240304205943.081bea96@gandalf.local.home>
On 2024-03-04 20:59, Steven Rostedt wrote:
> On Mon, 4 Mar 2024 20:42:39 -0500
> Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:
>
>> #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.
>
> That would be a lot of complex code that is for debugging something that
> has never happened in the past 16 years and Linus has already reprimanded
> me on doing such things.
Is it more complex than remembering the iterator position in
print_trace_fmt() right before:
if (tr->trace_flags & TRACE_ITER_CONTEXT_INFO) {
if (iter->iter_flags & TRACE_FILE_LAT_FMT)
trace_print_lat_context(iter);
else
trace_print_context(iter);
}
and then checking just after that the offset is not beyond 128
bytes ? Perhaps there is even something internal to "iter"
that already knows about this offset (?).
This would catch any context going beyond its planned upper
limit early. Failing early and not just in rare corner cases
is good.
And it's not for debugging, it's for validation of assumptions
made about an upper bound limit defined for a compile-time
check, so as the code evolves issues are caught early.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
next prev parent reply other threads:[~2024-03-05 2:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-05 0:27 Steven Rostedt
2024-03-05 0:43 ` Randy Dunlap
2024-03-05 0:49 ` Steven Rostedt
2024-03-05 1:15 ` Mathieu Desnoyers
2024-03-05 1:35 ` Steven Rostedt
2024-03-05 1:36 ` Mathieu Desnoyers
2024-03-05 1:57 ` Steven Rostedt
2024-03-05 1:41 ` Steven Rostedt
2024-03-05 1:42 ` Mathieu Desnoyers
2024-03-05 1:59 ` Steven Rostedt
2024-03-05 2:18 ` Mathieu Desnoyers [this message]
2024-03-05 2:35 ` Steven Rostedt
2024-03-05 2:37 ` Steven Rostedt
2024-03-05 2:48 ` Mathieu Desnoyers
2024-03-05 3:07 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cef0b07e-f90d-4759-ae54-0f091e87edab@efficios.com \
--to=mathieu.desnoyers@efficios.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
--cc=sachinp@linux.ibm.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®