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.
|