This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: relay channel question
- From: Martin Hunt <hunt at redhat dot com>
- To: dcnltc at us dot ibm dot com
- Cc: systemtap at sourceware dot org
- Date: Wed, 29 Aug 2007 11:30:49 -0400
- Subject: Re: relay channel question
- Organization: Red Hat Inc.
- References: <46D58930.1030503@us.ibm.com>
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