Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp705212pxv; Thu, 15 Jul 2021 14:00:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqTmFIuwi5NfG8aIplBM2goNEdti7TwMJM6Ym3eK1C6bVC2LjrkMnBovMIPcheUMV+wnPw X-Received: by 2002:aa7:d84f:: with SMTP id f15mr4372191eds.216.1626382832174; Thu, 15 Jul 2021 14:00:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626382832; cv=none; d=google.com; s=arc-20160816; b=z7pbzYYc91SzJG0WfMcfTjfd/pR7TC/rDrjIYoh82VL9mxxT7dCNr51dfLnpTdLmS+ OZBvW2aiPkkkyT5CcsfZQFubOBpfF8JudBC1Nj1yn8OsDmt/28KZlC994ZqIiaMJ8uuF hWE+NXbLwdNk8qtCZpr6V1XbO8v2+ru2gzQZwe/XY4Q9n5v3ILWuL891s8q9kzbCsRna R5TLgl64KSMWMyGpkKNKJqtx0IvSv7P0skCnFZ9Q5E0B5MOviT48sTq+b/+FD+2a3kmW jCgSspwj0uxX7f3OFWa6BmV8f0tk+57NCumTaVIJE/AtGXSZWqzaayi/hg0XmywGyG/n /3ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yjjAPXRU/f4tqUX/ioC2M8t0jbLZnsxTfex1QSCJU4I=; b=VSypHW62cnxuJsZI1DBnKFNYii6w9w4Ay5jj1jqLqPesWxfpjazDBlCGXQM9DbZbPM DxlQbA50lLuyNh4jIO0yVSlMyO05Pf8KtK76WE4MQhDQJpiqY0KaLi4HxsP1C2Yqqj/E LBYbIOCX4m64yqOt92AwRUPI/SeNtoITL0pogF5WR8yleD++B6dwlzbVq75cuSLTdseI 71YdHmq2b0ciqevI1Upi9ywbl45y6z4nMjyehcUP9HA7IP/KDzQOJOT9FaUgFs/uxiQO mYXSkOSSukgwuCd1vwR00sT1jw4UC3p1J7yi7Irau5OtACgBJgU96CAvdj2K8dNxCgbo HphQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=g0PtPXmh; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x2si9928652ejy.297.2021.07.15.14.00.09; Thu, 15 Jul 2021 14:00:32 -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=@gmail.com header.s=20161025 header.b=g0PtPXmh; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231364AbhGOQK0 (ORCPT + 99 others); Thu, 15 Jul 2021 12:10:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230438AbhGOQKY (ORCPT ); Thu, 15 Jul 2021 12:10:24 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A3B7C061760; Thu, 15 Jul 2021 09:07:31 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id m2so8522693wrq.2; Thu, 15 Jul 2021 09:07:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yjjAPXRU/f4tqUX/ioC2M8t0jbLZnsxTfex1QSCJU4I=; b=g0PtPXmhBXQThgh6YxtbMywRuoRp526rEAQ5qZDfuMd9nMsFgmWuqHzJyvcpy7MtIc qsxXJ/lMqfam7zpWiBtF+xBBG3Ir3MVFLfW+Km/bhhpQrBBJKNakjYE87QLOZMtuooeJ fvqsFXXArIuRN+yIkMGX+7bxdrWvJol0B6qcYHNxa+fASq2ppVZ7VPYuMMx5SFvbwn9M 4qAgRuzaoJpNDO1UftdKztvYkgQDHLkYuJxzX24lLHzcjnSP6aULi1VfqNeJuJGnuwEz RWumYEu1TcY7zgXnpunHsZ36QcXxzoqW2GfM77BmOFrayuHaExVqVJHeUUTb2FErb61v DRrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yjjAPXRU/f4tqUX/ioC2M8t0jbLZnsxTfex1QSCJU4I=; b=ElBgBps3rQfcaZH6r8E0rJGsX98rRU1P67+uqw0WQvvM4MyXU9Xb3dZfYxdbXKHXlj 5fNhxzBPT8mPRy1QuIuzhUrk1RI0lIJO9Mteg2CHP1RIhkkq4X6GJez1BRdJ3A5k0XzY ZPTiZ1RiZiKCR0umb0cq/KZR7aFtiQcc1LbLeNCQrG/jHrOP9Ac/wvy8QyG8AKGwBNLT NTbuZOu0Fshq6HiZJXto+ufx0JXmhwph0EZuZhw3drDGhhBaziZTE8ED6fiEYi1WSVQ5 RPDD5GTq5KjCPvmopKZuDvn40SXiOSAfw+6aXcllqC+ZPUGLGLdW+Unca5HEZcYbj01k yXAA== X-Gm-Message-State: AOAM5323x2f1s4nDjrastVX1WllohGdPz6zYSLvXlgjliJZ1CYDaOYpF xnaYSNpJf2OpnAqBtNPMuxo= X-Received: by 2002:a5d:4bc6:: with SMTP id l6mr6666652wrt.53.1626365249791; Thu, 15 Jul 2021 09:07:29 -0700 (PDT) Received: from honeypot.lan ([2001:b07:6456:fd99:ced0:db1c:53e1:191e]) by smtp.googlemail.com with ESMTPSA id k13sm7446952wrp.34.2021.07.15.09.07.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jul 2021 09:07:29 -0700 (PDT) From: Riccardo Mancini To: Arnaldo Carvalho de Melo Cc: Ian Rogers , Namhyung Kim , Peter Zijlstra , Ingo Molnar , Mark Rutland , Jiri Olsa , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Riccardo Mancini Subject: [PATCH 02/20] perf env: fix sibling_dies memory leak Date: Thu, 15 Jul 2021 18:07:07 +0200 Message-Id: <2140d0b57656e4eb9021ca9772250c24c032924b.1626343282.git.rickyman7@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ASan reports a memory leak in perf_env while running the perf test "41: Session topology", caused by sibling_dies not being freed. This patch adds the required free. Fixes: acae8b36cded0ee6 ("perf header: Add die information in CPU topology") Signed-off-by: Riccardo Mancini --- tools/perf/util/env.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c index ebc5e9ad35db21d1..6c765946ef6f591c 100644 --- a/tools/perf/util/env.c +++ b/tools/perf/util/env.c @@ -186,6 +186,7 @@ void perf_env__exit(struct perf_env *env) zfree(&env->cpuid); zfree(&env->cmdline); zfree(&env->cmdline_argv); + zfree(&env->sibling_dies); zfree(&env->sibling_cores); zfree(&env->sibling_threads); zfree(&env->pmu_mappings); -- 2.31.1