[pcp] Few doc issues

Marko Myllynen myllynen at redhat.com
Tue Nov 24 08:53:45 CST 2015


Hi,

On 2015-11-23 11:50, Marko Myllynen wrote:
> 
> 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)?

one more thing that came up is that PCPIntro(1) does not explicitly
mention when PMCD_REQUEST_TIMEOUT et al should be set. Granted, most
will rightly assume that they should be set before pmNewContext() but I
think it'd be nice to spell this out to remove any doubts.

Thanks,

-- 
Marko Myllynen



More information about the pcp mailing list