Message ID | 20240205104616.132417-6-yangjihong1@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-52437-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp793892dyb; Mon, 5 Feb 2024 02:52:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IHnvEgOR6YGeVGypc1lz7V7zYw4EohYz7r6Aj8Odl5zP17h+QyDl2n0n+nRdi8RWn9uFxCI X-Received: by 2002:a17:906:3005:b0:a37:3668:be0 with SMTP id 5-20020a170906300500b00a3736680be0mr6177750ejz.1.1707130360974; Mon, 05 Feb 2024 02:52:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707130360; cv=pass; d=google.com; s=arc-20160816; b=ppv/P/WGBtNLjlWvpXuYT4nbF9/b5edcrIVPYgSNsnwsQu9IQmkyYXQgfA7xe4BbPC bWR8Py6Mr1vCTY9f/MpMjdlCEsY8Y8dP4T7EIBgvE7CYcrY68fxpz6E3TDbopiQyHrZP 5KcXOoWZn3x4QQF+ZSuP1AlSrzJJtiq/6UkOamzLgcMHPAq5jSLX25670KJeB3o2tUGc bwFrhiSL2zPJxgl4hpXAi6mLJO/z3/okZNUrkTmu2NCKN0M8X43gqKyr+ppcsYPwbItP oyZbt3bbumyANktAYxS34/hdZoCFR4s3L7PEUbVY67pmzq1AUc7N93abz9q3mwlbSA8s Ofqg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=b8HiQt/mbgboEAPU+LRiqCJPRgx9bTtuu7C53L0HKFE=; fh=IBj4my2SDMfD86u184HBlmzFVlO4Fv5Ljg9d4VmtSnk=; b=girqlOQ0wNDV4dCyCJpP/5LBLUJzb0PiaFiQcKdCbWmUAThTTENoKQmBpcjiL40Ml/ NQStHdXREw6Z6jSG07Mi56eTJ5BPPm7QRJcPBs9TMg0qrXrDHftMbF4fflKMw3eW7TB3 QoYcLCpWa8i1hfc4uu2JGrCcdtV3E5J3+ImmogXL0Q2THJDXq9bCiHh+yMKxuZMyftYB 4IvAt0x+nbhLzRIY7b9b0esJCGeARy+w6jlqzDJxUBkfUKhnpMcZ746jd3yZyA4JkIYI NSV69s2q8wHM4qfVi+I4xFPtDeH6HxrSPN6JyoemaQLbONhiPbXjjdjN8tYYuj6mv1V8 u0Og==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-52437-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52437-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com X-Forwarded-Encrypted: i=1; AJvYcCX3SUdccZmWmUUI67ma4iNsg1/aO0iuil/rAzbWY/XWsVNE03e2EC61uaRltAJXix2VEGHp7MbCaj6aXLr3xsNrS7t4GQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id b22-20020a170906039600b00a3671d5fd31si4019431eja.991.2024.02.05.02.52.40 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 02:52:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52437-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-52437-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52437-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8CBF01F21F3D for <ouuuleilei@gmail.com>; Mon, 5 Feb 2024 10:52:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E03818E0E; Mon, 5 Feb 2024 10:51:26 +0000 (UTC) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9AFC18B02; Mon, 5 Feb 2024 10:51:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707130284; cv=none; b=BQ0VhfDsvyxtGve3b/ILs/m40soq/d016zMtCf0YhBxoDAgC7ZXJ9t39jcfunHlAhbks53YZOWBncr3P68ck91+O997y5sANi7LsJcftxZ6NWfir4Zd2pYIJJ9CDOSXiF7hUnwyuLMnyzcOiEqGtYJi+41fkB74ozgzMLyD7GS4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707130284; c=relaxed/simple; bh=OC9l7go2HEf2topboS2tyvTMicjsAYygRox3AWA4BNs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=d9xprKaDbNptmRGJ3IgtOPyAg39DR8pJ749wqkp/W7AoOwratcqkieqqV7ksTL2chPAD2t61Dkrq4u7/3yTQDUQZV/nyDLImnBu1WTAiVJABzktXkgOT77KEnezyZITDXuqDoIs+uodJ/ECKBLKh7/xkm5yUioop15Pr7KaYoYA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4TT37p4L2GzLnZD; Mon, 5 Feb 2024 18:50:46 +0800 (CST) Received: from kwepemm600003.china.huawei.com (unknown [7.193.23.202]) by mail.maildlp.com (Postfix) with ESMTPS id 3A136140134; Mon, 5 Feb 2024 18:51:15 +0800 (CST) Received: from ubuntu2204.huawei.com (10.67.174.22) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 5 Feb 2024 18:51:14 +0800 From: Yang Jihong <yangjihong1@huawei.com> To: <peterz@infradead.org>, <mingo@redhat.com>, <acme@kernel.org>, <namhyung@kernel.org>, <mark.rutland@arm.com>, <alexander.shishkin@linux.intel.com>, <jolsa@kernel.org>, <irogers@google.com>, <adrian.hunter@intel.com>, <linux-perf-users@vger.kernel.org>, <linux-kernel@vger.kernel.org> CC: <yangjihong1@huawei.com> Subject: [PATCH 5/5] perf thread_map: Free strlist on normal path in thread_map__new_by_tid_str() Date: Mon, 5 Feb 2024 10:46:16 +0000 Message-ID: <20240205104616.132417-6-yangjihong1@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240205104616.132417-1-yangjihong1@huawei.com> References: <20240205104616.132417-1-yangjihong1@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600003.china.huawei.com (7.193.23.202) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790055925613091984 X-GMAIL-MSGID: 1790055925613091984 |
Series |
[1/5] perf sched: Move start_work_mutex and work_done_wait_mutex initialization to perf_sched__replay()
|
|
Commit Message
Yang Jihong
Feb. 5, 2024, 10:46 a.m. UTC
slist needs to be freed in both error path and normal path in
thread_map__new_by_tid_str().
Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
---
tools/perf/util/thread_map.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, Feb 05, 2024 at 10:46:16AM +0000, Yang Jihong wrote: > slist needs to be freed in both error path and normal path in > thread_map__new_by_tid_str(). Please add: Fixes: b52956c961be3a04 ("perf tools: Allow multiple threads or processes in record, stat, top") Reviewed-by: Arnaldo Carvalho de Melo <acme@redhat.com> - Arnaldo > Signed-off-by: Yang Jihong <yangjihong1@huawei.com> > --- > tools/perf/util/thread_map.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c > index e848579e61a8..ea3b431b9783 100644 > --- a/tools/perf/util/thread_map.c > +++ b/tools/perf/util/thread_map.c > @@ -280,13 +280,13 @@ struct perf_thread_map *thread_map__new_by_tid_str(const char *tid_str) > threads->nr = ntasks; > } > out: > + strlist__delete(slist); > if (threads) > refcount_set(&threads->refcnt, 1); > return threads; > > out_free_threads: > zfree(&threads); > - strlist__delete(slist); > goto out; > } > > -- > 2.34.1
Hello, On 2024/2/6 3:09, Arnaldo Carvalho de Melo wrote: > On Mon, Feb 05, 2024 at 10:46:16AM +0000, Yang Jihong wrote: >> slist needs to be freed in both error path and normal path in >> thread_map__new_by_tid_str(). > > Please add: > > Fixes: b52956c961be3a04 ("perf tools: Allow multiple threads or processes in record, stat, top") > OK, will add fixes tag in v2. > Reviewed-by: Arnaldo Carvalho de Melo <acme@redhat.com> > Thanks for the reviewed-by tag > - Arnaldo Thanks, Yang
diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c index e848579e61a8..ea3b431b9783 100644 --- a/tools/perf/util/thread_map.c +++ b/tools/perf/util/thread_map.c @@ -280,13 +280,13 @@ struct perf_thread_map *thread_map__new_by_tid_str(const char *tid_str) threads->nr = ntasks; } out: + strlist__delete(slist); if (threads) refcount_set(&threads->refcnt, 1); return threads; out_free_threads: zfree(&threads); - strlist__delete(slist); goto out; }