diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2010-04-14 17:58:03 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-04-14 19:34:46 -0400 |
commit | a1e2f60e3efc812bf66a2be0d8530ee175003f6d (patch) | |
tree | 6f491715b5ba532e18c2ca3d35dd494358690660 /tools/perf/util/trace-event-parse.c | |
parent | 95476b64ab11d528de2557366ec584977c215b9e (diff) |
perf: Fix dynamic field detection
Checking if a tracing field is an array with a dynamic length
requires to check the field type and seek the "__data_loc"
string that prepends the actual type, as can be found in a trace
event format file:
field:__data_loc char[] name; offset:16; size:4; signed:1;
But we actually use strcmp() to check if the field type fully
matches "__data_loc", which may fail as we trip over the rest of
the type.
To fix this, use strncmp to only check if it starts with
"__data_loc".
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Tom Zanussi <tzanussi@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <1271282283-23721-1-git-send-regression-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/trace-event-parse.c')
-rw-r--r-- | tools/perf/util/trace-event-parse.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c index 17d6d66ed766..d6ef414075a6 100644 --- a/tools/perf/util/trace-event-parse.c +++ b/tools/perf/util/trace-event-parse.c | |||
@@ -761,7 +761,7 @@ static int field_is_string(struct format_field *field) | |||
761 | 761 | ||
762 | static int field_is_dynamic(struct format_field *field) | 762 | static int field_is_dynamic(struct format_field *field) |
763 | { | 763 | { |
764 | if (!strcmp(field->type, "__data_loc")) | 764 | if (!strncmp(field->type, "__data_loc", 10)) |
765 | return 1; | 765 | return 1; |
766 | 766 | ||
767 | return 0; | 767 | return 0; |