Message ID | 20230607014353.3172466-14-irogers@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 171F3C7EE2F for <linux-arm-kernel@archiver.kernel.org>; Wed, 7 Jun 2023 02:50:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Subject:References:Mime-Version :Message-Id:In-Reply-To:Date:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=g5dxd8/eYjw6y0DPZQ/2MTFkM40HCQ+jSDFUafrOGS4=; b=aPwUvDxMoZ8OzM bqWDMXWZ9S3eUFQz7EDyfckbDR1q4FO/NvBKOUmFNpbc+n50T3uLCsjsa1JgVAXuBYHMNhk/5Wb6g JKpWD/fDvFZKEmz7YdRgUQIPcvylvHWE4Uo5b75XVaFK+F2p/zGHp5wlgnroV0l+yu5L0FNhfIukS Fus5BxfeOEBnSocsRVFJKsFCE972PwPQpghUE4gdJ5m+ro+R7RyO2LHzRRrOgfZ1EGw26fFtpzbl5 xiODgMae/9BdtMnV7bQ2x0BzmvjS6IeYfEFKi2cF+ieIzISG1qGXxTGwv065yCry539Fjl7BsR2gA QCL9Q3kzSX3KxqFNlACA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6jFd-0043k9-0y; Wed, 07 Jun 2023 02:50:21 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6jFb-0043iz-0m for linux-arm-kernel@bombadil.infradead.org; Wed, 07 Jun 2023 02:50:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:To:From:Subject: References:Mime-Version:Message-Id:In-Reply-To:Date:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Lh3ZPj+Wzo2hfjfSWit72WLXRXJmKCjosdWMK8GGHUA=; b=bNeeqDntUT4AhcErw7e7nh2Bun 2NbPA7cmcYyl5U6MES55ObFSQwn8AUwF7SradMSBXKMjEKmPEH7FdP59gESCUkYfMkv+3B+Bl6Vg1 3qXscYO2sMrwW8NQAGFDlRLjE+lWUmVIErD/OY6n5o+Q2I7kQIcEwieE3ysyziK9pgJHqAKyePGNB MwRjYRNcYraW2S/yYjfVth//kTKrPoWHkfRTSlKppxh9EXqVg32/H9q8LrzmXoqXr1p9qojbCBlbj 5sZCVGv2GgvXX4Xu5ejv/Td5VDJGEuzEiorpw4jK+njco+p9R42iWFMEAYrq917VMgVEN3vhxJ/CI 3wygt84A==; Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6iE6-004H0b-1K for linux-arm-kernel@lists.infradead.org; Wed, 07 Jun 2023 01:44:46 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-babb79a17b8so8088306276.0 for <linux-arm-kernel@lists.infradead.org>; Tue, 06 Jun 2023 18:44:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686102280; x=1688694280; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=Lh3ZPj+Wzo2hfjfSWit72WLXRXJmKCjosdWMK8GGHUA=; b=3o9qJWhUHNoQNGjubcZF65jCf+kylBRuNrh/H8uqZh8T9IE7SSsDbQdJAJqkGygZ/M XUmP4BGq/x9wgJBAhBViGncUpwNN2utiZ9qBzS74mgWQA9TAd1yT6PxKwrY6axXJfoka xLBd+y1FTCyaQ8wtCWDkY7jTYi1N/aIH8fzG2ptJwcuGV1neC/CfhkzGgXRMnmez4ToI 7zfazA3RCOCqNCGwYQ3piafzBFPOCEl6Iiy3qDsgKJQSvSkzxH1q4Czl9Fgamm0CXqul SQ8P0Iql/omNg2GbZcfLUD+dqe8nJ4RmJNzdOs2uPS4ts5K1aUmvO3nFu0WoPgZ4IAnz QZzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686102280; x=1688694280; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Lh3ZPj+Wzo2hfjfSWit72WLXRXJmKCjosdWMK8GGHUA=; b=DMkvVBFJgl8uXljDXFe8c1Mg2Jy1Dqy8IGJSis5vd+roKeol2aoDoi8QL7LmD7EfKx gQI3d+1PL8ubID1XPB6dNFtqoIqwpTtbRg6SlxZ4QT+1m5EZT9ABL5WQPc4zeWK04ivn WK7lR7m1scsm3sxA1+gj8Woy+Y4iVMxRLsuWeHsSsagYnHetGt7gE+5an8pz/CawfxcZ KxKEPuhPn/aEkbbgl+yZK4Nc1H6sOo23PLU4eV8LujKah+exM5j+QNP/e+EV4Uo5KoE7 Qg08+dOdcdXgBK+JFKLd9D4s51dVMUJkDkuZrM8M8e/TvfvY+HVfVydkK7C0w1UdpvKE 9xyw== X-Gm-Message-State: AC+VfDzmieEeonTUrOV+lKN6nB1h/sf+fPEXpVALty8aUjSiFaW4RnvR g9bOTsH+GJs+MDz1duyitWUwcpM8VZO2 X-Google-Smtp-Source: ACHHUZ5k0RG8X6zpnvumVsnIGTroi8c4VO2eafr6KT17+45l3nZ2TRcZyfvFyEu2jFiCKaPHKnGy224Junv5 X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:3c35:209f:5d38:b7a1]) (user=irogers job=sendgmr) by 2002:a05:6902:1206:b0:bb1:f26d:b18d with SMTP id s6-20020a056902120600b00bb1f26db18dmr2138419ybu.13.1686102279962; Tue, 06 Jun 2023 18:44:39 -0700 (PDT) Date: Tue, 6 Jun 2023 18:43:46 -0700 In-Reply-To: <20230607014353.3172466-1-irogers@google.com> Message-Id: <20230607014353.3172466-14-irogers@google.com> Mime-Version: 1.0 References: <20230607014353.3172466-1-irogers@google.com> X-Mailer: git-send-email 2.41.0.rc0.172.g3f132b7071-goog Subject: [PATCH v1 13/20] perf evlist: Free stats in all evlist destruction From: Ian Rogers <irogers@google.com> To: John Garry <john.g.garry@oracle.com>, Will Deacon <will@kernel.org>, James Clark <james.clark@arm.com>, Mike Leach <mike.leach@linaro.org>, Leo Yan <leo.yan@linaro.org>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>, Ian Rogers <irogers@google.com>, Adrian Hunter <adrian.hunter@intel.com>, Suzuki K Poulose <suzuki.poulose@arm.com>, "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>, Kan Liang <kan.liang@linux.intel.com>, German Gomez <german.gomez@arm.com>, Ali Saidi <alisaidi@amazon.com>, Jing Zhang <renyu.zj@linux.alibaba.com>, " =?utf-8?q?Martin_Li=C5=A1ka?= " <mliska@suse.cz>, Athira Rajeev <atrajeev@linux.vnet.ibm.com>, Miguel Ojeda <ojeda@kernel.org>, ye xingchen <ye.xingchen@zte.com.cn>, Liam Howlett <liam.howlett@oracle.com>, Dmitrii Dolgov <9erthalion6@gmail.com>, "Shawn M. Chapla" <schapla@codeweavers.com>, Yang Jihong <yangjihong1@huawei.com>, K Prateek Nayak <kprateek.nayak@amd.com>, Changbin Du <changbin.du@huawei.com>, Ravi Bangoria <ravi.bangoria@amd.com>, Sean Christopherson <seanjc@google.com>, Raul Silvera <rsilvera@google.com>, Andi Kleen <ak@linux.intel.com>, "Steinar H. Gunderson" <sesse@google.com>, Yuan Can <yuancan@huawei.com>, Brian Robbins <brianrob@linux.microsoft.com>, liuwenyu <liuwenyu7@huawei.com>, Ivan Babrou <ivan@cloudflare.com>, Fangrui Song <maskray@google.com>, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, coresight@lists.linaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230607_024443_771710_FD5D1FC2 X-CRM114-Status: GOOD ( 13.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
Reference count checking for thread
|
expand
|
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 82c0b3d0c822..7ef43f72098e 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -31,6 +31,7 @@ #include "util/pmu.h" #include "util/sample.h" #include "util/bpf-filter.h" +#include "util/stat.h" #include "util/util.h" #include <signal.h> #include <unistd.h> @@ -171,6 +172,7 @@ void evlist__delete(struct evlist *evlist) if (evlist == NULL) return; + evlist__free_stats(evlist); evlist__munmap(evlist); evlist__close(evlist); evlist__purge(evlist); diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index 8de1b759bbaa..a7b2cb05dc86 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c @@ -1494,3 +1494,7 @@ void test_attr__open(struct perf_event_attr *attr, pid_t pid, struct perf_cpu cp int fd, int group_fd, unsigned long flags) { } + +void evlist__free_stats(struct evlist *evlist) +{ +}
There is no evsel free stats, freeing in the evlist__delete ensures memory leaks are avoided. Issues detected with "perf stat report" and leak sanitizer, perf stat uses perf_session__delete to free the evlist. Add dummy symbol for python build. Signed-off-by: Ian Rogers <irogers@google.com> --- tools/perf/util/evlist.c | 2 ++ tools/perf/util/python.c | 4 ++++ 2 files changed, 6 insertions(+)