[pcp] Few doc issues

Marko Myllynen myllynen at redhat.com
Mon Nov 23 03:50:00 CST 2015


Hi,

I see -O described in PCPIntro(1) as expected but pmprobe(1) and
pminfo(1) also discuss an -O related timezone issue which is not
described in PCPIntro(1), pmval(1), or pmdumptext(1). If the issue is a
general one, could the discussion perhaps moved to PCPIntro(1)? (While
at it, perhaps it could also be clarified a bit, I had to read it twice
to get a hang of it.)

Also, in few clients I see this kind of code used in preparation for a
pmSetMode(1) call:

#define SECS_IN_24_DAYS 2073600.0

static int
getXTBintervalFromTimeval(int *mode, struct timeval *tval)
{
    double tmp_ival = __pmtimevalToReal(tval);

    if (tmp_ival > SECS_IN_24_DAYS) {
        *mode = (*mode & 0x0000ffff) | PM_XTB_SET(PM_TIME_SEC);
        return ((int)tmp_ival);
    }
    else {
        *mode = (*mode & 0x0000ffff) | PM_XTB_SET(PM_TIME_MSEC);
        return ((int)(tmp_ival * 1000.0));
    }
}

I don't think merely by reading the current pmSetMode(1) a client
developer could instantly see something like this would be needed. As
per the best cargo-cult practices I already started to use something
similar in pmrep but might still be nice to have few words about this in
pmSetMode(1)?

Thanks,

-- 
Marko Myllynen



More information about the pcp mailing list