pcp
[Top] [All Lists]

Re: [pcp] proc pmda - incorrect units

To: Nathan Scott <nathans@xxxxxxxxxx>
Subject: Re: [pcp] proc pmda - incorrect units
From: Chandana De Silva <chandana@xxxxxxxxxxxxx>
Date: Wed, 12 Dec 2012 10:12:32 +1100
Cc: pcp@xxxxxxxxxxx
In-reply-to: <437685871.47599423.1355266683632.JavaMail.root@xxxxxxxxxx>
References: <437685871.47599423.1355266683632.JavaMail.root@xxxxxxxxxx>
Reply-to: chandana@xxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1
I will apply this to/morrow night and see ....

On 12/12/12 09:58, Nathan Scott wrote:
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

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