LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: mingo@elte.hu, fweisbec@gmail.com, linux-kernel@vger.kernel.org,
masami.hiramatsu.pt@hitachi.com
Subject: Re: [RFC 0/4] tracing,x86_64 - function/graph trace without mcount/-pg/framepointer
Date: Thu, 03 Feb 2011 11:33:25 -0500 [thread overview]
Message-ID: <1296750805.10797.87.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <1296747761-9082-1-git-send-email-jolsa@redhat.com>
On Thu, 2011-02-03 at 16:42 +0100, Jiri Olsa wrote:
> hi,
>
> I recently saw the direct jump probing made for kprobes
> and tried to use it inside the trace framework.
>
> The global idea is patching the function entry with direct
> jump to the trace code, instead of using pregenerated gcc
> profile code.
Interesting, but ideally, it would be nice if gcc provided a better
"mcount" mechanism. One that calls mcount (or whatever new name it would
have) before it does anything with the stack.
>
> I started this just to see if it would be even possible
> to hook with new probing to the current trace code. It
> appears it's not that bad. I was able to run function
> and function_graph trace on x86_64.
>
> For details on direct jumps probe, please check:
> http://www.linuxinsight.com/ols2007-djprobe-kernel-probing-with-the-smallest-overhead.html
>
>
> I realize using this way to hook the functions has some
> drawbacks, from what I can see it's roughly:
> - no all functions could be patched
What's the reason for not all functions?
> - need to find a way to say which function is safe to patch
> - memory consumption for detour buffers and symbol records
>
> but seems there're some advantages as well:
> - trace code could be in a module
What makes this allow module code?
ftrace could do that now, but it would require a separate handler. I
would need to disable preemption before calling the module code function
handler.
> - no profiling code is needed
> - framepointer can be disabled (framepointer is needed for
> generating profile code)
Again ideally, gcc should fix this.
-- Steve
next prev parent reply other threads:[~2011-02-03 16:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-03 15:42 Jiri Olsa
2011-02-03 15:42 ` [PATCH 1/4] kprobe - ktrace instruction slot cache interface Jiri Olsa
2011-02-03 15:42 ` [PATCH 2/4] tracing - adding size parameter to do_ftrace_mod_code Jiri Olsa
2011-02-03 15:42 ` [PATCH 3/4] ktrace - function trace support Jiri Olsa
2011-02-03 15:42 ` [PATCH 4/4] ktrace - function graph " Jiri Olsa
2011-02-03 16:33 ` Steven Rostedt [this message]
2011-02-03 17:35 ` [RFC 0/4] tracing,x86_64 - function/graph trace without mcount/-pg/framepointer Frederic Weisbecker
2011-02-03 19:00 ` Steven Rostedt
2011-02-04 6:03 ` Masami Hiramatsu
2011-02-07 21:22 Josh Triplett
2011-02-07 21:32 ` 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=1296750805.10797.87.camel@gandalf.stny.rr.com \
--to=rostedt@goodmis.org \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@elte.hu \
--subject='Re: [RFC 0/4] tracing,x86_64 - function/graph trace without mcount/-pg/framepointer' \
/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
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).