Reduction of guru use in systemtap war stories

William Cohen wcohen@redhat.com
Mon Jun 30 19:49:00 GMT 2008


Roland McGrath wrote:
>>> Several of the war stories (such as WSPfiles) include header files
>>> and make use of defines to extract bits/flags out of values. Seems
>>> like there should be a cleaner way to make those bit values
>>> available to scripts.
>> One possibility is to lobby the kernel to run gcc with -g3 or somesuch
>> to get it to dump macro definitions into the dwarf data; then we could
>> pull it out of there with $MACRO.  Sounds unlikely.
>>
>> Other ideas?
> 
> Could look into swig or perl's header-grovelling stuff or one of those
> sorts of things.  Before pondering this too specifically, I want to ask
> Will from his survey whether we are only concerned with constants, or also
> function-like macros that contain something other that simple arithmetic.
> 
> 
> Thanks,
> Roland

Hi Roland,

I don't have good statistics on the break down of simple constants expressions 
vs. actual code in the macros. Most of the uses appear to be just simple constants.

Running the kernel with -g3 to include macro information is going to make the 
debuginfo even larger. The debuginfo is already taking up too much space. On 
2.6.25.6-55.fc9.x86_64 the installed debuginfo rpms:

$ rpm -qa --queryformat '%{name} %{size}\n' |grep debuginfo|grep kernel
kernel-debuginfo 684495701
kernel-debuginfo-common 135176987


Thanks for the mention of swig and perl's header-grovelling stuff. I found some 
pointers to that material:

http://www.swig.org/

For perl's header-grovelling stuff talking about something like:

http://search.cpan.org/~rgarcia/perl-5.10.0/utils/h2xs.PL
http://search.cpan.org/~rgarcia/perl-5.10.0/utils/h2ph.PL
http://search.cpan.org/~icerider/C-Scan-Constants-1.017/lib/C/Scan/Constants.pm
http://search.cpan.org/~gbarr/Include-1.02a/Include.pm

-Will



More information about the Systemtap mailing list