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)..
Created attachment 6661 [details] first draft for a patch
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.
commit 15cf950