From 38098f65bb1f4cd66935c26ccb7dd6b0bb1544d0 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Wed, 23 Mar 2016 20:42:02 -0400 Subject: [PATCH] elaborate.cxx: tweak monitor mode globals representaton Fix the quoting in the generated procfs("monitor_status") probe so that values of globals are properly quoted in the JSON stream. --- elaborate.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/elaborate.cxx b/elaborate.cxx index eac2a5978..0d08d7998 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -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; -- 2.43.5