pcp
[Top] [All Lists]

Re: [pcp] Few doc issues

To: pcp@xxxxxxxxxxx
Subject: Re: [pcp] Few doc issues
From: Marko Myllynen <myllynen@xxxxxxxxxx>
Date: Tue, 24 Nov 2015 16:53:45 +0200
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <5652E148.1090806@xxxxxxxxxx>
Organization: Red Hat
References: <5652E148.1090806@xxxxxxxxxx>
Reply-to: myllynen@xxxxxxxxxx
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
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

<Prev in Thread] Current Thread [Next in Thread>
  • Few doc issues, Marko Myllynen
    • Re: [pcp] Few doc issues, Marko Myllynen <=