From: Steven Rostedt <rostedt@goodmis.org>
To: yogesh tillu <tillu.yogesh@gmail.com>
Cc: linux-kernel@vger.kernel.org,
Prasun Kapoor <Prasun.Kapoor@caviumnetworks.com>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Subject: Re: [Ftrace][Bug] Failed on adding breakpoints, when used with kgdboc
Date: Mon, 10 Feb 2014 13:03:17 -0500 [thread overview]
Message-ID: <20140210130317.24019a4d@gandalf.local.home> (raw)
In-Reply-To: <CAAH=MDydEbG-iDC92G18U4iDtD6vMcegGSuzK4Kihq+vz7eQQA@mail.gmail.com>
On Mon, 10 Feb 2014 22:59:24 +0530
yogesh tillu <tillu.yogesh@gmail.com> wrote:
> Hi Steve,
> Thanks for the reply.
> Can we follow the approach of using api ftrace_set_notrace_ip (like
> ftrace_set_filter_ip ), and register ip for the notrace hash list from
> kgdb x86 arch code at the time of adding/removing breakpoint.
>
>
I'm not sure that will work. I have no problem skipping ftrace tests if
kgdb is enabled on boot up. That's just self test debugging anyway, and
pretty much useless for most people but those developing ftrace.
The reason I say it wont work, is that the filters are not global. That
is, you can call those "don't trace this function" API, and it will
only work for the ftrace function tracer. There's other users of ftrace
(perf, kprobes, stack-tracer, etc) that will still trace whatever it
wanted to trace.
As the bug only happens when function tracing is being enabled or
disabled when the kgdb breakpoint exists, I don't think this is
that much of a problem. I'm sure you could cause it to fail again, but
this always requires root privilege, for both ftrace and kgdb, and the
worse thing that happens is you get that splat and the function tracer
is disabled. It wont crash the kernel or do any other harm.
By skipping the start up tests, it is highly unlikely kgdb will trip up
function tracing unless you still have those break points around.
Now, if kgdb always keeps a breakpoint at do_page_fault() handler, then
perhaps we can do one of two things. The one, is like you said, don't
do function tracing on that function (skip it if kgdb is enabled).
The other is to be more like kprobes, and have kgdb hook into the
ftrace infrastructure. That is, if you find that you are about to add a
breakpoint to the start of a function, and that address happens to have
an ftrace _fentry_ call to it (or nop). Then just register your own
ftrace handler with the "REGS" flag, and the call back will act just
like a breakpoint, but only faster :-)
-- Steve
prev parent reply other threads:[~2014-02-10 18:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-07 14:08 yogesh tillu
2014-02-07 14:34 ` Steven Rostedt
2014-02-10 17:29 ` yogesh tillu
2014-02-10 18:03 ` Steven Rostedt [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=20140210130317.24019a4d@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=Prasun.Kapoor@caviumnetworks.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=tillu.yogesh@gmail.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®