pcp
[Top] [All Lists]

Re: [pcp] pmLookupName sts differences

To: pcp <pcp@xxxxxxxxxxx>
Subject: Re: [pcp] pmLookupName sts differences
From: Martins Innus <minnus@xxxxxxxxxxx>
Date: Thu, 02 Apr 2015 14:54:35 -0400
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <551D8119.5010404@xxxxxxxxxxx>
References: <551D8119.5010404@xxxxxxxxxxx>
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0
What appears to be happening is that in DoPMNSNames of pmcd/src/dopdus.c that it is required that all PMDA_INTERFACE_4 metrics must be valid, else an error is generated. 

That doesn't seem to be enforced for static lookups in that same function. sts is just set to the number found.

Also not  for PMNS_LOCAL lookups for  PMDA_INTERFACE_4 metrics in pmLookupName directly. "lsts" is ignored if the lookup fails.

So would the appropriate thing be do ignore PM_ERR_NAME  errors, increment sts on success, and propagate the number of names converted back to the caller through sts?

Sorry for the convoluted descriptions, just trying to work my way through this code.

Thanks

Martins

On 4/2/2015 1:49 PM, Martins Innus wrote:
Hi,
    Please see the attached code for an example of differences in return value for pmLookupName when a metric is not found depending on whether the top level namespace is handled by a dynamic pmda. For a regular metric (non dynamic)  if we give it a bogus metric name, the function returns fine, the appropriate pmID is set to NULL and "sts" reflects the valid number of names converted, as expected.

    For a metric that would be rooted at a dynamic tree, it seems the lookups all happen properly, NULL is set for the bogus metric properly, but "sts" returns PM_ERR_NAME.

    I think it is somewhere in the pmns<->pdu interaction that the status is being propagated all the way back for dynamic metrics but not normal ones.  I'm not familiar enough with this code to figure out the right way to fix it.

Thanks for any insight.

Martins


_______________________________________________
pcp mailing list
pcp@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/pcp

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