public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/3] tracing: Show real address instead of hashed pointer
@ 2020-10-15  8:59 Masami Hiramatsu
  2020-10-15  9:00 ` [RFC PATCH v2 1/3] tracing: Show real address for trace event arguments Masami Hiramatsu
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Masami Hiramatsu @ 2020-10-15  8:59 UTC (permalink / raw)
  To: LKML; +Cc: Steven Rostedt, Masami Hiramatsu, Ingo Molnar

Hi,

Here is the 2nd series of the real address printing in trace log.
Here is the 1st version, I've changed the implementation according
to Steve's comment.

https://lore.kernel.org/lkml/160266594977.74973.9883936722540767319.stgit@devnote2/

This version has 3 patches, replacing %p to %px online, update trace_event.h
description and add an option to switch hashed ptr and real value on
trace log. Those are all new patches.

Since trace_seq_printf() use in-kernel vsprintf() at last, the %p is always
converted to the hash value instead of real address.

For the dmesg it maybe secure, but for the ftrace, I think it is
meaningless because

- tracefs is used by root user, so no need to hide it.
- tracefs user can access percpu/cpu*/trace_pipe_raw which stores real
  address on the trace buffer.
- external commands like perf doesn't convert to the hash value.

And when debugging kernel, we would like to know real address which tells
us the address is in which area in the kernel by comparing with kernel
memory mapping.
However, to compare the trace log with dmesg, we also need a bridging
information. So 3/3 gives the options/hash-ptr knob which switches
the output format.

Thank you,

---

Masami Hiramatsu (3):
      tracing: Show real address for trace event arguments
      tracing: Update the stage 3 of trace event macro comment
      tracing: Add ptr-hash option to show the hashed pointer value


 Documentation/trace/ftrace.rst |    6 ++++
 include/linux/trace_events.h   |    3 ++
 include/trace/trace_events.h   |   31 ++++++++++++++-------
 kernel/trace/trace.c           |   60 +++++++++++++++++++++++++++++++++++++++-
 kernel/trace/trace.h           |    3 ++
 kernel/trace/trace_output.c    |   12 +++++++-
 6 files changed, 103 insertions(+), 12 deletions(-)

--
Masami Hiramatsu (Linaro) <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-15 13:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-15  8:59 [RFC PATCH v2 0/3] tracing: Show real address instead of hashed pointer Masami Hiramatsu
2020-10-15  9:00 ` [RFC PATCH v2 1/3] tracing: Show real address for trace event arguments Masami Hiramatsu
2020-10-15 13:09   ` Steven Rostedt
2020-10-15 13:51     ` Masami Hiramatsu
2020-10-15  9:00 ` [RFC PATCH v2 2/3] tracing: Update the stage 3 of trace event macro comment Masami Hiramatsu
2020-10-15  9:00 ` [RFC PATCH v2 3/3] tracing: Add ptr-hash option to show the hashed pointer value Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox