]> sourceware.org Git - systemtap.git/commitdiff
2008-04-14 David Smith <dsmith@redhat.com>
authorDavid Smith <dsmith@redhat.com>
Mon, 14 Apr 2008 17:22:53 +0000 (12:22 -0500)
committerDavid Smith <dsmith@redhat.com>
Mon, 14 Apr 2008 17:22:53 +0000 (12:22 -0500)
* 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.

ChangeLog
elaborate.h
tapsets.cxx
translate.cxx

index f0ca0a67bf0908d51f6de6e6382e4d18abb2ff1d..a9c2293064a6215c87f41d6cf688f46f32c621b5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+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
index f53f38703f56831f8c1046dc0ec994e300303d49..30bf5bce6ab30f6d0c1b5c510ba341330d2c0ca1 100644 (file)
@@ -150,12 +150,6 @@ struct derived_probe_group
 {
   virtual ~derived_probe_group () {}
 
-  virtual void emit_module_header (systemtap_session& s) = 0;
-  // The _header-generated code may assume that only basic includes
-  // have been generated.  _header is called near the start of the
-  // code generation process, before the context, embedded-C code,
-  // etc. are generated.
-
   virtual void emit_module_decls (systemtap_session& s) = 0;
   // The _decls-generated code may assume that declarations such as
   // the context, embedded-C code, function and probe handler bodies
index a7f8034e733144daaae74e95ee9fcf1c831e8f1d..7d377d402a14c54dd5e4a45139ae8f2e14f6c373 100644 (file)
@@ -104,7 +104,6 @@ struct be_derived_probe: public derived_probe
 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);
@@ -2069,7 +2068,6 @@ private:
 
 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);
@@ -3929,22 +3927,17 @@ dwarf_derived_probe_group::enroll (dwarf_derived_probe* p)
 
 
 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,";
@@ -4271,7 +4264,6 @@ struct uprobe_derived_probe: public derived_probe
 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);
@@ -4321,9 +4313,10 @@ struct uprobe_builder: public derived_probe_builder
 
 
 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)";
@@ -4331,14 +4324,6 @@ uprobe_derived_probe_group::emit_module_header (systemtap_session& s)
   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; };";
@@ -4457,7 +4442,6 @@ struct timer_derived_probe_group: public generic_dpg<timer_derived_probe>
 {
   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);
@@ -4599,7 +4583,6 @@ struct profile_derived_probe: public derived_probe
 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);
@@ -4767,7 +4750,6 @@ public:
     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);
@@ -5243,7 +5225,6 @@ struct mark_derived_probe: public derived_probe
 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);
@@ -5610,7 +5591,19 @@ void
 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);
 }
 
@@ -5681,20 +5674,6 @@ mark_derived_probe::initialize_probe_context_vars (translator_output* o)
 }
 
 
-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)
 {
@@ -5958,7 +5937,6 @@ struct hrtimer_derived_probe_group: public generic_dpg<hrtimer_derived_probe>
 {
   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);
@@ -6314,7 +6292,6 @@ public:
 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&) {}
index 776e67700007ff5569df14ea1ab866ca318e8c2d..1b812ec12bbac789e80a8be77c2d37bdb1b113e8 100644 (file)
@@ -849,10 +849,6 @@ translator_output::line ()
 void
 c_unparser::emit_common_header ()
 {
-  vector<derived_probe_group*> g = all_session_groups (*session);
-  for (unsigned i=0; i<g.size(); i++)
-    g[i]->emit_module_header (*session);
-  
   o->newline();
   o->newline() << "typedef char string_t[MAXSTRINGLEN];";
   o->newline();
This page took 0.048807 seconds and 5 git commands to generate.