This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: relay channel question


hunt wrote:

> [...]
> By default, values are written in native byte order.  You can change
> that. set_endian is defined in logging.stp and looks like this:
> # set the default endianess for binary printf
> # val:   0 - native (default)
> #        1 - little endian
> #        2 - big endian
> function set_endian:long (val:long) %{
>         _stp_endian = THIS->val;
> %}
> [...]

This seems to be a poor interface.  Apart from being hidden state
(e.g. not visible in the context of a printf) the numeric codes are
unhelpful.  If you must stick with this hidden state method, please
provide separately named functions like print_endian_big(), _little(),
_native ().

Considering that it is hidden state, and that tapsets and scripts can
thus fight over the value without knowing it, it may be a good idea to
permit this setting to be changed only once, and warn/error on
subsequent attempts.

- FChE


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]