From 471fca5e53a239f7fa4d04b7b6d6f53765a3d598 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Fri, 18 Dec 2009 17:56:24 +0100 Subject: Remove uprobes.h declaration from runtime.h Turns out that it breaks on kernels that don't have utrace. * runtime/runtime.h : Don't include uprobes.h * runtime/stack.c: Include uprobes.h * runtime/stack-i386.c: Check if uprobes is included at all. * runtime/stack-x86_64.c: ditto * tapsets.cxx (uprobe_derived_probe_group::emit_module_decls): put uprobes.h include back in. --- tapsets.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tapsets.cxx') diff --git a/tapsets.cxx b/tapsets.cxx index 5729757b..007aea6d 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -4576,6 +4576,16 @@ uprobe_derived_probe_group::emit_module_decls (systemtap_session& s) { if (probes.empty()) return; s.op->newline() << "/* ---- user probes ---- */"; + // If uprobes isn't in the kernel, pull it in from the runtime. + + s.op->newline() << "#if defined(CONFIG_UPROBES) || defined(CONFIG_UPROBES_MODULE)"; + s.op->newline() << "#include "; + s.op->newline() << "#else"; + s.op->newline() << "#include \"uprobes/uprobes.h\""; + s.op->newline() << "#endif"; + s.op->newline() << "#ifndef UPROBES_API_VERSION"; + s.op->newline() << "#define UPROBES_API_VERSION 1"; + s.op->newline() << "#endif"; // We'll probably need at least this many: unsigned minuprobes = probes.size(); -- cgit