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 9207875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:29:07+00:00 2026-06-18T00:29:07+00:00

My requirement is to profile current process disk read/write operations with total disk read/write

  • 0

My requirement is to profile current process disk read/write operations with total disk read/write operations (or amount of data read/written). I need to take samples evry second and plot a graph between these two. I need to do this on Linux (Ubuntu 12.10) in c++.

Are there any APIs/Tools available for this task ? I found one tool namely iotop but I am not sure how to use this for current process vs system wide usage.

Thank You

  • 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-06-18T00:29:09+00:00Added an answer on June 18, 2026 at 12:29 am

    You can read the file /proc/diskstats every second. Each line represents one device.

    From kernel’s “Documentation/iostat.txt”:

    Field  1 -- # of reads completed
        This is the total number of reads completed successfully.
    Field  2 -- # of reads merged, field 6 -- # of writes merged
        Reads and writes which are adjacent to each other may be merged for
        efficiency.  Thus two 4K reads may become one 8K read before it is
        ultimately handed to the disk, and so it will be counted (and queued)
        as only one I/O.  This field lets you know how often this was done.
    Field  3 -- # of sectors read
        This is the total number of sectors read successfully.
    Field  4 -- # of milliseconds spent reading
        This is the total number of milliseconds spent by all reads (as
        measured from __make_request() to end_that_request_last()).
    Field  5 -- # of writes completed
        This is the total number of writes completed successfully.
    Field  7 -- # of sectors written
        This is the total number of sectors written successfully.
    Field  8 -- # of milliseconds spent writing
        This is the total number of milliseconds spent by all writes (as
        measured from __make_request() to end_that_request_last()).
    Field  9 -- # of I/Os currently in progress
        The only field that should go to zero. Incremented as requests are
        given to appropriate struct request_queue and decremented as they finish.
    Field 10 -- # of milliseconds spent doing I/Os
        This field increases so long as field 9 is nonzero.
    Field 11 -- weighted # of milliseconds spent doing I/Os
        This field is incremented at each I/O start, I/O completion, I/O
        merge, or read of these stats by the number of I/Os in progress
        (field 9) times the number of milliseconds spent doing I/O since the
        last update of this field.  This can provide an easy measure of both
        I/O completion time and the backlog that may be accumulating.
    

    For each process, you can get use /proc/<pid>/io, which produces something like this:

    rchar: 2012
    wchar: 0
    syscr: 7
    syscw: 0
    read_bytes: 0
    write_bytes: 0
    cancelled_write_bytes: 0
    
    • rchar, wchar: number of bytes read/written.
    • syscr, syscw: number of read/write system calls.
    • read_bytes, write_bytes: number of bytes read/written to storage media.
    • cancelled_write_bytes: from the best of my understanding, caused by calls to “ftruncate” that cancel pending writes to the same file. Probably most often 0.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Current requirement is on button click I am getting a json data through ajax
Requirement is like: I want to take input values from user in frame but
Requirement: I need to run multiple animations one by one. I'm using onAnimationEnd() to
My requirement is to use 2 tables and 1 chart to visualize my data
I'd like to statistically profile my C code at the instruction level. I need
I have a requirement to (very) quickly process strings of a limited range, tallying
I have the following requirement for creating a user profile in my application: User
I have a requirement to show how many visitors visit a profile in a
e have a requirement to show vertical profiles of Data related to an entity,
EDIT It appears the user has to enter some data for his profile, otherwise

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.