Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4394505pxj; Mon, 21 Jun 2021 22:16:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhdhjRKGlKa60Dn3dK1S7UXash8SDOf5IGEpeyICRq5WfS9Tr/qFLuqaYVpLF8YqJzv3vN X-Received: by 2002:a05:6402:1510:: with SMTP id f16mr2401495edw.377.1624338979538; Mon, 21 Jun 2021 22:16:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624338979; cv=none; d=google.com; s=arc-20160816; b=VDbw8Ptt9dqbSiu1eAdaQaGpo2zqkseTBogYpwtWwqq+Dy3yKw5MPt7ta1pT/3aoHn tadHc6w5vmbXPMGaYDVhCnCXCSSCPhQWxw0U/ocD7GAF8E9mC+QvjUegXU7Yc20B7ks0 bVy4LzAm4HUT0wQt+0uplpb+fBz1s8purGJfiTM27AEoFqyrTlV2dbi8Y/2QBmwTiByK QsClACubE989WdArlhL9Hw56qz/fdBZtovOX5xqt8qaVC/SQdkjGCvP9AMuZmUagE/jQ VW2cEoOpbMcVXMmszX89Gax518NAo2EleepqM8hMMppeTXaKGtAuXACd+JL9pAtdnqfg zOTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=igBGOSIDZ6LxhaMTJqFN/2gXteF3yCVxKqpvV2Tb7pY=; b=ORWrzSQ0/RDlk2wm3AUlz1sQk1r3N3Xuj8fEkbKdIbZX2AVIvP4qZpZVIUj7wYU53l 7Zg4J6DN5hhLu1lAmSXj20XW0R2UdZ/tkq1zhViArf/QEapA29l0yjpUZuwbbIFbFo/A 0ZqKj73MK41SIEARouxAnG+le4sZMkg3BE5C35C70hlLozyI0oLNr06r6kBlAOLVsY9C KIcusNzliIlnaNCaQyRLQ9LzAVM6rIMsll7wLGR6/Csr04sfCDQRj5qkmNbDV4tJoWDf 57B153O962edfBhcxMOgkWtbbGxEmAYCBs2G98IOQQGblVyLrQO0YNAqNZqa3TuByb2F CdcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="vD7dwf/4"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a4si12530814ejs.331.2021.06.21.22.15.57; Mon, 21 Jun 2021 22:16:19 -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=@google.com header.s=20161025 header.b="vD7dwf/4"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229927AbhFVFRR (ORCPT + 99 others); Tue, 22 Jun 2021 01:17:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229844AbhFVFRP (ORCPT ); Tue, 22 Jun 2021 01:17:15 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 114C4C061756 for ; Mon, 21 Jun 2021 22:14:59 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id n35-20020a05600c3ba3b02901cdecb6bda8so838056wms.5 for ; Mon, 21 Jun 2021 22:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=igBGOSIDZ6LxhaMTJqFN/2gXteF3yCVxKqpvV2Tb7pY=; b=vD7dwf/4rkdpgtOXKkGYx767Gxcjk6eeTkyEDZUnB4GqZNVnyUBIsj7SK+9C+8EZiO KalzugQBEFZpBmiHcrXPBAJEUXPlMYIE4+8337qG+T3wc/WK47QJW5+emCp3992hH88Q tIFMOpd3MqKkY/hdDhbaL93Rr3UBgKeRMRUyQFZV7uPfBDFLLMHy5BRN6dw5hX9akDDv ostfer+4D9LbBnrEsSen9fvQyXzlfO1feevZmx+VQYoUiLkbBAJbFenLeMQzsQuleiK8 tfKgaJeRQKdBrftkc350XmtFnco2aBSVhdyiiVfMrY/KGXE7dZrYPaHrb6q82ejan5ck mF7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=igBGOSIDZ6LxhaMTJqFN/2gXteF3yCVxKqpvV2Tb7pY=; b=GLtUPwWBm0avTYXmG9zpg0C50trkeXmKpLtFEvO1DXPIDY+Yv0eOUucdipKn+DzWj/ Lw4J+nVSWVDKglqkhFx+6MZkSV3veTIlikMqNBu7UVVkL8mTA8QQqly/G1fR43spaseh gWr34wGRVk6pF526vFTHb8jcNHDaAINVhCH0gNABXgpvUS03wiZhjG0RiFFzsEnICGb9 PD4/xlpJiPy6tZtcDty0woAe3ESFCCfRGk8PwQQa/5uXeb191icSmYDZ1umk3m7ay5Js rBHJ+cu303jHZSEekz/V1x1DELXKvmLIMokEuXOYvjWZeua+WhCLnZM3wPDqGGYN4YEd RpCQ== X-Gm-Message-State: AOAM532qRLDYXQD6guSWbcRKDT1FBeI4NnQ1C7rSbhPhklTLMb7p4FhS lFwvoUBcdewGsqKpZq8KBOZbGVoouRrcf0FNzOPshw== X-Received: by 2002:a05:600c:4105:: with SMTP id j5mr2316395wmi.58.1624338897557; Mon, 21 Jun 2021 22:14:57 -0700 (PDT) MIME-Version: 1.0 References: <20210621234317.235545-1-rickyman7@gmail.com> <20210621234317.235545-3-rickyman7@gmail.com> In-Reply-To: <20210621234317.235545-3-rickyman7@gmail.com> From: Ian Rogers Date: Mon, 21 Jun 2021 22:14:46 -0700 Message-ID: Subject: Re: [PATCH 2/2] perf script: delete evlist when deleting session To: Riccardo Mancini Cc: Arnaldo Carvalho de Melo , Namhyung Kim , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 21, 2021 at 4:44 PM Riccardo Mancini wrote: > > ASan reports a memory leak related to session->evlist never being deleted. > The evlist member is not deleted in perf_session__delete, so it should be > deleted separately. > This patch adds the missing deletion in perf-script. > > Signed-off-by: Riccardo Mancini > --- > tools/perf/builtin-script.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c > index 1280cbfad4db..635a1d9cfc88 100644 > --- a/tools/perf/builtin-script.c > +++ b/tools/perf/builtin-script.c > @@ -3991,7 +3991,7 @@ int cmd_script(int argc, const char **argv) > zfree(&script.ptime_range); > } > > - evlist__free_stats(session->evlist); Should this be removed? > + evlist__delete(session->evlist); If the perf session "owns" the evlist, would it be cleaner to add this to perf_session__delete? Thanks, Ian > perf_session__delete(session); > > if (script_started) > -- > 2.31.1 >