]> sourceware.org Git - systemtap.git/commitdiff
elaborate.cxx: tweak monitor mode globals representaton
authorFrank Ch. Eigler <fche@redhat.com>
Thu, 24 Mar 2016 00:42:02 +0000 (20:42 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Thu, 24 Mar 2016 00:42:51 +0000 (20:42 -0400)
Fix the quoting in the generated procfs("monitor_status") probe
so that values of globals are properly quoted in the JSON stream.

elaborate.cxx

index eac2a597845ab1c0415647ce46e69b1dd3bfed73..0d08d7998b0bd8af35ce801ae6ebdc12edcc477e 100644 (file)
@@ -2041,11 +2041,11 @@ static void monitor_mode_read(systemtap_session& s)
       if (it != s.globals.begin())
         code << "$value .= sprintf(\",\\n\")" << endl;
 
-      code << "$value .= sprintf(\"\\\"%s\\\"\", \"" << (*it)->unmangled_name << "\")" << endl;
+      code << "$value .= sprintf(\"\\\"%s\\\":\", \"" << (*it)->unmangled_name << "\")" << endl;
       if ((*it)->arity == 0)
-        code << "$value .= sprint(\": \", " << (*it)->name << ", \"\")" << endl;
+        code << "$value .= string_quoted(sprint(" << (*it)->name << "))" << endl;
       else if ((*it)->arity > 0)
-        code << "$value .= sprintf(\": \\\"(%d)\\\"\", " << (*it)->maxsize << ")" << endl;
+        code << "$value .= sprintf(\"\\\"[%d]\\\"\", " << (*it)->maxsize << ")" << endl;
     }
   code << "$value .= sprintf(\"\\n},\\n\")" << endl;
 
This page took 0.037254 seconds and 5 git commands to generate.