linux-trace-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matteo Bertolino <matteo.bertolino@huawei.com>
To: Yordan Karadzhov <y.karadz@gmail.com>,
	"linux-trace-users@vger.kernel.org" 
	<linux-trace-users@vger.kernel.org>
Subject: RE: Kernelshark: funcgraph_exit events don't seem to exit?
Date: Tue, 6 Sep 2022 11:57:28 +0000	[thread overview]
Message-ID: <f2feee0c5a6b49f3949eba9ded500842@huawei.com> (raw)
In-Reply-To: <9252a7a4-f36c-356a-f069-9b17367ffff1@gmail.com>

Dear Yordan,
Thanks for your reply!

I would like to do a double check to be sure that we're on the same rail. 
Can you please take my screenshot again? Between 8.090000 and 8.130000 the trace doesn't provide any information.

We don't know whether:
A) task1 continues after the end of foo1 running something else that is not traced
Or
B) The CPU is idle/a non-traced task is running.

Today, the default behavior of kernelshark is A). Indeed, in my screenshot, the bar indicated by the light-blue arrow is red.

Instead, I wish to code a plugin with a third option:
C) when we do not know what happens, just color with gray.

Do your instructions cover this case? 
If so, I would like to have some hints and I will try to implement it :-)

Best Regards,
Matteo

-----Original Message-----
From: Yordan Karadzhov [mailto:y.karadz@gmail.com] 
Sent: Tuesday, September 6, 2022 12:45 PM
To: Matteo Bertolino <matteo.bertolino@huawei.com>; linux-trace-users@vger.kernel.org
Subject: Re: Kernelshark: funcgraph_exit events don't seem to exit?

Hi Matteo,
Thanks for reporting this issue!

I understand what you would like to see being visualized, but 
unfortunately this is different from the implemented generic logic of 
the visualization model that changes the color at the place of the first 
event that belongs to the new task. Note that this generic logic is 
expected to provide adequate visualization for all types of events, 
while the behavior that you would like to see makes sense only for very 
specific events.

However, what you want is actually very easy to achieve. You just have 
to write a kernelshark plugin for funcgraph_exit events. If you are 
interested in contributing such plugin to kernelshark, I can send you 
instructions what has to be done. It will be really trivial work.

cheers,
Yordan


On 9/6/22 12:29, Matteo Bertolino wrote:
> Dear community,
> In order to explain my problem, I need to ask you to have a look to the visual trace in my github (I cannot attach it to the mail nor using an image uploading service): https://github.com/the-red-robin/trace-cmd-experiments/blob/main/README.md
> 
> In the trace, we have one CPU, CPU0. On it:
> - `Task3` runs `foo5()` at time 8.000000 cycles
> - `Task2` takes place running `foo3()` at time 8.010000 cycles.
> - `Task1` takes place running `foo1()` at time 8.060000 cycles.
> For now, everything OK.
> Then, I wish to `exit` the three tasks.
> 
> - `Task1` exits at 8.090000 cycles. Here the trace does not show what I expect, namely `Task1` (in red) shall end at 8.090000 cycles. Instead, there is a red trace until the beginning of the next exit event, `Task2` at 8.130000.
> 
> This doesn't seem an `exit` event. Do you have any suggestions to show what I wish on Kernelshark?
> 
> Best Regards,
> Matteo

  reply	other threads:[~2022-09-06 11:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-06  9:29 Kernelshark: funcgraph_exit events don't seem to exit? Matteo Bertolino
2022-09-06 10:45 ` Yordan Karadzhov
2022-09-06 11:57   ` Matteo Bertolino [this message]
2022-09-06 18:01     ` Yordan Karadzhov
2022-09-07  8:08       ` Matteo Bertolino
2022-09-08 19:04         ` Yordan Karadzhov

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=f2feee0c5a6b49f3949eba9ded500842@huawei.com \
    --to=matteo.bertolino@huawei.com \
    --cc=linux-trace-users@vger.kernel.org \
    --cc=y.karadz@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;
as well as URLs for NNTP newsgroup(s).