Trying to get an embedded C function to use file I/O

Jeff Johnston jjohnstn@redhat.com
Mon Aug 19 16:38:00 GMT 2013


On 08/17/2013 07:48 PM, Frank Ch. Eigler wrote:
>
> jjohnstn wrote:
>
>> [...]
>> Is there some form of restriction on C stdio?
>
> There are several restrictions on embedded-C code; you ran into one
> associated with the default kernel-module based backend.
>
>> I want to use it because I ultimately need to create multiple files
>> from trace data and -o does not allow me to do this.
>
> Can you elaborate?  Until systemtap grows a good native ability, could
> you output into a pipe and let a userspace filter separate the items?
>
> - FChE
>

I am trying to use SystemTap to replace the LTTng lttng-modules package 
which requires building and installation of kernel modules.  The user of 
LTTng uses the lttng-tools package to run the lttng command to create a 
session trace, select events and channels, start a trace, stop a trace, 
and end a session.

The LTTng kernel side of the trace ends up with multiple CTF format 
files: a metadata file which describes the data format and a number of 
binary files (essentially a permutation of CPUs and channels (usually 
just channel 0).

I had thought to have the ability for someone to do this manually using 
a SystemTap script and providing key functions (e.g. 
ctf_output_metadata(), ctf_init_headers(), ctf_syscall_event()).

With the restriction, I guess the toolset could be rewritten (or a new 
toolset introduced) to use SystemTap under the covers and so a filter is 
certainly feasible.

-- Jeff J.



More information about the Systemtap mailing list