pcp
[Top] [All Lists]

Re: [pcp] proc pmda - incorrect units

To: chandana@xxxxxxxxxxxxx
Subject: Re: [pcp] proc pmda - incorrect units
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Tue, 11 Dec 2012 17:58:03 -0500 (EST)
Cc: pcp@xxxxxxxxxxx
In-reply-to: <50C7A5F5.6090706@xxxxxxxxxxxxx>
Reply-to: Nathan Scott <nathans@xxxxxxxxxx>
Hi,

----- Original Message -----
> $ pminfo -d -t proc.io.write_bytes
> 
> proc.io.write_bytes []
>      Data Type: 64-bit unsigned int  InDom: 3.9 0xc00009
>      Semantics: counter  Units: Kbyte
> 
> I think the Units should be byte ...

Yes, I think you're right.

In the kernel, fs/proc/base.c::do_io_accounting does the
heavy lifting.  That copies the task_io_accounting "ioac"
field (a struct) into a local and copies each counter in
there directly to the exported buffer with no conversion.

Going further up the chain, vfs_read does add_rchar(bytes),
for example, and there's nowhere on this path where any
conversion is done.

There's a bit of a red herring over in kernel/tsacct.c as
that code also access these fields, and converts everything
to kilobytes in xacct_add_tsk() - including the r/w syscall
counts strangely enough.  But that's in "System accounting"
code, and we don't use that in PCP.

How does the attached patch look?  The help text was correct
already.

cheers.

--
Nathan

Attachment: proc-iostats.patch
Description: Text Data

<Prev in Thread] Current Thread [Next in Thread>