From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754453AbbGQRZr (ORCPT ); Fri, 17 Jul 2015 13:25:47 -0400 Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.231]:4609 "EHLO cdptpa-oedge-vip.email.rr.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753791AbbGQRZq (ORCPT ); Fri, 17 Jul 2015 13:25:46 -0400 Date: Fri, 17 Jul 2015 13:24:39 -0400 From: Sara Rostedt To: He Kuang , Javi Merino Cc: , , , , , , , , , , Alex =?UTF-8?B?QmVu?= =?UTF-8?B?bsOpZQ==?= , Dave Martin Subject: Re: [RFC PATCH v4 1/3] tracing/events: Fix wrong sample output by storing array length instead of size Message-ID: <20150717132439.689f8cc8@gandalf.local.home> In-Reply-To: <20150717103215.7d285953@gandalf.local.home> References: <1436522587-136825-1-git-send-email-hekuang@huawei.com> <1436522587-136825-2-git-send-email-hekuang@huawei.com> <20150717103215.7d285953@gandalf.local.home> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.28; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-RR-Connecting-IP: 107.14.168.118:25 X-Cloudmark-Score: 0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 17 Jul 2015 10:32:15 -0400 Steven Rostedt wrote: > > @@ -453,7 +454,7 @@ trace_event_define_fields_##call(struct trace_event_call *event_call) \ > > __item_length = (len) * sizeof(type); \ > > __data_offsets->item = __data_size + \ > > offsetof(typeof(*entry), __data); \ > > - __data_offsets->item |= __item_length << 16; \ > > + __data_offsets->item |= (len) << 16; \ > > This change affects all callers of dymanic_array, not just bitmasks. This also affects what goes into the trace record and changes what tools expect. That size is to be the size of the entire allocated space, not the size of an individual element or the number of them. > > > __data_size += __item_length; > > > > #undef __string > > BTW, if I revert commit ac01ce1410fc2 "tracing: Make > ftrace_print_array_seq compute buf_len" it works again. > > I'm going to look into this some more, and maybe the answer is to go > back and just pass in buffer length here. I can't see what was broken > before that change. I'm thinking the best thing to do is to revert that patch and make the second argument of __print_array() the size and not the count. -- Steve