From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423487AbdEYIJZ (ORCPT ); Thu, 25 May 2017 04:09:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43524 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423448AbdEYIHr (ORCPT ); Thu, 25 May 2017 04:07:47 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 78CEA80C1D Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jolsa@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 78CEA80C1D Date: Thu, 25 May 2017 10:07:42 +0200 From: Jiri Olsa To: David Carrillo-Cisneros Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Andi Kleen , Simon Que , Wang Nan , Jiri Olsa , He Kuang , Masami Hiramatsu , David Ahern , Namhyung Kim , Stephane Eranian , Paul Turner Subject: Re: [PATCH v2 01/13] perf header: encapsulate read and swap Message-ID: <20170525080742.GB14467@krava> References: <20170523074853.54892-1-davidcc@google.com> <20170523074853.54892-2-davidcc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170523074853.54892-2-davidcc@google.com> User-Agent: Mutt/1.8.0 (2017-02-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 25 May 2017 08:07:46 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 23, 2017 at 12:48:41AM -0700, David Carrillo-Cisneros wrote: SNIP > - if (ph->needs_swap) > - nr = bswap_32(nr); > - > ph->env.nr_sibling_cores = nr; > - size += sizeof(u32); > if (strbuf_init(&sb, 128) < 0) > goto free_cpu; > > @@ -1820,20 +1812,14 @@ static int process_cpu_topology(struct perf_file_section *section, > /* include a NULL character at the end */ > if (strbuf_add(&sb, str, strlen(str) + 1) < 0) > goto error; > - size += string_size(str); > free(str); > } hum, you disabled the size check logic by removing those size calculations, there's following code: /* * The header may be from old perf, * which doesn't include core id and socket id information. */ if (section->size <= size) { zfree(&ph->env.cpu); return 0; } that recognize earlier version of the header jirka