Commit a1e2f60e authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Ingo Molnar

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: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarFrederic 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: default avatarIngo Molnar <mingo@elte.hu>
parent 95476b64
......@@ -761,7 +761,7 @@ static int field_is_string(struct format_field *field)
static int field_is_dynamic(struct format_field *field)
{
if (!strcmp(field->type, "__data_loc"))
if (!strncmp(field->type, "__data_loc", 10))
return 1;
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment