Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

info: Change elapsed time format in info #393

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

honggyukim
Copy link
Collaborator

@honggyukim honggyukim commented Jul 6, 2018

This patch changes elapsed time format more like replay output.

Before:

  $ uftrace info
          ...
  # elapsed time        : 0.003219479 sec
  # cpu time            : 0.000 / 0.003 sec (sys / user)
          ...

After:

  $ uftrace info
          ...
  # elapsed time        : 7.74 ms
  # cpu time            : 0.004 / 0.000 sec (sys / user)
          ...

Signed-off-by: Honggyu Kim [email protected]

Copy link
Owner

@namhyung namhyung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I did this is to provide precise time. The suggested format is more readable but loose some precison.

cmds/record.c Outdated
#define SEC_TO_NSEC (1000000000ULL)

char *elapsed_time = NULL;
static char *elapsed_fmt_time = NULL;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you make it static?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, it's not needed. Thanks.

@honggyukim honggyukim force-pushed the check/elapsed-time-format branch from b52c574 to 51c3876 Compare July 6, 2018 14:56
@honggyukim
Copy link
Collaborator Author

I see. What about showing it as follows then?

# elapsed time        : 0.004970269 sec  (4.970 ms)

This patch changes elapsed time format more like replay output.

Before:
  $ uftrace info
          ...
  # elapsed time        : 0.003219479 sec
  # cpu time            : 0.000 / 0.003 sec (sys / user)
          ...

After:
  $ uftrace info
          ...
  # elapsed time        : 0.004970269 sec  (4.970 ms)
  # cpu time            : 0.004 / 0.000 sec (sys / user)
          ...

Signed-off-by: Honggyu Kim <[email protected]>
@honggyukim honggyukim force-pushed the check/elapsed-time-format branch from 51c3876 to cfc84ef Compare July 6, 2018 15:09
Copy link
Owner

@namhyung namhyung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope it could share the code with __print_time_unit() as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants