linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: rostedt@goodmis.org (Steven Rostedt)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH v2 2/3] pstore: Add register read/write{b,w,l,q} tracing support
Date: Mon, 27 Aug 2018 12:15:30 -0400	[thread overview]
Message-ID: <20180827121530.525299e3@gandalf.local.home> (raw)
In-Reply-To: <7b212c02-d7ce-4309-155f-22b36963e41c@codeaurora.org>

On Sat, 25 Aug 2018 12:54:07 +0530
Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org> wrote:


> Ftrace does not trace __raw{read,write}{b,l,w,q}() functions. I am not 
> sure why and how it is filtered out because I do not see any notrace 
> flag in those functions, maybe that whole directory is filtered out.
> So adding this functionality to ftrace would mean removing the notrace 
> for these functions i.e., something like using 
> __raw{read,write}{b,l,w,q}() as the available filter functions. Also 
> pstore ftrace does not filter functions to trace I suppose?

It's not traced because it is inlined. Simply make the __raw_read
function a normal function and it will be traced. And then you could
use ftrace to read the function.

If this has to be per arch, you can register your callback with the
REGS flags, and pt_regs will be passed to your callback function you
attached to __raw_read*() as if you inserted a break point at that
location, and you can get any reg data you want there.


> 
> Coming to the reason as to why it would be good to keep this separate 
> from ftrace would be:
> * Ftrace can get ip and parent ip, but suppose we need extra data (field 
> data) as in above sample output we would not be able to get through ftrace.

As mentioned above, you can get regs (and ftrace is being expanded now
to get parameters of functions).

> 
> * Although this patch is for tracing register read/write, we can easily
> add more functionality since we have dynamic_rtb api which can be hooked 
> to functions and start tracing events(IRQ, Context ID) something similar 
> to tracepoints.
> Initially thought of having tracepoints for logging register read/write 
> but I do not know if we can export tracepoint data to pstore since the 
> main usecase is to debug unknown resets and hangs.

I don't know why not? We have read/write tracepoints for
read/write_msr() calls in x86.

Anything can add a hook to the callback of the tracepoints, and use
that infrastructure instead of creating yet another dynamic code
modification infrastructure.


> 
> * This can be something similar to mmiotrace in x86 and kept seperate 
> from function tracer.


mmiotrace is separate because it faults on writes so that we can
capture any reads and writes to the system that a binary driver does.

-- Steve

  reply	other threads:[~2018-08-27 16:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-24 14:45 [RFC PATCH v2 0/3] Register read/write tracing with dynamic debug and pstore Sai Prakash Ranjan
2018-08-24 14:45 ` [RFC PATCH v2 1/3] tracing: Add support for logging data to uncached buffer Sai Prakash Ranjan
2018-08-24 14:45 ` [RFC PATCH v2 2/3] pstore: Add register read/write{b, w, l, q} tracing support Sai Prakash Ranjan
2018-08-24 15:29   ` [RFC PATCH v2 2/3] pstore: Add register read/write{b,w,l,q} " Kees Cook
2018-08-25  7:24     ` Sai Prakash Ranjan
2018-08-27 16:15       ` Steven Rostedt [this message]
2018-08-28 13:17         ` Sai Prakash Ranjan
2018-08-28 16:02           ` Steven Rostedt
2018-08-28 17:26             ` Sai Prakash Ranjan
2018-08-24 14:45 ` [RFC PATCH v2 3/3] dynamic_debug: Add support for dynamic register trace Sai Prakash Ranjan
2018-09-06 10:05   ` Will Deacon
2018-09-06 18:06     ` Sai Prakash Ranjan

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=20180827121530.525299e3@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).