aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/trace-event-parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/trace-event-parse.c')
-rw-r--r--tools/perf/util/trace-event-parse.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index a05c7144aded..2b75ec2f57e8 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -522,7 +522,10 @@ static enum event_type __read_token(char **tok)
522 last_ch = ch; 522 last_ch = ch;
523 ch = __read_char(); 523 ch = __read_char();
524 buf[i++] = ch; 524 buf[i++] = ch;
525 } while (ch != quote_ch && last_ch != '\\'); 525 /* the '\' '\' will cancel itself */
526 if (ch == '\\' && last_ch == '\\')
527 last_ch = 0;
528 } while (ch != quote_ch || last_ch == '\\');
526 /* remove the last quote */ 529 /* remove the last quote */
527 i--; 530 i--;
528 goto out; 531 goto out;
@@ -2325,7 +2328,27 @@ static void pretty_print(void *data, int size, struct event *event)
2325 2328
2326 for (; *ptr; ptr++) { 2329 for (; *ptr; ptr++) {
2327 ls = 0; 2330 ls = 0;
2328 if (*ptr == '%') { 2331 if (*ptr == '\\') {
2332 ptr++;
2333 switch (*ptr) {
2334 case 'n':
2335 printf("\n");
2336 break;
2337 case 't':
2338 printf("\t");
2339 break;
2340 case 'r':
2341 printf("\r");
2342 break;
2343 case '\\':
2344 printf("\\");
2345 break;
2346 default:
2347 printf("%c", *ptr);
2348 break;
2349 }
2350
2351 } else if (*ptr == '%') {
2329 saveptr = ptr; 2352 saveptr = ptr;
2330 show_func = 0; 2353 show_func = 0;
2331 cont_process: 2354 cont_process: