Well, it seems right. I am not sure if its all the io disk calls though.
The code is not easy to read but it seems this is the same data
that /proc/stat -> page line uses thru kstat.pgpgout.
I am looking at what seems to be the point where this happens,
at the file drivers/block/ll_rw_blk.c at function -
void submit_bh(int rw, struct buffer_head * bh) .
Is there a way to pull this data out without recompiling the kernel?
If not, I believe the proper way of getting out the data is to put it in
proc in something like - /proc/<pid>/statio
How do I do that? just create a regular file or is it something
else?
Ultimately I will need to read it with my c program.

here is some output of the dmesg, the blocks seems to be after the "/"
and I will need to sum them up for each process. although, it uses the
name
instead of PIDs so I'll need to figure out also where are the PIDs,
I am guessing current->pid. also, by my understanding the dirtied buffer
relate to memory and swap file? and not directly to files? 
should I count what kupdated says somehow?:
kupdated: dirtied buffer
kupdated: dirtied buffer
ls: READ block 1180176/2 on 03:05
kupdated: READ block 1179664/2 on 03:05
kupdated: dirtied buffer
kupdated: dirtied buffer
bash: READ block 857700/2 on 03:05
bash: READ block 857702/2 on 03:05
bash: READ block 857704/2 on 03:05
bash: READ block 857706/2 on 03:05
time: READ block 857708/2 on 03:05
time: READ block 857710/2 on 03:05
time: READ block 857712/2 on 03:05
time: READ block 857714/2 on 03:05
time: READ block 857716/2 on 03:05
time: READ block 857718/2 on 03:05
time: READ block 857720/2 on 03:05
time: READ block 857722/2 on 03:05
kupdated: dirtied buffer
kupdated: dirtied buffer
kupdated: dirtied buffer
kupdated: dirtied buffer
kupdated: dirtied buffer
kupdated: dirtied buffer
kupdated: dirtied buffer
kupdated: dirtied buffer
kupdated: READ block 475474/2 on 03:05
kupdated: dirtied buffer
kupdated: WRITE block 180266/2 on 03:05
kupdated: WRITE block 245778/2 on 03:05
kupdated: WRITE block 32908/2 on 03:05

10x.

Regards,
        tzahi.

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Muli Ben-Yehuda
> Sent: Tuesday, January 11, 2005 10:19 AM
> To: Tzahi Fadida
> Cc: [email protected]
> Subject: Re: Getting io statistics on processes.
> 
> 
> On Tue, Jan 11, 2005 at 10:10:41AM +0200, Tzahi Fadida wrote:
> 
> > > > I am looking for a utility that does that and especially a c 
> > > > library since I am in control of that process internal 
> > > > programming.
> > > 
> > > This is information that has to be exported from the kernel.
> > > I think tha laptop mode patches (merged in 2.6) include at 
> > > least some of this, and can probably be extended to give you 
> > > the rest.
> > 
> > what do they give now?
> 
> See Documenation/laptop-mode.txt: 
> 
> "If you want to find out which process caused the disk to 
> spin up, you can gather information by setting the flag 
> /proc/sys/vm/block_dump. When this flag is set, Linux reports 
> all disk read and write operations that take place, and all 
> block dirtyings done to files. This makes it possible to 
> debug why a disk needs to spin up, and to increase battery 
> life even more. The output of block_dump is written to the 
> kernel output, and it can be retrieved using "dmesg". When 
> you use block_dump and your kernel logging level also 
> includes kernel debugging messages, you probably want to turn 
> off klogd, otherwise the output of block_dump will be logged, 
> causing disk activity that is not normally there."
> 
> Cheers, 
> Muli
> -- 
> Muli Ben-Yehuda
> http://www.mulix.org | http://mulix.livejournal.com/
> 
> 



=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to