need to count "real" disk accesses

need to count "real" disk accesses

Post by FabC » Thu, 18 Feb 1999 04:00:00



Hi everybody,
    I need to count disk accesses in my program to have a reference for
code performance. I think that to count read()/write() (of <stdio.h>)is
not a good idea bacause of system's bufferization. I think that I have
to put a counter in the Linux read/write, that is to put a counter in
Linux kernel. I try to understand kernel sources but It's not simple .
Where I can put these counters ?
Thanks.......

FAB

 
 
 

need to count "real" disk accesses

Post by Felix Rau » Thu, 18 Feb 1999 04:00:00



>     I need to count disk accesses in my program to have a reference for
> code performance. I think that to count read()/write() (of <stdio.h>)is
> not a good idea bacause of system's bufferization. I think that I have
> to put a counter in the Linux read/write, that is to put a counter in
> Linux kernel. I try to understand kernel sources but It's not simple .
> Where I can put these counters ?

What about an alternative: You could probably use /proc/stat or the
program vmstat? It probably depends on how accurate your measurements
should be.

- Felix
--

Homepage: http://nice.ethz.ch/~felix/ (includes PGP public key)


 
 
 

1. Since when UNIX is the "real" system that runs the "real" machines?

*CROSS POSTED TO comp.unix.solaris  


Yes, Unix was created by people who know CS and programming concepts.
Don't you think an OS created by such people will be better than a knock-off
of the MAC OS, that when you look under the hood is a beastly mutation
of a 16-bit CP/M derivative? Smell the coffee, man.

Also, MAC OS itself has BSD Unix purring under its hood. Apple, the people
who make the most user-friendly OS around, recognize the power of Unix.

Unix is the foundation for technical computing and networking that made
the internet, pro/e, nastran, and scores of other codes possible.

Unix scales from desktop PC's through to supercomputers, and your code
compiles and runs on these platforms. No problems, as long as the code
was written properly.

The people that choose to stay with Windows are the eunuchs, cause they
don't want to learn an operating system that enables the civilized world
to do all the things that enable people to get things done.

vi is a text editor, not a word processor. But vi is used for basic
text editing, right through to preparing text for typesetting. vi is
a small program that is spectacularly efficient... if you spend the time
to learn its command set. You can find, change, and manipulate text more
powerfully than any comparable Windows-based editor. Any editor that runs
on Windows that even competes is usually a port of an editor such as emacs
which itself came from Unix.

I'm tiring of this nonsense too...

Don't blame Unix for PRO/E's design/usability flaws.

S.
--

From the desk of Sanjay,                        |\      _,,,---,,_  
                 Shadow,                  PRrrr /,`.-'`'    -.  ;-;;,_
                 & Niji                        |,4-  ) )-,_. ,\ (  `'-'

2. 3c509B [isa] configuration

3. GETSERVBYNAME()????????????????????"""""""""""""

4. Parallel Processing?

5. E250 internal disks: "Sun" disk vs "generic" Seagate disk

6. Anybody know which apps need to be recompiled...

7. """"""""My SoundBlast 16 pnp isn't up yet""""""""""""

8. Need advice on re-installing Linux.

9. ??: TCP/IP High "colls" and "errs" Counts???

10. "talking" to a "real" phone via a modem?

11. Difference between "real" and "InfoMagic" RedHats ??

12. Having "real" and "private" IPs work together on one hub

13. Type "(", ")" and "{", "}" in X...