Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp112447lqo; Tue, 7 May 2024 14:00:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVizW5JokSEa+GPd2TgCQ9c6C623i+yfKl7DSq0Jo/1/i2uzwygSAqFdc5F0eueQT0SjYvR+AtDUUOSKO/KLQedLIFD2jA1wiEaZMCSaA== X-Google-Smtp-Source: AGHT+IHYlprzdhAfOT32DqXCg1Ord37yVtz4W5hxaDg0isRbbo2nE73lgLLXxBuVaXXoN6oi9qV5 X-Received: by 2002:a17:902:bb17:b0:1e7:8d21:7fd7 with SMTP id d9443c01a7336-1eeb0594cf3mr7491495ad.28.1715115647939; Tue, 07 May 2024 14:00:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715115647; cv=pass; d=google.com; s=arc-20160816; b=qvhTi1gNKp6P1B+LB/qhaP6Jritd1FIF4NzJDQdgmwLJ5R/r8hxCbEhSR1zVfi0bpg 2FOPBOuACoX14ZmLAsgygPPk4d5eBgmRm+/Xayse7ow6XHaiHhaL12EvybCdBs3HkbHy 53owcvikfG8kXt7DIyntM2kP7pLSSfYd6kw52tu+LLQvqltqHD7avm+1qNptryzia/Bj gsgzo4p3MDE3btfaNv3efmC/NzHB0BTMOSQ5Zx88Oq3aHrqTkvSi3NfKQGR+clHZwJNL oXF4x7UN6gNAIGRwUnTqa5fbMBsvUW4+Izu0yG1+i9hCNFuAlnTI6FNNveSJqcHfiB1A 3wbg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Y8UC80XjuoaML0PvK7iPUH6cBlsR0uHGgYxW84I0bmU=; fh=YvR0+rgjGlqqFjlZ5QPM77BW06x/W8UL2iScm9rsdi0=; b=lc8uULtKkCMBjEZhQctxfhr8zc5HVkGcpAGKez430kzhvLBklsgW1PW/5kiPZYkG8x QBYGVWm7V30M0jEwH0boeXL6ksCi+Bng8lfZUUUMKk6DCsA8rNNmO7cKYJTefiAHLLd/ 3lJJjvKVaTgrgljgkvv9RIIk/l+Y5a1xdxb5BeHMUqmd3LGQnVoouiJ3GjN8JELyskQm QpsBr1E/tz45RPRuAm40bHmZN8M4NF47NcCyWzSjkN37/4/9ly6o4QNMZfR2Af+tsF2r eYVzrxJhMPIK00vDlcMC19WRdJ1xbMZq2pJM2nNaH+psK3Eag4HhoAupuEyd6GfMDZk5 qf0Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kd4LdPFK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172170-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172170-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h11-20020a170902f70b00b001e2a5d98c4bsi9445661plo.396.2024.05.07.14.00.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 14:00:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172170-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kd4LdPFK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172170-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172170-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id CAFE5B2349C for ; Tue, 7 May 2024 20:51:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7240871B5B; Tue, 7 May 2024 20:51:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kd4LdPFK" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D5ADA18733E; Tue, 7 May 2024 20:51:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715115102; cv=none; b=UAgiXrob9CjW2pYXs+unwarTTYHXnrF4qy4oTSs8swsy4ouPpLEru65xoKc4i6wRd/iK6guDamB4tkAoD0yv4OigL8idpAahx8y/jvHDD9VVDIA+u5KypgeJ/KAJ20C9Mp34CiERTELtHEHX7zsbB2INDM6sJbhsUk7b8yBCC3E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715115102; c=relaxed/simple; bh=z/n9T5ppUUSRMEJ5Mi5N2EZQnWL+K906LwUS78beWj8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LDeyOww1EnrrOytuFk0cWoMH+0OYt8ZX0yPFIS1iZM1Mvg+eVB92mKWODkMLohjPpbSlWBMOPm6p4vwaDMhKv9W6468sEggxErBfF27IjkmIIpRV4K12ztrR6lM91SC4uo6O+dZWK1Pn36F00/rDd0HDFKfqTwYAi6mhv5slOEY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kd4LdPFK; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D09AAC2BBFC; Tue, 7 May 2024 20:51:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715115101; bh=z/n9T5ppUUSRMEJ5Mi5N2EZQnWL+K906LwUS78beWj8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kd4LdPFKe3oIqgyV71D/y1+ZeZ2T9zcbP2X//BfPtTyQ8046hjQhjV03/zzahOOxl D0blwrUJhhVoHvzFg+KvUbIUGkF3gTRqusOJOcDM/Q1GPiLieVT2ZsS2ZV24s1RE/I G6joQ5CyKd9Kj/W3X7QC7QRK1JfjenEEETXnoUep4rm++G4UCj0ghQ3gvqkoL6qQ3O Ma+CGG0o+1Zt20he+L6ZJf5THtuIZH2Ma37bHRzvMcmQXnMq4qrISenf41iOcyKc0k UKpbLlWcgsrDH7VOweK2jAqnpIMS+ECTE3AVL176gKNtbtZLP7B/kpOSCWuXxBP2wy gylmsXfYPsxPA== Date: Tue, 7 May 2024 17:51:38 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: Peter Zijlstra , Ingo Molnar , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Kan Liang , Oliver Upton , James Clark , Tim Chen , Yicong Yang , K Prateek Nayak , Yanteng Si , Sun Haiyong , Kajol Jain , Ravi Bangoria , Li Dong , Paran Lee , Ben Gainey , Andi Kleen , Athira Rajeev , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [PATCH v1 0/8] Address/leak sanitizer clean ups Message-ID: References: <20240507183545.1236093-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240507183545.1236093-1-irogers@google.com> On Tue, May 07, 2024 at 11:35:37AM -0700, Ian Rogers wrote: > Remove unnecessary reference counts for structs with no gets. Add > reference count checking to comm_str and mem_info. Fix memory leaks > and errors detected on "perf mem report" by address sanitizer and leak > sanitizer. Applied locally, doing build tests. Will soon go to tmp.perf-tools-next. - Arnaldo > Ian Rogers (8): > perf ui browser: Don't save pointer to stack memory > perf annotate: Fix memory leak in annotated_source > perf block-info: Remove unused refcount > perf cpumap: Remove refcnt from cpu_aggr_map > perf comm: Add reference count checking to comm_str > perf mem-info: Move mem-info out of mem-events and symbol > perf mem-info: Add reference count checking > perf hist: Avoid hist_entry_iter mem_info memory leak > > tools/perf/builtin-c2c.c | 13 +- > tools/perf/builtin-report.c | 3 +- > tools/perf/builtin-script.c | 12 +- > tools/perf/builtin-stat.c | 16 +- > tools/perf/tests/mem.c | 11 +- > tools/perf/ui/browser.c | 4 +- > tools/perf/ui/browser.h | 2 +- > tools/perf/util/Build | 1 + > tools/perf/util/annotate.c | 6 + > tools/perf/util/block-info.c | 22 +- > tools/perf/util/block-info.h | 15 +- > tools/perf/util/comm.c | 196 +++++++++++------- > tools/perf/util/cpumap.c | 2 - > tools/perf/util/cpumap.h | 2 - > tools/perf/util/hist.c | 62 +++--- > tools/perf/util/hist.h | 8 +- > tools/perf/util/machine.c | 7 +- > tools/perf/util/mem-events.c | 36 ++-- > tools/perf/util/mem-events.h | 29 +-- > tools/perf/util/mem-info.c | 35 ++++ > tools/perf/util/mem-info.h | 54 +++++ > .../scripting-engines/trace-event-python.c | 12 +- > tools/perf/util/sort.c | 69 +++--- > tools/perf/util/symbol.c | 26 +-- > tools/perf/util/symbol.h | 12 -- > 25 files changed, 370 insertions(+), 285 deletions(-) > create mode 100644 tools/perf/util/mem-info.c > create mode 100644 tools/perf/util/mem-info.h > > -- > 2.45.0.rc1.225.g2a3ae87e7f-goog