reading dynamic array fields in ftrace

sahil aggarwal sahilagg0693 at gmail.com
Thu May 7 03:41:17 EDT 2015


hi,

some of the events in ftrace have dynamic array fields. Like :

field:__data_loc char[] arg1; offset:24; size:4; signed:1;

If i am sampling this particular event using perf_event_open(), how do
i read this field
i tried:

#define get_str(field) (char *)get_dynamic_array(field)
#define get_dynamic_array(field)      \
                ((void *)data + (data->__data_loc_##field & 0xffff))

as done in include/trace/ftrace,h

But it gives garble data.
TID:28578 PID:28578  TIME:258203626722378 CPU:4 Filename: ^\~@b�^O~H��^H�^?

Will appreciate any help.

Thanks
-sahil



More information about the Kernelnewbies mailing list