relay channel question
Martin Hunt
hunt@redhat.com
Wed Aug 29 15:39:00 GMT 2007
On Wed, 2007-08-29 at 07:56 -0700, Dave Nomura wrote:
> I am trying to write binary output to the relay channel and am wondering
> how to write a 32-bit integer?
We really need to document all the print functions.
Take a look at src/testsuite/systemtap.printf/bin*.stp
bin4.stp is for 32-bit tests.
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;
%}
> How does systemtap separate the relay channel output on a per-cpu
> basis? Does it just use the currently active CPU that is making the
> write request and put its output in the relay buffer for that CPU?
Yes, in bulk mode. In stream mode there is only one channel.
> Is there any way to write to a CPU specific relay buffer?
In bulk mode, no. That would require locking and slow down relayfs a
bit. This is what stream mode does.
> I think I will need this to write header information for each CPU but there would only
> be one active CPU that is doing all of these writes.
So just use normal (stream) mode and print the cpu and maybe timestamp.
Martin
More information about the Systemtap
mailing list