Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169495
b: refs/heads/master
c: 91ff2bc
h: refs/heads/master
i:
  169493: fa8becd
  169491: 888d12f
  169487: cf644a8
v: v3
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Oct 15, 2009
1 parent d4c7952 commit c9a8d34
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 924a79af2cdee26a034b9bdce8c9c76995b5c901
refs/heads/master: 91ff2bc191827f0d3f5ad0a433ff7df7d2dd9aee
27 changes: 25 additions & 2 deletions trunk/tools/perf/util/trace-event-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,10 @@ static enum event_type __read_token(char **tok)
last_ch = ch;
ch = __read_char();
buf[i++] = ch;
} while (ch != quote_ch && last_ch != '\\');
/* the '\' '\' will cancel itself */
if (ch == '\\' && last_ch == '\\')
last_ch = 0;
} while (ch != quote_ch || last_ch == '\\');
/* remove the last quote */
i--;
goto out;
Expand Down Expand Up @@ -2325,7 +2328,27 @@ static void pretty_print(void *data, int size, struct event *event)

for (; *ptr; ptr++) {
ls = 0;
if (*ptr == '%') {
if (*ptr == '\\') {
ptr++;
switch (*ptr) {
case 'n':
printf("\n");
break;
case 't':
printf("\t");
break;
case 'r':
printf("\r");
break;
case '\\':
printf("\\");
break;
default:
printf("%c", *ptr);
break;
}

} else if (*ptr == '%') {
saveptr = ptr;
show_func = 0;
cont_process:
Expand Down

0 comments on commit c9a8d34

Please sign in to comment.