mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Alison Schofield <alison.schofield@intel.com>,
	Beau Belgrave <beaub@linux.microsoft.com>,
	Huang Yiwei <quic_hyiwei@quicinc.com>,
	John Garry <john.g.garry@oracle.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Thorsten Blum <thorsten.blum@toblux.com>,
	Vincent Donnefort <vdonnefort@google.com>,
	linke li <lilinke99@qq.com>
Subject: Re: [GIT PULL v2] tracing: Updates for v6.9
Date: Tue, 19 Mar 2024 13:13:33 -0400	[thread overview]
Message-ID: <20240319131333.504c93fc@gandalf.local.home> (raw)
In-Reply-To: <20240319130653.0cfdaf6e@gandalf.local.home>

On Tue, 19 Mar 2024 13:06:53 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> This is in the fast path (where the trace event happens), but I can make it
> always do strcmp(), even though it will slow down what is being recorded,
> as I plan on removing the parameter in the next merge window anyway.

I'll change it to this:

#define __assign_str(dst, src)						\
	do {								\
		char *__str__ = __get_str(dst);				\
		int __len__ = __get_dynamic_array_len(dst) - 1;		\
		WARN_ON_ONCE(!src != !__data_offsets.dst##_ptr_);	\
		WARN_ON_ONCE(src && strcmp((src), __data_offsets.dst##_ptr_)); \
		memcpy(__str__, __data_offsets.dst##_ptr_ ? :		\
		       EVENT_NULL_STR, __len__);			\
		__str__[__len__] = '\0';				\
	} while (0)

The first WARN_ON() will report the bug if src is not NULL and the pointer
is even though the strcmp() will likely crash in that case. But that's a
bug if that happens anyway.

-- Steve

  reply	other threads:[~2024-03-19 17:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-18 15:30 Steven Rostedt
2024-03-18 22:47 ` pr-tracker-bot
2024-03-19 16:23 ` Linus Torvalds
2024-03-19 16:58   ` Steven Rostedt
2024-03-19 17:06   ` Steven Rostedt
2024-03-19 17:13     ` Steven Rostedt [this message]
2024-03-19 21:03       ` Nathan Chancellor
2024-03-19 21:22         ` Linus Torvalds
2024-03-19 21:27           ` Nathan Chancellor
2024-03-19 21:27         ` 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=20240319131333.504c93fc@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=alison.schofield@intel.com \
    --cc=beaub@linux.microsoft.com \
    --cc=john.g.garry@oracle.com \
    --cc=lilinke99@qq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=quic_hyiwei@quicinc.com \
    --cc=rdunlap@infradead.org \
    --cc=thorsten.blum@toblux.com \
    --cc=torvalds@linux-foundation.org \
    --cc=vdonnefort@google.com \
    /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®