* counters
@ 2002-05-16 14:14 Manik Raina
2002-05-17 5:55 ` counters Frank Schaefer
2002-05-17 14:52 ` counters Jerry Cooperstein
0 siblings, 2 replies; 7+ messages in thread
From: Manik Raina @ 2002-05-16 14:14 UTC (permalink / raw)
To: linux-kernel
anyone knows if there are counters in the linux kernel
which can be read via /proc like mechanism for the
following :
1. total number of bytes read by process by syscalls
like read()
2. total number of bytes written by each process by
syscalls like write()
thanks
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: counters
2002-05-16 14:14 counters Manik Raina
@ 2002-05-17 5:55 ` Frank Schaefer
2002-05-17 9:08 ` counters Manik Raina
2002-05-17 14:52 ` counters Jerry Cooperstein
1 sibling, 1 reply; 7+ messages in thread
From: Frank Schaefer @ 2002-05-17 5:55 UTC (permalink / raw)
To: linux-kernel
On Thu, 2002-05-16 at 16:14, Manik Raina wrote:
> anyone knows if there are counters in the linux kernel
> which can be read via /proc like mechanism for the
> following :
>
> 1. total number of bytes read by process by syscalls
> like read()
>
> 2. total number of bytes written by each process by
> syscalls like write()
Hi,
as far as I know there's not a ready to use counter in the procfs.
BTW: What do you want to count? Do You mean timers?
It shouldn't be a problem, to write a little driver, which could make
this available.
Regards
Frank
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: counters
2002-05-17 5:55 ` counters Frank Schaefer
@ 2002-05-17 9:08 ` Manik Raina
2002-05-17 10:47 ` counters Frank Schaefer
0 siblings, 1 reply; 7+ messages in thread
From: Manik Raina @ 2002-05-17 9:08 UTC (permalink / raw)
To: Frank Schaefer; +Cc: linux-kernel
Thanks for your response. What i meant was
every process could have an account of how
many bytes were read/written to various
filesystems/sockets using read()/write()
system calls.
We could dump this stuff in /proc and
it could tell us which processes are
heavily IO bound.
I am wondering if this information will
be useful to anyone.
Frank Schaefer wrote:
>
> On Thu, 2002-05-16 at 16:14, Manik Raina wrote:
> > anyone knows if there are counters in the linux kernel
> > which can be read via /proc like mechanism for the
> > following :
> >
> > 1. total number of bytes read by process by syscalls
> > like read()
> >
> > 2. total number of bytes written by each process by
> > syscalls like write()
>
> Hi,
>
> as far as I know there's not a ready to use counter in the procfs.
>
> BTW: What do you want to count? Do You mean timers?
>
> It shouldn't be a problem, to write a little driver, which could make
> this available.
>
> Regards
> Frank
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: counters
2002-05-17 9:08 ` counters Manik Raina
@ 2002-05-17 10:47 ` Frank Schaefer
2002-05-17 14:27 ` counters Manik Raina
0 siblings, 1 reply; 7+ messages in thread
From: Frank Schaefer @ 2002-05-17 10:47 UTC (permalink / raw)
To: linux-kernel
On Fri, 2002-05-17 at 11:08, Manik Raina wrote:
>
> Thanks for your response. What i meant was
> every process could have an account of how
> many bytes were read/written to various
> filesystems/sockets using read()/write()
> system calls.
>
> We could dump this stuff in /proc and
> it could tell us which processes are
> heavily IO bound.
>
> I am wondering if this information will
> be useful to anyone.
Hi Manik
and sorry that I read only half of your initial post.
I had a quick look at fs/read_write.c.
I don't see any hook in the functions here, to perform such a task. And
here this should belong to -- shouldn't it?
the functions could add ``count'' to the procfs entry of ``current''.
(just a thought) This info could be valuable - I think - if it wouldn't
make a large performance issue.
Regards
Frank
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: counters
2002-05-17 10:47 ` counters Frank Schaefer
@ 2002-05-17 14:27 ` Manik Raina
0 siblings, 0 replies; 7+ messages in thread
From: Manik Raina @ 2002-05-17 14:27 UTC (permalink / raw)
To: Frank Schaefer; +Cc: linux-kernel
Frank Schaefer wrote:
> Hi Manik
>
> and sorry that I read only half of your initial post.
> I had a quick look at fs/read_write.c.
>
> I don't see any hook in the functions here, to perform such a task. And
> here this should belong to -- shouldn't it?
quite right. I am wondering if any locking is required for updating
some counters which one may add in task_struct or if adding counters
in task_struct is acceptable at all.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: counters
2002-05-16 14:14 counters Manik Raina
2002-05-17 5:55 ` counters Frank Schaefer
@ 2002-05-17 14:52 ` Jerry Cooperstein
2002-05-20 5:22 ` counters Frank Schaefer
1 sibling, 1 reply; 7+ messages in thread
From: Jerry Cooperstein @ 2002-05-17 14:52 UTC (permalink / raw)
To: Manik Raina; +Cc: linux-kernel
This is doable (some other OS's do it) but:
1) It requires some changes to the basic read/write call to gather
the statistics. It also requires stashing the counters somewhere
such as in the task_struct and thus requires modifying it.
2) It doesn't directly tell you about I/O statistics themselves
(which are available under /proc/stat) because the I/O request
may be gotten from cache, or may never be flushed from cache
to disk depending on subsequent events, so it will always
tend to overestimate the amount of real I/O done on the device.
Jerry Cooperstein <coop@axian.com>
Axian, Inc. Software Consulting and Training
4800 SW Griffith Dr., Ste. 202, Beaverton, OR 97005 USA
http://www.axian.com/
On Thu, May 16, 2002 at 07:44:35PM +0530, Manik Raina wrote:
> anyone knows if there are counters in the linux kernel
> which can be read via /proc like mechanism for the
> following :
>
> 1. total number of bytes read by process by syscalls
> like read()
>
> 2. total number of bytes written by each process by
> syscalls like write()
>
> thanks
> -
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: counters
2002-05-17 14:52 ` counters Jerry Cooperstein
@ 2002-05-20 5:22 ` Frank Schaefer
0 siblings, 0 replies; 7+ messages in thread
From: Frank Schaefer @ 2002-05-20 5:22 UTC (permalink / raw)
To: linux-kernel
that's right, but it would give one a picture how much a process --let's
say-- requests I/O.
Regards
Frank
On Fri, 2002-05-17 at 16:52, Jerry Cooperstein wrote:
> This is doable (some other OS's do it) but:
>
> 1) It requires some changes to the basic read/write call to gather
> the statistics. It also requires stashing the counters somewhere
> such as in the task_struct and thus requires modifying it.
>
> 2) It doesn't directly tell you about I/O statistics themselves
> (which are available under /proc/stat) because the I/O request
> may be gotten from cache, or may never be flushed from cache
> to disk depending on subsequent events, so it will always
> tend to overestimate the amount of real I/O done on the device.
>
> Jerry Cooperstein <coop@axian.com>
> Axian, Inc. Software Consulting and Training
> 4800 SW Griffith Dr., Ste. 202, Beaverton, OR 97005 USA
> http://www.axian.com/
>
>
> On Thu, May 16, 2002 at 07:44:35PM +0530, Manik Raina wrote:
> > anyone knows if there are counters in the linux kernel
> > which can be read via /proc like mechanism for the
> > following :
> >
> > 1. total number of bytes read by process by syscalls
> > like read()
> >
> > 2. total number of bytes written by each process by
> > syscalls like write()
> >
> > thanks
> > -
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2002-05-20 5:22 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-16 14:14 counters Manik Raina
2002-05-17 5:55 ` counters Frank Schaefer
2002-05-17 9:08 ` counters Manik Raina
2002-05-17 10:47 ` counters Frank Schaefer
2002-05-17 14:27 ` counters Manik Raina
2002-05-17 14:52 ` counters Jerry Cooperstein
2002-05-20 5:22 ` counters Frank Schaefer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox