From 15cf950379c4d73e06166639afcd15264fefdc33 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Tue, 9 Oct 2012 14:44:26 -0400 Subject: [PATCH] PR14655: more politely fail if kallsyms_lookup_name unexported * buildrun.cxx (compile_pass): Look for said export. * runtime/sym.c: Provide a _stp_error()-laden backup. --- buildrun.cxx | 1 + runtime/sym.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/buildrun.cxx b/buildrun.cxx index 2bb0b9630..6108c0f5f 100644 --- a/buildrun.cxx +++ b/buildrun.cxx @@ -376,6 +376,7 @@ compile_pass (systemtap_session& s) output_exportconf(s, o, "task_work_add", "STAPCONF_TASK_WORK_ADD_EXPORTED"); output_autoconf(s, o, "autoconf-pagefault_disable.c", "STAPCONF_PAGEFAULT_DISABLE", NULL); + output_exportconf(s, o, "kallsyms_lookup_name", "STAPCONF_KALLSYMS"); o << module_cflags << " += -include $(STAPCONF_HEADER)" << endl; diff --git a/runtime/sym.c b/runtime/sym.c index 4fce3b7f1..0c9ec9303 100644 --- a/runtime/sym.c +++ b/runtime/sym.c @@ -644,5 +644,14 @@ static void _stp_kmodule_update_address(const char* module, } +#ifndef STAPCONF_KALLSYMS +unsigned long kallsyms_lookup_name (const char *name) +{ + _stp_error ("kallsyms_lookup_name unavailable for %s\n", name); + return 0; +} +#endif + + #endif /* _STP_SYM_C_ */ -- 2.43.5