relay channel question

Frank Ch. Eigler fche@redhat.com
Wed Aug 29 16:33:00 GMT 2007


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



More information about the Systemtap mailing list