pcp
[Top] [All Lists]

Re: linux pmda

To: <gilly@xxxxxxxxxx>
Subject: Re: linux pmda
From: Ken McDonell <kenmcd@xxxxxxxxxxxxxxxxx>
Date: Mon, 30 Jul 2001 09:36:29 +1000
Cc: <pcp@xxxxxxxxxxx>
Reply-to: <kenmcd@xxxxxxx>
Sender: owner-pcp@xxxxxxxxxxx
[this bounced off the list sever due to a very long attachment]

---------- Forwarded message ----------
From: "gilly" <gilly@xxxxxxxxxx>
To: <pcp@xxxxxxxxxxx>
Subject: linux pmda
Date: Thu, 26 Jul 2001 20:31:39 +0200

 Hi
1. There might be a bug in the linux pmda concerning the cpu utilization
statistics.
In the pmda.c file the calculations for kernel.all.cpu.* metrics are
calculated 'dangerously', the 'user' stat for example -
"atom->ul = 1000 * proc_stat.user / proc_stat.hz" - multiplying by 1000
might be bigger than u_int and the result is wrong.
attached a patch.

2. How can I add a new metric to the linux pmda?
I would like to add 'uptime' metric (under kernel.all) to show the time the
system is running.
I'm not sure how to add this metric to the linux pmda, it seems I can't use
the pmnsadd / pmnsmerge / pmnsdel utilities because 'root_linux' is not in a
fit format.
Am I supposed to build a new default PMNS?

thanks in advance,
gilly
----------

1. Does look like a bug and Mark Goodwin will investigate as time permits.
   The only good thing is that when the premature overflow does occur you
   get one bogus value, and there after the _rate_ of change is probably
   goinf to be correct, at least until the next premature overflow.

2. The sequence is something like this ...

        - choose a name for the new metric
        - define the semantics of the new metric
        - choose a PMID for the new metric
        - construct help text for the new metric

    now in the src/pmdas/linux directory
        - update root_linux to include the new metric's name and PMID
        - look in pmda.c
          + add the metric to metrictab[]
          + in linux_fetchCallBack() use the PMID and add code at the
            point where the PMID components are decoded to instantiate
            the value of the new metric
          + skip the instance domain stuff, this metric will be singular
        - add the help text to "help"

        - make install

    now in the /var/pcp/pmns directory, run
        # ./Rebuild -u

    and restart pmcd.


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