pcp
[Top] [All Lists]

Re: [pcp] odd side-benefit from dynamic pmns changes

To: Mark Goodwin <goodwinos@xxxxxxxxx>
Subject: Re: [pcp] odd side-benefit from dynamic pmns changes
From: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Wed, 05 Aug 2009 07:21:00 +1000
Cc: pcp@xxxxxxxxxxx
In-reply-to: <4A77B9E6.6000300@xxxxxxxxx>
References: <1249353942.6768.10.camel@bozo> <4A77B9E6.6000300@xxxxxxxxx>
Reply-to: kenj@xxxxxxxxxxxxxxxx
On Tue, 2009-08-04 at 14:32 +1000, Mark Goodwin wrote:
> Ken McDonell wrote:
> > The dynamic pmns stuff is quite a bit trickier than I originally
> > postulated (why, in retrospect, is that not a surprise?).
> 
> so how did the pmID pad field out in the end?

I'm currently using this definition of a pmid

/*
 * Internally, this is how to decode a PMID!
 * - flag is to denote state internally in some operations
 * - domain is usually the unique domain number of a PMDA, but DYNAMIC_PMID
 *   (number 511) is reserved for PMIDs representing the root of a
 *   dynamic subtree in the PMNS (and in this case the real domain number
 *   is encoded in the cluster field)
 * - cluster and item together uniquely identify a metric within a domain
 */
#define DYNAMIC_PMID    511
typedef struct {
#ifdef HAVE_BITFIELDS_LTOR
        unsigned int    flag : 1;
        unsigned int    domain : 9;
        unsigned int    cluster : 12;
        unsigned int    item : 10;
#else
        unsigned int    item : 10;
        unsigned int    cluster : 12;
        unsigned int    domain : 9;
        unsigned int    flag : 1;
#endif
} __pmID_int;

So pad has gone, flag is explicitly used as, er, a flag bit, and domain
is 9 bits long ... domain 511 (DYNAMIC_PMID) is special and reserved.

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