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