Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3403098
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:13:08+00:00 2026-05-18T05:13:08+00:00

I do some i/o intensive programming in C on GNU/Linux and I would like

  • 0

I do some i/o intensive programming in C on GNU/Linux and I would like to be able to trace all the i/o calls and to know the timings the application spends sleeping, waiting for IO for each call

Appart from the DIY method using gettimeoftheday everywhere, is there some tool to do that ? I want to be able to distinguish the calls from each other.

Ex of an output that would be usefull :

sendto at myprog.c:42    : 30µs
recvfrom at myprog.c:48  : 45µs
...

Note: what I want is real time, not cpu time like profilers generally give.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T05:13:09+00:00Added an answer on May 18, 2026 at 5:13 am

    The strace command has option -T which should do what you need. I checked the source code, it calls gettimeofday(2) to get the time, so it does report wall clock time, not CPU time.

    Example output from strace -p 2956 -T on my computer:

    stat("/proc/sys/fs/binfmt_misc", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0 <0.000028>
    stat("/media/Klatch", {st_mode=S_IFDIR|0711, st_size=4096, ...}) = 0 <0.000021>
    stat("/media/Drum", {st_mode=S_IFDIR|0711, st_size=4096, ...}) = 0 <0.000021>
    close(18)                               = 0 <0.000019>
    munmap(0x7fa088e60000, 4096)            = 0 <0.000022>
    open("/etc/mtab", O_RDONLY)             = 18 <0.000024>
    fstat(18, {st_mode=S_IFREG|0644, st_size=742, ...}) = 0 <0.000015>
    

    The time is at the end of the line, in seconds. That’s 15 to 28 microseconds for the system calls in the example above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

With the many programming tools from FaceBook, like FaceBook connect, graph api, etc... Is
I am a DSP, embedded software programmer, looking to improve my assembly language programming
This will not be a programming question but more technology / platform related question.
I recently did some work modifying a Python gui app that was using wxPython
I am new to programming in general so please keep that in mind when
I'm looking to add some genetic algorithms to an Operations research project I have
I'm looking into developing an application that will process data from a line-scan camera
This is one of those meta-programming questions that may or may not belong on
The following program loads two images with PyGame, converts them to Numpy arrays, and
One of the hardest things for me to initially adjust to was my first

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.