All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <srostedt@redhat.com>
To: wu zhangjin <wuzhangjin@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	zhiping zhong <xzhong86@163.com>
Subject: Re: [BUG?] tracing/function_graph: set_graph_function was broken from 2.6.36-rc2
Date: Thu, 20 Jan 2011 12:30:54 -0500	[thread overview]
Message-ID: <1295544654.19789.19.camel@fedora> (raw)
In-Reply-To: <AANLkTinxxOsXNatAiP0t8Vv0xFZcdSpoWWrG49g6JjqF@mail.gmail.com>

On Thu, 2011-01-20 at 02:55 +0800, wu zhangjin wrote:
> Hi, Steve
> 
> Zhiping Zhong reported a problem about set_graph_function: whenever
> users configure the entries through the tracing/set_graph_function
> interface, the tracing result always include the other functions which
> are not configured through the interfaces, and most of the tracing
> result we can see are the irq related functions, which means
> set_graph_function doesn't work as expects.

It does, but you need to disable irq tracing:

echo 0 > /debug/tracing/options/funcgraph-irqs

Perhaps I'll make this the default :-/

-- Steve

> 
> I have done some investigation, in the *ftrace_graph_entry ->
> trace_graph_entry() function, there is checking like this:
> 
>         [snip]
>         /* trace it when it is-nested-in or is a function enabled. */
>         if (!(trace->depth || ftrace_graph_addr(trace->func)) ||
>               ftrace_graph_ignore_irqs())
>                 return 0;
>         [snip]
> 
> and:
> 
> static inline int ftrace_graph_ignore_irqs(void)
> {
>         if (!ftrace_graph_skip_irqs)
>                 return 0;
> 
>         return in_irq();
> }
> 
> and:
> 
> /* When set, irq functions will be ignored */
> static int ftrace_graph_skip_irqs;
> 
> As we can see above, ftrace_graph_skip_irqs is initialized as 0, then,
> ftrace_graph_ignore_irqs() will return 0 by default, as a result, the
> checking in trace_graph_entry() will always be false, then every
> function will be traced whenever the set_graph_function is configured,
> so, this may be the cause.
> 
> A quick fix looks like this:
> 
>         /* trace it when it is-nested-in or is a function enabled. */
> -       if (!(trace->depth || ftrace_graph_addr(trace->func)) ||
> -             ftrace_graph_ignore_irqs())
> +       if (!(trace->depth || ftrace_graph_addr(trace->func) ||
> +             !ftrace_graph_ignore_irqs()))
>                 return 0;
> 
> And as the git log shows, the ftrace_graph_ignore_irqs() function was
> added from the following commit:
> 
>           tracing: Do not trace in irq when funcgraph-irq option is zero
> 
> Regards,
> Wu Zhangjin



  reply	other threads:[~2011-01-20 17:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-19 18:55 [BUG?] tracing/function_graph: set_graph_function was broken from 2.6.36-rc2 wu zhangjin
2011-01-20 17:30 ` Steven Rostedt [this message]
2011-01-21  9:27   ` wu zhangjin
2011-01-21 18:40     ` Steven Rostedt
2011-01-24  2:47       ` [BUG?] tracing/function_graph: set_graph_function was broken zhiping zhong
     [not found]       ` <AANLkTikA2r5VroeXKfXspmh+ZdPL3T=c3m3rwggqdCVP@mail.gmail.com>
2011-02-12  1:52         ` [BUG?] tracing/function_graph: set_graph_function was broken from 2.6.36-rc2 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=1295544654.19789.19.camel@fedora \
    --to=srostedt@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wuzhangjin@gmail.com \
    --cc=xzhong86@163.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 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.