Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158285
b: refs/heads/master
c: 3f9edc2
h: refs/heads/master
i:
  158283: 37f32a1
v: v3
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Aug 17, 2009
1 parent e0abeda commit d7f6766
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 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: 9df37ddd81f54dd41dc4958055c3a3c9b6840aef
refs/heads/master: 3f9edc2382d5f7c97c693838abb207a9d6bab1fa
31 changes: 27 additions & 4 deletions trunk/tools/perf/util/trace-event-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1462,18 +1462,34 @@ process_paren(struct event *event, struct print_arg *arg, char **tok)
{
struct print_arg *item_arg;
enum event_type type;
int ptr_cast = 0;
char *token;

type = process_arg(event, arg, &token);

if (type == EVENT_ERROR)
return EVENT_ERROR;

if (type == EVENT_OP)
type = process_op(event, arg, &token);
if (type == EVENT_OP) {
/* handle the ptr casts */
if (!strcmp(token, "*")) {
/*
* FIXME: should we zapp whitespaces before ')' ?
* (may require a peek_token_item())
*/
if (__peek_char() == ')') {
ptr_cast = 1;
free_token(token);
type = read_token_item(&token);
}
}
if (!ptr_cast) {
type = process_op(event, arg, &token);

if (type == EVENT_ERROR)
return EVENT_ERROR;
if (type == EVENT_ERROR)
return EVENT_ERROR;
}
}

if (test_type_token(type, token, EVENT_DELIM, (char *)")")) {
free_token(token);
Expand All @@ -1499,6 +1515,13 @@ process_paren(struct event *event, struct print_arg *arg, char **tok)
item_arg = malloc_or_die(sizeof(*item_arg));

arg->type = PRINT_TYPE;
if (ptr_cast) {
char *old = arg->atom.atom;

arg->atom.atom = malloc_or_die(strlen(old + 3));
sprintf(arg->atom.atom, "%s *", old);
free(old);
}
arg->typecast.type = arg->atom.atom;
arg->typecast.item = item_arg;
type = process_arg_token(event, item_arg, &token, type);
Expand Down

0 comments on commit d7f6766

Please sign in to comment.