]> sourceware.org Git - systemtap.git/commitdiff
2007-09-25 David Smith <dsmith@redhat.com>
authordsmith <dsmith>
Tue, 25 Sep 2007 15:34:42 +0000 (15:34 +0000)
committerdsmith <dsmith>
Tue, 25 Sep 2007 15:34:42 +0000 (15:34 +0000)
* tapsets.cxx (mark_query::handle_query_module): Updated for
9/18/2007 markers patch.
(mark_derived_probe::parse_probe_sig): Ditto.
(mark_derived_probe_group::emit_module_decls): Ditto.
(mark_derived_probe_group::emit_module_init): Ditto.
(mark_derived_probe_group::emit_module_exit): Ditto.

ChangeLog
tapsets.cxx

index b14023cfdbf1fda019d66e5c182d1441d0da96ad..2d80c69bd5c2ab8da2f61604fce79d40d4380659 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-09-25  David Smith  <dsmith@redhat.com>
+
+       * tapsets.cxx (mark_query::handle_query_module): Updated for
+       9/18/2007 markers patch.
+       (mark_derived_probe::parse_probe_sig): Ditto.
+       (mark_derived_probe_group::emit_module_decls): Ditto.
+       (mark_derived_probe_group::emit_module_init): Ditto.
+       (mark_derived_probe_group::emit_module_exit): Ditto.
+
 2007-09-24  Masami Hiramatsu <mhiramat@redhat.com>
 
        PR 3916
index 01d12692b0878cb687d9f40a3e11a3a9ee22a83e..72dff3e537ea1fad02c22c87383ae9ff382b94fc 100644 (file)
@@ -5014,15 +5014,52 @@ mark_query::handle_query_module()
   vector<markers_data *> markers;
   while (offset < data->d_size)
     {
+      // Grab the marker name
       if (offset >= data->d_size)
        throw semantic_error("bad __markers_string section?");
       string name = (char *)(data->d_buf) + offset;
       offset += name.size() + 1;
-
-      if (offset >= data->d_size)
+      if (offset >= data->d_size || name.empty())
        throw semantic_error("bad __markers_string section?");
+
+      // Skip any '\0' chars
+      while (offset < data->d_size)
+        {
+         if (*((char *)(data->d_buf) + offset) != '\0')
+           break;
+         offset++;
+       }
+
+      // Grab the parameter string.
       string params = (char *)(data->d_buf) + offset;
       offset += params.size() + 1;
+      if (offset >= data->d_size)
+       throw semantic_error("bad __markers_string section?");
+
+      // Skip any '\0' chars
+      while (offset < data->d_size)
+        {
+         if (*((char *)(data->d_buf) + offset) != '\0')
+           break;
+         offset++;
+       }
+
+      // Skip the arg string
+      while (offset < data->d_size)
+        {
+         if (*((char *)(data->d_buf) + offset) == '\0')
+           break;
+         offset++;
+       }
+      offset++;
+
+      // Skip any '\0' chars
+      while (offset < data->d_size)
+        {
+         if (*((char *)(data->d_buf) + offset) != '\0')
+           break;
+         offset++;
+       }
 
       markers_data *m = new markers_data;
       m->name = name;
@@ -5227,7 +5264,11 @@ repeat:
        case 'p':
          arg = new mark_arg;
          arg->str = false;
-         arg->c_type = "void *";
+         // This should really be 'void *'.  But, then we'll get a
+         // compile error when we assign the void pointer to an
+         // integer without a cast.  So, we use 'long' instead, since
+         // it should have the same size as 'void *'.
+         arg->c_type = "long";
          arg->stp_type = pe_long;
          mark_args.push_back(arg);
          continue;
@@ -5387,7 +5428,7 @@ mark_derived_probe_group::emit_module_decls (systemtap_session& s)
 
   // Emit the marker callback function
   s.op->newline();
-  s.op->newline() << "static void enter_marker_probe (const struct __mark_marker_data *mdata, const char *fmt, ...) {";
+  s.op->newline() << "static void enter_marker_probe (const struct __mark_marker *mdata, void *private_data, const char *fmt, ...) {";
   s.op->newline(1) << "struct stap_marker_probe *smp = (struct stap_marker_probe *)mdata->pdata;";
   common_probe_entryfn_prologue (s.op, "STAP_SESSION_RUNNING");
   s.op->newline() << "c->probe_point = smp->pp;";
@@ -5412,12 +5453,15 @@ mark_derived_probe_group::emit_module_init (systemtap_session &s)
   s.op->newline() << "for (i=0; i<" << probes.size() << "; i++) {";
   s.op->newline(1) << "struct stap_marker_probe *smp = &stap_marker_probes[i];";
   s.op->newline() << "probe_point = smp->pp;";
-  s.op->newline() << "rc = (marker_set_probe(smp->name, smp->format, enter_marker_probe, smp) == 0);";
+  s.op->newline() << "rc = marker_probe_register(smp->name, smp->format, enter_marker_probe, smp);";
+  s.op->newline() << "if (! rc)";
 
-  s.op->newline() << "if (rc) {";
+  s.op->newline(1) << "rc = marker_arm(smp->name);";
+
+  s.op->newline(-1) << "if (rc) {";
   s.op->newline(1) << "for (j=i-1; j>=0; j--) {"; // partial rollback
   s.op->newline(1) << "struct stap_marker_probe *smp2 = &stap_marker_probes[j];";
-  s.op->newline() << "marker_remove_probe(smp2->name);";
+  s.op->newline() << "marker_probe_unregister(smp2->name);";
   s.op->newline(-1) << "}";
   s.op->newline() << "break;"; // don't attempt to register any more probes
   s.op->newline(-1) << "}";
@@ -5434,7 +5478,7 @@ mark_derived_probe_group::emit_module_exit (systemtap_session& s)
   s.op->newline() << "/* deregister marker probes */";
   s.op->newline() << "for (i=0; i<" << probes.size() << "; i++) {";
   s.op->newline(1) << "struct stap_marker_probe *smp = &stap_marker_probes[i];";
-  s.op->newline() << "marker_remove_probe(smp->name);";
+  s.op->newline() << "marker_probe_unregister(smp->name);";
   s.op->newline(-1) << "}"; // for loop
 }
 
This page took 0.046216 seconds and 5 git commands to generate.