perf list: JSON escape encoding improvements
authorIan Rogers <irogers@google.com>
Fri, 18 Nov 2022 02:46:06 +0000 (18:46 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 24 Nov 2022 13:03:03 +0000 (10:03 -0300)
commit1284ded7d05952f2657f5abeeda5a3f74ca9cffc
tree2c6303f3d4562ac93152433d166a24d7466c84a1
parent1a9c20b45d193ead21dc63b07d1abb40b0a237c2
perf list: JSON escape encoding improvements

Use strbuf to make the string under construction's length unlimited. Use
the format %s to mean a literal string copy and %S to signify a need to
escape the string. Add supported for escaping a newline character.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Caleb Biggers <caleb.biggers@intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Perry Taylor <perry.taylor@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Sandipan Das <sandipan.das@amd.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Weilin Wang <weilin.wang@intel.com>
Cc: Xin Gao <gaoxin@cdjrlc.com>
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
Link: https://lore.kernel.org/r/20221118024607.409083-3-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-list.c