pcp
[Top] [All Lists]

RE: [pcp] pmRegisterDerived return values

To: "'Nathan Scott'" <nathans@xxxxxxxxxx>, "'Marko Myllynen'" <myllynen@xxxxxxxxxx>
Subject: RE: [pcp] pmRegisterDerived return values
From: "Ken McDonell" <kenj@xxxxxxxxxxxxxxxx>
Date: Thu, 21 Jan 2016 11:45:23 +1100
Cc: "'pcp developers'" <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <1305297915.11201184.1453261568406.JavaMail.zimbra@xxxxxxxxxx>
References: <569CB025.4070603@xxxxxxxxxx> <569CB7C5.7030803@xxxxxxxxxxxxxxxx> <1305297915.11201184.1453261568406.JavaMail.zimbra@xxxxxxxxxx>
Thread-index: AQIHi+15HIXLtpebrkfAOJtsaFEj0AIkYFWzAnUHQ96ec+Vf4A==

> -----Original Message-----
> From: Nathan Scott [mailto:nathans@xxxxxxxxxx]
> Sent: Wednesday, 20 January 2016 2:46 PM
> To: Marko Myllynen <myllynen@xxxxxxxxxx>; Ken McDonell
> <kenj@xxxxxxxxxxxxxxxx>
> Cc: pcp developers <pcp@xxxxxxxxxxx>
> Subject: Re: [pcp] pmRegisterDerived return values
> 
> ...
> Another way would be to add a libpcp interface allowing a buffer to be
> passed to a new pmRegisterDerived variant, which could do away with
> the thread-local storage use and just put the message into the callers
> buffer.
> ...
> 
> Thoughts?  Preferences?  Does the derived metrics code lend itself to
> one of these approached over others, Ken?  Thanks.  From the python
> wrappers point of view, a new pmRegisterDerived variant would be the
> cleanest, along the lines:
> 
>     int pmRegisterDerivedMetric(char *name, char *expr, char
> **errmsg);

So, if this becomes a new function pmRegisterDerivedMetric_r(...) ... then the 
implementation changes are a bit messy ... the error buffer is currently used 
at a heap of places that will require errmsg to be passed down as an additional 
parameter along all the call paths.  Ugly yes, impossible no.

In my Neanderthal cave I am accumulating a fat file of notes entitled "Why 
Python is not a real programming language" .. if we have to make this change 
I'll be able to add a new note to the pile.

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