lkml.org 
[lkml]   [2024]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH v1] perf list: Esacpe \r in json output
From
Events like for sapphirerapids have \r in the uncore descriptions. The
non-escaped versions of this fail json validation the the perf list
test.

Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/builtin-list.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
index 02bf608d585e..9333cc64c2ce 100644
--- a/tools/perf/builtin-list.c
+++ b/tools/perf/builtin-list.c
@@ -313,6 +313,9 @@ static void fix_escape_fprintf(FILE *fp, struct strbuf *buf, const char *fmt, ..
case '\n':
strbuf_addstr(buf, "\\n");
break;
+ case '\r':
+ strbuf_addstr(buf, "\\r");
+ break;
case '\\':
fallthrough;
case '\"':
--
2.44.0.478.gd926399ef9-goog

\
 
 \ /
  Last update: 2024-05-27 16:33    [W:0.218 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site