namhyung / uftrace

Function graph tracer for C/C++/Rust/Python
https://uftrace.github.io/slide/
GNU General Public License v2.0
2.92k stars 419 forks source link

Improve Documentation about Flame Graph (with --sample-time examples) #1932

Open vimkim opened 3 weeks ago

vimkim commented 3 weeks ago

Improve Documentation about Flame Graph

It seems like the flame graph is skipping a few functions if their durations are below a certain threshold. I was trying to generate a graph as dense as possible, minimizing the number of omitted functions.

Maybe due to my lack of foundational knowledge, reading the documentation about uftrace dump was not enough to figure out how to create such a dense flame graph.

I saw somewhere that I can use:

uftrace dump --sample-time 1us --flame-graph <...>

but I am unsure of other options.

My Questions Are:

  1. Can I set the sample time below 1 microsecond? Maybe to 0.0001 microseconds?
  2. Are there any options that guarantee the most dense version of the flame graph, preferably similar to that of Chrome tracing (if I may be so greedy)?

Thank you. If someone can provide information on this, I'm willing to create a PR to improve the documentation, which I hope will help the project.

namhyung commented 3 weeks ago

Yep, you can use 1ns for nano-second precision. Please feel free to send a PR for update!