Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753194AbbH2A3n (ORCPT ); Fri, 28 Aug 2015 20:29:43 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:34186 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752988AbbH2A3l (ORCPT ); Fri, 28 Aug 2015 20:29:41 -0400 Subject: Re: [PATCH 31/32] tools lib traceevent: Support function __get_dynamic_array_len To: Wang Nan , acme@redhat.com References: <1440745570-150857-1-git-send-email-wangnan0@huawei.com> <1440745570-150857-32-git-send-email-wangnan0@huawei.com> Cc: brendan.d.gregg@gmail.com, daniel@iogearbox.net, dsahern@gmail.com, hekuang@huawei.com, jolsa@kernel.org, xiakaixu@huawei.com, masami.hiramatsu.pt@hitachi.com, namhyung@kernel.org, a.p.zijlstra@chello.nl, lizefan@huawei.com, pi3orama@163.com, linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Ingo Molnar , Steven Rostedt From: Alexei Starovoitov Message-ID: <55E0FCF2.6040403@plumgrid.com> Date: Fri, 28 Aug 2015 17:29:38 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1440745570-150857-32-git-send-email-wangnan0@huawei.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1384 Lines: 35 On 8/28/15 12:06 AM, Wang Nan wrote: > From: He Kuang > > 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 > process_function(). > > 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 > Acked-by: Namhyung Kim Tested-by: Alexei Starovoitov 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: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x7ec96)[0x7f0d5d2d3c96] 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/