Coder Social home page Coder Social logo

Comments (5)

namhyung avatar namhyung commented on September 13, 2024

@Taeung Hi, the --time-range option requires 2 time values separate by ~. You can omit one of them but not the ~. So you should use +1us~ (if you want to see functions after 1us from the beginning) or ~+1us (to see functions before 1us from the beginning) instead.

from uftrace.

Taeung avatar Taeung commented on September 13, 2024

Ah, I understood it.

After uftrace record

$ uftrace record ./a.out

In accardance with the elapsed time, we can see a part of function graph as below.

$ uftrace replay -f elapsed -r +20us~
#  ELAPSED    FUNCTION
  20.034 us |     } /* strdup */
  20.206 us |     strsep();
  20.432 us |     atoi();
  20.721 us |     atoi();
  20.954 us |   } /* get_values_from */
  21.060 us |   fgets();
  21.302 us |   get_values_from() {
...

But I think duration of default view can cause confusion from the point of view of newbies.
For example, If the user just do uftrace replay -r +20us~ after recording,

$ uftrace replay -r +20us~
# DURATION    TID     FUNCTION
            [22335] |     } /* strdup */
   0.091 us [22335] |     strsep();
   0.150 us [22335] |     atoi();
   0.122 us [22335] |     atoi();
   0.920 us [22335] |   } /* get_values_from */
   0.128 us [22335] |   fgets();
            [22335] |   get_values_from() {
...

But the time of --time-range option isn't related to duration. (confusing point, IMHO)
So the user can check with -f elapsed as below.

uftrace replay -f elapsed -r +20us~
#  ELAPSED    FUNCTION
  20.034 us |     } /* strdup */
  20.206 us |     strsep();
  20.432 us |     atoi();
  20.721 us |     atoi();
  20.954 us |   } /* get_values_from */
  21.060 us |   fgets();
  21.302 us |   get_values_from() {
...

Additionally if the user want to see both duration and elaped time,
the user can supplementally use -f duration,elapsed as below

uftrace replay -f duration,elapsed -r +20us~
# DURATION    ELAPSED    FUNCTION
             20.034 us |     } /* strdup */
   0.091 us  20.206 us |     strsep();
   0.150 us  20.432 us |     atoi();
   0.122 us  20.721 us |     atoi();
   0.920 us  20.954 us |   } /* get_values_from */
   0.128 us  21.060 us |   fgets();
             21.302 us |   get_values_from() {
...

I think it is better to show function graph with elapsed time by default when the user use time-range like -r +20us with elapsed time.
And if the user use time-range option with time stamp, we can show function graph with time stamp by default.

What do you think about it ?

from uftrace.

namhyung avatar namhyung commented on September 13, 2024

I'm not sure that's what user want always. I think I want to see duration anyway but time range is used only to limit the data range displayed.

from uftrace.

Taeung avatar Taeung commented on September 13, 2024

What about this ? Adding timestamp or elapsed time column to default veiw when using time-range
For example,

  1. If using time-range with timestamp, we can show as below by default.
$ uftrace replay -r 184832.543807090~184832.543817869
#     TIMESTAMP      DURATION    TID     FUNCTION
   184832.543807090            [22335] |   get_values_from() {
   184832.543807281   0.829 us [22335] |     strdup();
   184832.543808362   0.670 us [22335] |     strsep();
   184832.543809277   0.754 us [22335] |     atoi();
   184832.543810195   0.217 us [22335] |     atoi();
   184832.543810580   3.490 us [22335] |   } /* get_values_from */
...
  1. If using time-range with elapsed time, we can show as below by default.
$ uftrace replay -r +20us~
#  ELAPSED   DURATION    TID     FUNCTION
  20.034 us            [22335] |     } /* strdup */
  20.206 us   0.091 us [22335] |     strsep();
  20.432 us   0.150 us [22335] |     atoi();
  20.721 us   0.122 us [22335] |     atoi();
  20.954 us   0.920 us [22335] |   } /* get_values_from */
...

It is just my opinion ๐Ÿ˜„
What do you think about it ?

from uftrace.

namhyung avatar namhyung commented on September 13, 2024

Looks ok to me.

from uftrace.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.