From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934235AbbFWVyy (ORCPT ); Tue, 23 Jun 2015 17:54:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33931 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933339AbbFWVyk (ORCPT ); Tue, 23 Jun 2015 17:54:40 -0400 Date: Tue, 23 Jun 2015 23:54:34 +0200 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , lkml , Adrian Hunter , Andi Kleen , David Ahern , Ingo Molnar , Namhyung Kim , Peter Zijlstra , Stephane Eranian Subject: Re: [PATCH 03/27] perf tools: Add reference counting for cpu_map object Message-ID: <20150623215434.GA24969@krava.brq.redhat.com> References: <1435012588-9007-1-git-send-email-jolsa@kernel.org> <1435012588-9007-4-git-send-email-jolsa@kernel.org> <20150623210645.GB11231@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150623210645.GB11231@kernel.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 23, 2015 at 06:06:45PM -0300, Arnaldo Carvalho de Melo wrote: > Em Tue, Jun 23, 2015 at 12:36:04AM +0200, Jiri Olsa escreveu: > > -void cpu_map__delete(struct cpu_map *map) > > +static void cpu_map__delete(struct cpu_map *map) > > { > > - free(map); > > + if (map) { > > + WARN_ONCE(atomic_read(&map->refcnt) != 0, > > + "cpu map refcnt disbalanced\n"); > > Have you used this to catch some bug or is this just some attempt at a > proactive check? s/disbalanced/unbalanced/g yep, proactive check jirka