Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp871639pxv; Thu, 1 Jul 2021 11:09:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw69X0dgwUr9bIpd1QzAee6vONYAWC35kFwkfEDgMvEPloXhd6sfvg4oo5ENfuJ5HlV4Elr X-Received: by 2002:a50:fc90:: with SMTP id f16mr1550648edq.254.1625162998211; Thu, 01 Jul 2021 11:09:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625162998; cv=none; d=google.com; s=arc-20160816; b=yV3VWKymgxPIhucVQ0CSO2fXCrCNB2PtWoRqOqrMYBZGsyUklQBx8Yf4v4RWPj1FH6 wgdWs79kp0isFZeTXdbx8BNULQ0UDk1vS5659jWlP8gefQg72owNw1vkDVjD0W5GR1Ev D3KCbFfCGy918bzbwzddh9HwI/nqHycDFEtei5e//K5pWyy56utpK9cNHj55laQ16Rkk Ff0gP24OBtjR8sFKfRrzvINYRyEE50Niq9pVo3bHiSzwknmNarE4BBZFWZkvFmqT9sOP KdwELIT6slqUIYqrIKtRpgjvtlw9xsLCiqUvkhl/YVFzkOsQkXihSiAGblyndU5tEyIu bmLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=k91XslHSXf3gLEmh7mw8FxEeLNsx63xCHQfj/qhj9PI=; b=sxiuD1XplLjqBdQI9H/F/tdL8wQByyj/RXhP9Ti68YtDc1EIg46+iZgg4NkErXYHkt tgSUBa4xQqcpR+jfnydc+DkNHQqJ1TeG4iVqMBRMerCatL9B2TAhgprLdOFvwfvBBA4N ei5h2AjOtwh9cQBn5GQp6bhfppbno+h3IHKFUspBiKLYfcnXzeu4YhoxXJ9g65uzoPsl sRA51gXxTFZvYwW+vA97uwSYXJu+xycZwHESXGo3EYoYnbgh+yIJLnvlKSQNQoxczjyN v/UMsAi2OzDI2jNT5/VyNpMO2OzHR1qsFmFfwqk00rlou4tZAeHxCFkPdAHNPZ7MJ5cR 5aqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gen8sslU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ia17si718721ejc.157.2021.07.01.11.09.33; Thu, 01 Jul 2021 11:09:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gen8sslU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233605AbhGASHe (ORCPT + 99 others); Thu, 1 Jul 2021 14:07:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:34874 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229958AbhGASHd (ORCPT ); Thu, 1 Jul 2021 14:07:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E0D74611F1; Thu, 1 Jul 2021 18:05:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625162703; bh=3kyu4JepJJ9a+p12n/faYnLEi5XmJZwv9CoyN/fgGOk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Gen8sslU9tVVnAuVtQzAuzXNas9mcOi4ydYSzlRgBqOEtDDboJ5AxjdZ2Mp6hFU4C DGqixb9hQ/ITKq00sVSn9ZkipsR4o/ct9y1NlLntxNCMKtBq1mj3sUHeSXBcJzJvY8 fOJPrR6aOqN4KaehgXXFKmuFx2mk4Tt3N3e3yxGpwYd+/Nol7lBGQHEligxocykoLz BSBSoyJmD0QiQje4ANS52lauDaf8IVzuO7n2k6xMeFs8kk317uGrEUdyY6CXZZZalz ZzhAR5GSlbmer1yLeNuoUYhwhlKOD0TFaBoKJiXsqASApb66/dFNZ2545Cj/o8oxTf /KpChIY1ViHQQ== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 0F0E040B1A; Thu, 1 Jul 2021 15:05:00 -0300 (-03) Date: Thu, 1 Jul 2021 15:04:59 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: Ian Rogers , Riccardo Mancini , Namhyung Kim , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Adrian Hunter , Kan Liang , Leo Yan , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] perf session: add missing evlist__delete when deleting a session Message-ID: References: <20210624231926.212208-1-rickyman7@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Jun 25, 2021 at 01:54:03PM +0200, Jiri Olsa escreveu: > On Thu, Jun 24, 2021 at 10:39:34PM -0700, Ian Rogers wrote: > > On Thu, Jun 24, 2021 at 4:20 PM Riccardo Mancini wrote: > > > > > > ASan reports a memory leak caused by evlist not being deleted on exit in > > > perf-report, perf-script and perf-data. > > > The problem is caused by evlist->session not being deleted, which is > > > allocated in perf_session__read_header, called in perf_session__new if > > > perf_data is in read mode. > > > In case of write mode, the session->evlist is filled by the caller. > > > This patch solves the problem by calling evlist__delete in > > > perf_session__delete if perf_data is in read mode. > > ugh, I'm surprised we did not free that.. and can't find > in git log we ever did ;-) I briefly check commands using > sessions and looks like it's correct > > Acked-by: Jiri Olsa > > > > > Acked-by: Ian Rogers > > > > It is messy that in read mode the session owns the evlist, but > > otherwise not. Imo, it'd be nice to make the ownership unconditional. > > yep, would be nice Thanks, applied. Riccardo, next time please consider adding a Fixes: tag so that the stable@kernel.org guys can pick this for stable releases. - Arnaldo