mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
perf trace: Add string/dynamic cases to format_flags
Needed for distinguishing string fields in event stream processing. Signed-off-by: Tom Zanussi <tzanussi@gmail.com> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: rostedt@goodmis.org Cc: lizf@cn.fujitsu.com Cc: hch@infradead.org Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> LKML-Reference: <1254809398-8078-4-git-send-email-tzanussi@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
2774601811
commit
064739bc4b
2 changed files with 26 additions and 0 deletions
|
@ -721,6 +721,24 @@ static int event_read_id(void)
|
||||||
return -1;
|
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)
|
static int event_read_fields(struct event *event, struct format_field **fields)
|
||||||
{
|
{
|
||||||
struct format_field *field = NULL;
|
struct format_field *field = NULL;
|
||||||
|
@ -865,6 +883,12 @@ static int event_read_fields(struct event *event, struct format_field **fields)
|
||||||
free(brackets);
|
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 *)";"))
|
if (test_type_token(type, token, EVENT_OP, (char *)";"))
|
||||||
goto fail;
|
goto fail;
|
||||||
free_token(token);
|
free_token(token);
|
||||||
|
|
|
@ -27,6 +27,8 @@ enum format_flags {
|
||||||
FIELD_IS_ARRAY = 1,
|
FIELD_IS_ARRAY = 1,
|
||||||
FIELD_IS_POINTER = 2,
|
FIELD_IS_POINTER = 2,
|
||||||
FIELD_IS_SIGNED = 4,
|
FIELD_IS_SIGNED = 4,
|
||||||
|
FIELD_IS_STRING = 8,
|
||||||
|
FIELD_IS_DYNAMIC = 16,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct format_field {
|
struct format_field {
|
||||||
|
|
Loading…
Reference in a new issue