From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752185AbdHBHfR (ORCPT ); Wed, 2 Aug 2017 03:35:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54490 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751190AbdHBHfP (ORCPT ); Wed, 2 Aug 2017 03:35:15 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 409A36E41C 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=fail smtp.mailfrom=jolsa@redhat.com Date: Wed, 2 Aug 2017 09:35:13 +0200 From: Jiri Olsa To: Andi Kleen Cc: acme@kernel.org, jolsa@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH v1 03/15] perf, tools, stat: Fix saved values rbtree lookup Message-ID: <20170802073513.GB13890@krava> References: <20170724234015.5165-1-andi@firstfloor.org> <20170724234015.5165-4-andi@firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170724234015.5165-4-andi@firstfloor.org> User-Agent: Mutt/1.8.3 (2017-05-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 02 Aug 2017 07:35:15 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 24, 2017 at 04:40:03PM -0700, Andi Kleen wrote: > From: Andi Kleen > > The stat shadow saved values rbtree is indexed by a pointer. > Fix the comparison function: > > - We cannot return a pointer delta as an int because > that loses bits on 64bit. > - Doing pointer arithmetic on the struct pointer > only works if the objects are spaced by the multiple > of the object size, which is not guaranteed for individual > malloc'ed object > > Replace it with a proper comparison. > > This fixes various problems with values not being found. > > Signed-off-by: Andi Kleen Acked-by: Jiri Olsa thanks, jirka