public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tim Bird <tim.bird@am.sony.com>
To: "rostedt@goodmis.org" <rostedt@goodmis.org>
Cc: Jiri Olsa <jolsa@redhat.com>,
	Lai Jiangshan <laijs@cn.fujitsu.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: tracing: confusing output of function_graph when notrace function calls traceable function
Date: Wed, 6 Jan 2010 10:15:32 -0800	[thread overview]
Message-ID: <4B44D344.5010909@am.sony.com> (raw)
In-Reply-To: <1262790997.28171.2865.camel@gandalf.stny.rr.com>

>Steven Rostedt wrote:
>>On Wed, 2010-01-06 at 14:08 +0100, Jiri Olsa wrote:
>>> On Wed, Jan 06, 2010 at 06:44:02PM +0800, Lai Jiangshan wrote:
>>> == real graph ==:
>>>
>>> father_fun()
>>>   child_fun()
>>>   notrace_child_fun()
>>>     grandchild_fun1()
>>>     grandchild_fun2()
>>>
>>> ===function_graph shows===>
>>>
>>> father_fun()
>>>   child_fun()
>>>   grandchild_fun1()
>>>   grandchild_fun2()
>>>
>>> When the notrace function calls traceable function, function_graph will
>>> get wrong depth of functions, and show wrong graph.
>>>
>>> Is there any method to fix it?
>> I dont think so..
>>
>> AFAIK the depth computation is based on the traced functions, and there's
>> no other 'depth related' input apart from them.
> 
> Right.
> 
> 
> Honestly, if you think about it, the "father_fun()" does call those
> grandchild_fun() functions. Just indirectly. I don't find anything wrong
> with this.
> 
> You get the same issue if gcc decides to inline a function, since those
> inlined functions don't get traced either.

Well, there is at least one thing different that could be used to indicate
that we're "down" farther in the call nesting, and that is stack depth.
In the example above, grandchild_fun1() is going to have a lower stack position
than child_fun().  So you might be able to use 'sp' to distinguish between
children and lower descendents.

You could potentially use this as an indicator for increased
indentation, but I'm not sure how accurate it is.
This might be different from the inline case, where the compiler usually
does not build a stack frame for the "called" code.  But you also might
get false positives from variables declared inside in-function blocks
(or from other compiler oddities).

I would lean towards Steve's answer, that it doesn't matter too much.
Invisibility in the trace log, and the possible confusion it creates,
is the price you pay for 'notrace'.

Just my 2 cents.
 -- Tim

=============================
Tim Bird
Architecture Group Chair, CE Linux Forum
Senior Staff Engineer, Sony Corporation of America
=============================


      reply	other threads:[~2010-01-06 18:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-06 10:44 tracing: confusing output of function_graph when notrace function calls traceable function Lai Jiangshan
2010-01-06 13:08 ` Jiri Olsa
2010-01-06 15:16   ` Steven Rostedt
2010-01-06 18:15     ` Tim Bird [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=4B44D344.5010909@am.sony.com \
    --to=tim.bird@am.sony.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.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