+2008-04-14 David Smith <dsmith@redhat.com>
+
+ * elaborate.h (struct derived_probe_group): Removed
+ emit_module_header virtual function.
+ * translate.cxx (c_unparser::emit_common_header): Removed calls to
+ emit_module_header function.
+ * tapsets.cxx (be_derived_probe>): Removed emit_module_header function.
+ (struct timer_derived_probe_group): Ditto.
+ (struct profile_derived_probe_group): Ditto.
+ (struct procfs_derived_probe_group): Ditto.
+ (struct hrtimer_derived_probe_group): Ditto.
+ (struct perfmon_derived_probe_group): Ditto.
+ (dwarf_derived_probe_group::emit_module_decls): Moved kernel check
+ back from deleted emit_module_header function.
+ (uprobe_derived_probe_group::emit_module_decls): Ditto.
+ (mark_derived_probe_group::join_group): Moved marker
+ kernel check (to a new embedded code section) from deleted
+ emit_module_header function.
+
2008-04-14 Frank Ch. Eigler <fche@elastic.org>
* Makefile.am (stapio_*): Become able to link/compile against
struct be_derived_probe_group: public generic_dpg<be_derived_probe>
{
public:
- void emit_module_header (systemtap_session& ) { };
void emit_module_decls (systemtap_session& s);
void emit_module_init (systemtap_session& s);
void emit_module_exit (systemtap_session& s);
public:
void enroll (dwarf_derived_probe* probe);
- void emit_module_header (systemtap_session& s);
void emit_module_decls (systemtap_session& s);
void emit_module_init (systemtap_session& s);
void emit_module_exit (systemtap_session& s);
void
-dwarf_derived_probe_group::emit_module_header (systemtap_session& s)
+dwarf_derived_probe_group::emit_module_decls (systemtap_session& s)
{
if (probes_by_module.empty()) return;
- // Warn of misconfigured kernels
+ s.op->newline() << "/* ---- dwarf probes ---- */";
+
+ // Warn of misconfigured kernels
s.op->newline() << "#if ! defined(CONFIG_KPROBES)";
s.op->newline() << "#error \"Need CONFIG_KPROBES!\"";
s.op->newline() << "#endif";
-}
-
-void
-dwarf_derived_probe_group::emit_module_decls (systemtap_session& s)
-{
- if (probes_by_module.empty()) return;
-
- s.op->newline() << "/* ---- dwarf probes ---- */";
+ s.op->newline();
// Forward declare the master entry functions
s.op->newline() << "static int enter_kprobe_probe (struct kprobe *inst,";
struct uprobe_derived_probe_group: public generic_dpg<uprobe_derived_probe>
{
public:
- void emit_module_header (systemtap_session& s);
void emit_module_decls (systemtap_session& s);
void emit_module_init (systemtap_session& s);
void emit_module_exit (systemtap_session& s);
void
-uprobe_derived_probe_group::emit_module_header (systemtap_session& s)
+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() << "#else";
s.op->newline() << "#include \"uprobes/uprobes.h\"";
s.op->newline() << "#endif";
-}
-
-
-void
-uprobe_derived_probe_group::emit_module_decls (systemtap_session& s)
-{
- if (probes.empty()) return;
- s.op->newline() << "/* ---- user probes ---- */";
s.op->newline() << "struct stap_uprobe {";
s.op->newline(1) << "union { struct uprobe up; struct uretprobe urp; };";
{
void emit_interval (translator_output* o);
public:
- void emit_module_header (systemtap_session& ) { };
void emit_module_decls (systemtap_session& s);
void emit_module_init (systemtap_session& s);
void emit_module_exit (systemtap_session& s);
struct profile_derived_probe_group: public generic_dpg<profile_derived_probe>
{
public:
- void emit_module_header (systemtap_session& ) { };
void emit_module_decls (systemtap_session& s);
void emit_module_init (systemtap_session& s);
void emit_module_exit (systemtap_session& s);
has_read_probes(false), has_write_probes(false) {}
void enroll (procfs_derived_probe* probe);
- void emit_module_header (systemtap_session& ) { };
void emit_module_decls (systemtap_session& s);
void emit_module_init (systemtap_session& s);
void emit_module_exit (systemtap_session& s);
struct mark_derived_probe_group: public generic_dpg<mark_derived_probe>
{
public:
- void emit_module_header (systemtap_session& s);
void emit_module_decls (systemtap_session& s);
void emit_module_init (systemtap_session& s);
void emit_module_exit (systemtap_session& s);
mark_derived_probe::join_group (systemtap_session& s)
{
if (! s.mark_derived_probes)
- s.mark_derived_probes = new mark_derived_probe_group ();
+ {
+ s.mark_derived_probes = new mark_derived_probe_group ();
+
+ // Make sure <linux/marker.h> is included early.
+ embeddedcode *ec = new embeddedcode;
+ ec->tok = NULL;
+ ec->code = string("#if ! defined(CONFIG_MARKERS)\n")
+ + string("#error \"Need CONFIG_MARKERS!\"\n")
+ + string("#endif\n")
+ + string("#include <linux/marker.h>\n");
+
+ s.embeds.push_back(ec);
+ }
s.mark_derived_probes->enroll (this);
}
}
-void
-mark_derived_probe_group::emit_module_header (systemtap_session& s)
-{
- if (probes.empty())
- return;
-
- // Warn of misconfigured kernels
- s.op->newline() << "#if ! defined(CONFIG_MARKERS)";
- s.op->newline() << "#error \"Need CONFIG_MARKERS!\"";
- s.op->newline() << "#endif";
- s.op->newline() << "#include <linux/marker.h>";
- s.op->newline();
-}
-
void
mark_derived_probe_group::emit_module_decls (systemtap_session& s)
{
{
void emit_interval (translator_output* o);
public:
- void emit_module_header (systemtap_session& ) { };
void emit_module_decls (systemtap_session& s);
void emit_module_init (systemtap_session& s);
void emit_module_exit (systemtap_session& s);
struct perfmon_derived_probe_group: public generic_dpg<perfmon_derived_probe>
{
public:
- void emit_module_header (systemtap_session& ) { };
void emit_module_decls (systemtap_session&) {}
void emit_module_init (systemtap_session&) {}
void emit_module_exit (systemtap_session&) {}