From: Masami Hiramatsu <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@kernel.org>
Subject: Re: [RFC PATCH 1/1] tracepoints: tree-wide: Replace %p with %px
Date: Thu, 15 Oct 2020 01:41:27 +0900 [thread overview]
Message-ID: <20201015014127.dab82a6d488c3b4156ff576d@kernel.org> (raw)
In-Reply-To: <20201014113517.512fbd07@gandalf.local.home>
On Wed, 14 Oct 2020 11:35:17 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> On Thu, 15 Oct 2020 00:11:04 +0900
> Masami Hiramatsu <mhiramat@kernel.org> wrote:
>
> > On Wed, 14 Oct 2020 09:38:13 -0400
> > Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> >
> > Hmm, would you mean we always run such conversion on printing the trace
> > buffer for each entry? It could be much overhead because we need allocate
> > memory (%p->%px increase 1 byte) and format conversion (with copying it).
>
> I was thinking of having a single buffer allocated to the iterator (could
> increase in size when needed). Really, the output isn't that time critical,
> and running a conversion on all events each time shouldn't be that bad. And
> if it is, we could have a cache in the iter for a set of events to handle.
> Note, the conversion only needs to happen for events that have a %p in the
> fmt, and only those need to be cached.
>
> Then those buffers could be freed when the iter is freed.
Ah, I got it. so you meant adding a buffer field to struct trace_iterator,
correct?
>
> > Maybe we can avoid repeating it using a kind of cache, but it also consumes
> > memory. And as I pointed, the security reason is meaningless because there
> > are raw addresses in raw data which user can read...
> > Could you tell me what is your point? Making the code change as small as
> > possible?
> >
>
> It's about not having to worry about this in the future. Otherwise, we'll
> be playing whack-a-mole on making all %px in new trace events.
Hmm, OK. I hope no one adds an event which shows both ptr and hashed ptr
for making a database in the future ;)
Let me try to re-implement it.
Thank you,
--
Masami Hiramatsu <mhiramat@kernel.org>
prev parent reply other threads:[~2020-10-14 16:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-14 8:59 [RFC PATCH 0/1] tracepoints: Use %px instead of %p in trace event definitions Masami Hiramatsu
2020-10-14 8:59 ` [RFC PATCH 1/1] tracepoints: tree-wide: Replace %p with %px Masami Hiramatsu
2020-10-14 13:38 ` Steven Rostedt
2020-10-14 15:11 ` Masami Hiramatsu
2020-10-14 15:35 ` Steven Rostedt
2020-10-14 16:41 ` Masami Hiramatsu [this message]
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=20201015014127.dab82a6d488c3b4156ff576d@kernel.org \
--to=mhiramat@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rostedt@goodmis.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
Powered by JetHome