All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Mike Frysinger <vapier@gentoo.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] ftrace: document basic ftracer/ftracer graph needs
Date: Wed, 10 Jun 2009 14:56:30 -0400 (EDT)	[thread overview]
Message-ID: <alpine.DEB.2.00.0906101449320.30552@gandalf.stny.rr.com> (raw)
In-Reply-To: <1244623722-6325-2-git-send-email-vapier@gentoo.org>



On Wed, 10 Jun 2009, Mike Frysinger wrote:
>  The File System
>  ---------------
>  
> diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
> index 417d198..be936c9 100644
> --- a/kernel/trace/Kconfig
> +++ b/kernel/trace/Kconfig
> @@ -14,9 +14,46 @@ config HAVE_FTRACE_NMI_ENTER
>  
>  config HAVE_FUNCTION_TRACER
>  	bool
> +	help
> +	  Implement support for the _mcount() function (or whatever your
> +	  toolchain names it), and the ftrace_stub function (which only
> +	  does a return).
> +
> +	  The _mcount() function should check the function pointer
> +	  ftrace_trace_function to see if it is set to ftrace_stub.  If
> +	  it is, there is nothing for you to do -- return.  If it isn't,
> +	  then call it the same way the _mcount() function normally calls
> +	  __mcount_internal() -- the first argument is the "frompc" while
> +	  the second argument is the "selfpc" (adjusted to remove the size
> +	  of the embedded _mcount() call).
> +
> +	  For example, if the function foo() calls bar(), when the bar()
> +	  function calls _mcount(), the arguments to the tracer are:
> +	    "frompc" - the address bar() will use to return to foo()
> +	    "selfpc" - the address bar() (with _mcount() size adjustment)

This is too much for Kconfig.

>  
>  config HAVE_FUNCTION_GRAPH_TRACER
>  	bool
> +	help
> +	  Update your _mcount() function to check the function pointers
> +	  ftrace_graph_return (compare to ftrace_stub) and ftrace_graph_entry
> +	  (compare to ftrace_graph_entry_stub).  If either of those are not
> +	  set to the relevant stub function, call the arch-specific function
> +	  ftrace_graph_caller which in turn calls the arch-specific function
> +	  prepare_ftrace_return.
> +
> +	  The arguments to prepare_ftrace_return() are slightly different.
> +	  The first argument will instead be a pointer to the "frompc" --
> +	  typically located in the stack.  This allows the function to
> +	  hijack the return address temporarily to have it point to the
> +	  arch-specific function return_to_handler().  For exact details of
> +	  how to implement prepare_ftrace_return(), consult an existing port.
> +	  It is fairly straight forward C code.
> +
> +	  The return_to_handler() function is simple as well.  Have it call
> +	  the common ftrace_return_to_handler() function.  The return value
> +	  is the original return address, so restore this to the right place
> +	  and return.

This is also too much for Kconfig.

>  
>  config HAVE_FUNCTION_TRACE_MCOUNT_TEST
>  	bool
> @@ -25,11 +62,17 @@ config HAVE_FUNCTION_TRACE_MCOUNT_TEST
>  	 variable at the mcount call site. Otherwise, this variable
>  	 is tested by the called function.
>  
> +	 It is of course optional for arches, but does improve performance
> +	 a bit as it prevents constant state saving and call overhead when
> +	 the function tracer is actually disabled.
> +

The above would be fine, although I would reword it a little:

 This is optional for archs, but will improve performance, as it
 prevents constant state saving and call overhead when the function tracer
 tracer is active, but has been disabled.

I put in 'is active' because with dynamic function tracing it has no more 
overhead when disabled. We can enable function tracing, but soft disable 
it with a check of a bit.


>  config HAVE_DYNAMIC_FTRACE
>  	bool
>  
>  config HAVE_FTRACE_MCOUNT_RECORD
>  	bool
> +	help
> +	  See scripts/recordmcount.pl for more info.

This is fine.

-- Steve

>  
>  config HAVE_HW_BRANCH_TRACER
>  	bool
> -- 
> 1.6.3.1
> 
> 

  parent reply	other threads:[~2009-06-10 18:56 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-10  8:48 [PATCH 1/2] ftrace.txt: fix typo in function grapher name Mike Frysinger
2009-06-10  8:48 ` [PATCH 2/2] ftrace: document basic ftracer/ftracer graph needs Mike Frysinger
2009-06-10 17:04   ` Steven Rostedt
2009-06-10 18:31     ` Mike Frysinger
2009-06-10 18:45       ` Steven Rostedt
2009-06-10 19:07         ` Mike Frysinger
2009-06-10 19:11           ` Steven Rostedt
2009-06-10 19:19             ` Mike Frysinger
2009-06-10 19:34               ` Steven Rostedt
2009-06-10 19:45                 ` Mike Frysinger
2009-06-10 18:56   ` Steven Rostedt [this message]
2009-06-10 20:52   ` [PATCH 2/2 v2] " Mike Frysinger
2009-06-12  8:10     ` Mike Frysinger
2009-06-13 22:24       ` Frederic Weisbecker
2009-06-14  0:21         ` [PATCH v3] " Mike Frysinger
2009-06-14  1:24           ` Frederic Weisbecker
2009-06-14  1:52             ` Mike Frysinger
2009-06-14  2:24               ` Frederic Weisbecker
2009-06-14  3:05             ` [PATCH v4] " Mike Frysinger
2009-06-14 13:35               ` Frederic Weisbecker
2009-06-23 12:30               ` Mike Frysinger
2009-06-23 13:43                 ` Ingo Molnar
2009-09-14  1:54                   ` Mike Frysinger
2009-09-14  2:35                     ` Steven Rostedt
2009-09-14 19:48               ` Steven Rostedt
2009-09-14 20:21                 ` Mike Frysinger
2009-09-14 20:53                   ` Steven Rostedt
2009-09-14 21:01                     ` Mike Frysinger
2009-09-14 21:20                       ` Steven Rostedt
2009-09-14 21:30                         ` Mike Frysinger
2009-09-14 21:41                           ` Steven Rostedt
2009-09-14 20:28                 ` Frederic Weisbecker
2009-09-15  0:10                 ` [PATCH v5] " Mike Frysinger
2009-09-15  1:48                   ` [PATCH] [GIT PULL] " Steven Rostedt
2009-09-17  7:47                   ` [tip:tracing/core] ftrace: document function and function graph implementation tip-bot for Mike Frysinger
2009-06-14 15:10     ` [PATCH 2/2 v2] ftrace: document basic ftracer/ftracer graph needs Wu Zhangjin
2009-06-14 15:45       ` Mike Frysinger
2009-06-14 16:09         ` Wu Zhangjin
2009-06-15  6:25           ` Mike Frysinger
2009-06-10 17:02 ` [PATCH 1/2] ftrace.txt: fix typo in function grapher name Steven Rostedt
2009-06-10 17:08 ` [PATCH][GIT PULL] ftrace/documentation: " Steven Rostedt
2009-06-10 22:33 ` [tip:tracing/core] " tip-bot for Mike Frysinger

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=alpine.DEB.2.00.0906101449320.30552@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vapier@gentoo.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.