Bug 14655 - kallsyms_lookup_name is not exported by kernel versions prior to 2.6.33
Summary: kallsyms_lookup_name is not exported by kernel versions prior to 2.6.33
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: releng (show other bugs)
Version: unspecified
: P2 minor
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-02 08:26 UTC by Alex Lochmann
Modified: 2012-10-09 18:45 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
first draft for a patch (1.26 KB, patch)
2012-10-02 09:10 UTC, Alex Lochmann
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Lochmann 2012-10-02 08:26:16 UTC
The current systemtap release uses "kallsyms_lookup_name" which is exported by the kernel since version 2.6.33.
If a version prior to this one is used, the compilation of a script just places a warning "WARNING: "kallsyms_lookup_name" [/tmp/stapu1Ne9G/alexv8.ko] undefined!".
Loading the modules will fail because of an undefined symbol.
I used the linux kernel 2.6.29 (android qemu)..
Comment 1 Alex Lochmann 2012-10-02 09:10:11 UTC
Created attachment 6661 [details]
first draft for a patch
Comment 2 David Smith 2012-10-03 21:22:00 UTC
I've taken a look at your patch.  I know this is a first draft, but it misses use of kallsyms_lookup_name() in runtime/stp_task_work.c and runtime/transport/transport.c.

In general, kernel version checks don't work well.  Systemtap tries to work with so many kernels, which may or may not have a feature enabled, backported, etc. to it.

Here's a possible different approach. Instead of a kernel version check, do an output_exportconf() test to see if kallsyms_lookup_name is exported (in buildrun.cxx).  If not, define STAPCONF_KALLSYMS_LOOKUP_NAME_UNEXPORTED (or some better name).  If that is defined, define a dummy kallsyms_lookup_name() function in the runtime that either warns or errors and always returns NULL.
Comment 3 Frank Ch. Eigler 2012-10-09 18:45:51 UTC
commit 15cf950