From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754929AbcFAObk (ORCPT ); Wed, 1 Jun 2016 10:31:40 -0400 Received: from mga03.intel.com ([134.134.136.65]:46661 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751648AbcFAObj (ORCPT ); Wed, 1 Jun 2016 10:31:39 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,401,1459839600"; d="scan'208";a="966709035" Date: Wed, 1 Jun 2016 07:31:36 -0700 From: Andi Kleen To: Nilay Vaish Cc: Andi Kleen , acme@kernel.org, jolsa@kernel.org, Linux Kernel list Subject: Re: [PATCH 1/4] perf stat: Basic support for TopDown in perf stat Message-ID: <20160601143136.GO22049@tassilo.jf.intel.com> References: <1464119559-17203-1-git-send-email-andi@firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 01, 2016 at 09:24:33AM -0500, Nilay Vaish wrote: > On 24 May 2016 at 14:52, Andi Kleen wrote: > > From: Andi Kleen > > > > diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c > > index 715a1128daeb..dab184d86816 100644 > > --- a/tools/perf/builtin-stat.c > > +++ b/tools/perf/builtin-stat.c > > @@ -59,10 +59,13 @@ > > #include "util/thread.h" > > #include "util/thread_map.h" > > #include "util/counts.h" > > +#include "util/group.h" > > #include "util/session.h" > > #include "util/tool.h" > > +#include "util/group.h" > > #include "asm/bug.h" > > You have included util/group.h twice. Is this intentional? No was a mistake thanks. > Continuing with my comment from above memory leak, if i == off, > topdown_attrs[0] will be NULL. So we would enter the else portion > here and return -1. But we never free the string we allocated in the > function topdown_filter_events(). I think we are leaking some memory > though seems only about 3 bytes. Right, however the process immediately exits afterwards, so it gets cleaned up anyways. -Andi -- ak@linux.intel.com -- Speaking for myself only