pre-compiled modules

David Smith dsmith@redhat.com
Tue Jun 27 19:47:00 GMT 2006


See stuff below.

On Mon, 2006-06-19 at 12:40 -0400, Frank Ch. Eigler wrote:
> Hi -
> 
> dsmith wrote:
> 
> > I've been looking at pre-compiled modules, and in general they should
> > work.  I do have a few questions:
> > 

... stuff deleted ...


> Blatant modversions mismatches will be detected during the actual
> insertion attempt - IMO there is no need to make a dry run first.  We
> will need more self-protective code though for purposes of verifying
> module addresses.  Specifically, we need to find a kernel API routine
> that, given a module name, gives its loaded base address.

Hmm, I hadn't considered that.  Will this code go in the module itself
or go in the runtime?


To help move this along a bit, I've attached a patch that modifies the
systemtap front end to take 2 new options:

   -S         Save the compiled module in the current directory
   -P PRE_COMPILED_MODULE
              Run pre-compiled module

Note that the patch was generated with diff ignoring whitespace changes,
since a large part of main.cxx was re-indented so that passes 1-4 will
get skipped when '-P' is specified.

Here's how it works.  The '-S' option isn't strictly necessary since you
can accomplish the same thing with '-k' then a manual copy, but it is
nice.  To save a module, you do the following:

  # stap -S foo.stp 
  ... output from running stap_27691.ko ...
  Module saved as stap_27691.ko

It makes more sense to name the module something reasonable (and to not
run the module, just compile it).  So, you would do the following:

  # stap -m foo -p4 -S foo.stp
  Module saved as foo.ko

Now that you've got a module, you can run it like this:

  # stap -P foo.ko
  ... output from foo.ko ...

Comments on the option names and code itself appreciated.

-- 
David Smith
dsmith@redhat.com
Red Hat, Inc.
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pre_compiled.patch
Type: text/x-patch
Size: 10676 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/systemtap/attachments/20060627/30d819cc/attachment.bin>


More information about the Systemtap mailing list