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


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



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