Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169473
b: refs/heads/master
c: 064739b
h: refs/heads/master
i:
  169471: 81ebf26
v: v3
  • Loading branch information
Tom Zanussi authored and Ingo Molnar committed Oct 6, 2009
1 parent 1b047b7 commit e210188
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2774601811bedd04ee7e38624343ea80b4a62d7e
refs/heads/master: 064739bc4b3d7f424b2f25547e6611bcf0132415
24 changes: 24 additions & 0 deletions trunk/tools/perf/util/trace-event-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,24 @@ static int event_read_id(void)
return -1;
}

static int field_is_string(struct format_field *field)
{
if ((field->flags & FIELD_IS_ARRAY) &&
(!strstr(field->type, "char") || !strstr(field->type, "u8") ||
!strstr(field->type, "s8")))
return 1;

return 0;
}

static int field_is_dynamic(struct format_field *field)
{
if (!strcmp(field->type, "__data_loc"))
return 1;

return 0;
}

static int event_read_fields(struct event *event, struct format_field **fields)
{
struct format_field *field = NULL;
Expand Down Expand Up @@ -865,6 +883,12 @@ static int event_read_fields(struct event *event, struct format_field **fields)
free(brackets);
}

if (field_is_string(field)) {
field->flags |= FIELD_IS_STRING;
if (field_is_dynamic(field))
field->flags |= FIELD_IS_DYNAMIC;
}

if (test_type_token(type, token, EVENT_OP, (char *)";"))
goto fail;
free_token(token);
Expand Down
2 changes: 2 additions & 0 deletions trunk/tools/perf/util/trace-event.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ enum format_flags {
FIELD_IS_ARRAY = 1,
FIELD_IS_POINTER = 2,
FIELD_IS_SIGNED = 4,
FIELD_IS_STRING = 8,
FIELD_IS_DYNAMIC = 16,
};

struct format_field {
Expand Down

0 comments on commit e210188

Please sign in to comment.