Re: [PATCH 31/32] tools lib traceevent: Support function __get_dynamic_array_len

From: Alexei Starovoitov
Date: Fri Aug 28 2015 - 20:29:46 EST

On 8/28/15 12:06 AM, Wang Nan wrote:
From: He Kuang<hekuang@xxxxxxxxxx>

Support helper function __get_dynamic_array_len() in libtraceevent,
this function is used accompany with __print_array() or __print_hex(),
but currently it is not an available function in the function list of

The total allocated length of the dynamic array is embedded in the top
half of __data_loc_##item field. This patch adds new arg type
PRINT_DYNAMIC_ARRAY_LEN to return the length to eval_num_arg(),

Signed-off-by: He Kuang<hekuang@xxxxxxxxxx>
Acked-by: Namhyung Kim<namhyung@xxxxxxxxxx>

Tested-by: Alexei Starovoitov <ast@xxxxxxxxxxxx>

this patch fixes the perf crash:
Warning: [bpf:bpf_output_data] function __get_dynamic_array_len not defined
Warning: Error: expected type 5 but read 0
*** glibc detected *** perf_4.2.0: double free or corruption (fasttop): 0x00000000032caf20 ***
======= Backtrace: =========

it's not strictly necessary until patch 32 lands, but I think it's
a good fix regardless.
Steven, could you take it into your tree?

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at