From patchwork Mon Nov 27 22:08:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 170439 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3499195vqx; Mon, 27 Nov 2023 14:11:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGYLClpXFa9UJ7O75sagPL7EYOpg3fdO+LG+7GhIvtHBl5Q/Q/qMAvqn+/czJkyZv6vrEgJ X-Received: by 2002:a05:6a20:daa8:b0:18b:914a:a81 with SMTP id iy40-20020a056a20daa800b0018b914a0a81mr15576527pzb.52.1701123073100; Mon, 27 Nov 2023 14:11:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701123073; cv=none; d=google.com; s=arc-20160816; b=KgI6b2gwcYE1lIEJVCU5L3LxmofZxu4008q/GtKCgb/4QT/I45lsbjaYZsiZfX14qN kbdPXd0iLcjdEcdNApGSC2SpCWLvPBVrACUv9E+rhyPAt4iaavZHIh8aNwAzdtZ0fKFA 0fZEtpX0V744eJ1s7k6S0bD+UjC7R25Yfex6qtEhJRq0ajSTcUIrrHKL1FIsl0MfxVlj hUMHvi4xezs0PaoJe3DtVKE2CGikedVFic4/NFeHenT5g2yUsLkEtj97mDR2iZ+pNW2S oDdBH3HFBQhsLPl7kzBobUvTqzI70q/wxVwo7mzpDitrcYbBYAypt+cFNEvpcPK/HJlR LYwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=WzfDI2A+Dhir6Mech0OT0IIjPNEDsBuzrIL0dTnaONc=; fh=Io7x3OacpefNRRNKoYAzVE0aWTDwD7FRzyCdD1e3AN4=; b=ZecnKr4/DerqIeSqaHVpwjVrdZDxEblZaIh+QxMRJSko2xcZxolDWvgC3OZ5fM0BVP nEFxGW1EESW7cm+Apx12uqI81tU+FzLAJ2k+KAAR2UPwQUAhRs9IpsGkHhRnqyEisw3G tGpqBq+m+rtI9/R9RlZc7LSLjenR4dcXGykUQNGxc1lhqr+H7tx3emmD89rRaBHSxvcM ysOP5nEeo2rtWQbREcIElOcz8Jh8smYBsNMsxbFlDR+oETjfJu1yw0pTUmxsB5znHO7J IfKzOIfJluNUOFIpP3kQl4WfV8rkALHhqSZYitzRy3R8SdqN/vCkyy+8AH62uWk749aZ X64A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=WPCl6vSI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id lr2-20020a17090b4b8200b0028037d7ed6csi11398923pjb.126.2023.11.27.14.11.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 14:11:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=WPCl6vSI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 33F738107562; Mon, 27 Nov 2023 14:11:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233635AbjK0WKy (ORCPT + 99 others); Mon, 27 Nov 2023 17:10:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233780AbjK0WKL (ORCPT ); Mon, 27 Nov 2023 17:10:11 -0500 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B3211FD5 for ; Mon, 27 Nov 2023 14:09:56 -0800 (PST) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-5d032ab478fso22182097b3.0 for ; Mon, 27 Nov 2023 14:09:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701122996; x=1701727796; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=WzfDI2A+Dhir6Mech0OT0IIjPNEDsBuzrIL0dTnaONc=; b=WPCl6vSIkYCmhmu5akCPCP2wiA+siWnPsU1ovqYyvnlCilvAj/f6d/b7vgwr+E/diC Ba6bBizXb1y82anhXo8OS5HdKsXpKCjA72oMgZuGAhFyaGlM6TMycIJBW9NdDAqdzyO9 te6IJFlwKLbAZxtZbDSSMlhAZfqszic+zOL7Ercp+Q3xfVjP1Mg/DeWRNDcNYsY8m4PE 5agcqzjazPelhn8a3OdtyzNGmjQHFNE1NUbmPvqx0AVDmc5rnl07tzOO47U5JmptxV37 HousULPdBYyjJfZUeAIy95e8Afl3enRxsd2XgUbJzEi8G5D9WLdQA+K+9FdqpMjMgOiB jL5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701122996; x=1701727796; 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=WzfDI2A+Dhir6Mech0OT0IIjPNEDsBuzrIL0dTnaONc=; b=IkPcVz+e3ihS2zH7oMNYhW8aoh7K1+wJzPCiUXPPAH5MqrjN2/cBApSDeeJCE/Tb1e jhdDMcIGgiUaAVAR55u9WSFj8ne+4K0aXBxuHc3of3tmi4yw2hO7nvtCBJaZ5D9rxwmw IwvCsECeAdlb5VBenc2zFzRiF2r2ZaP58voPVJYpYQIIV7/dG1mpMPtNqK4uQubDZmk2 iPkJj+UyYSpm+ar2jesl5SUFR9GeBiKosxh5fpm18/fs59kchQFhvAYhqxbP2HNrBa88 aAZSPSzCk7aTdfT0+M9CfkBQ9eAYlishvG1EAKY5cG15nBF9KfUd2Q2Bz1xC5VlbneAC Jz8Q== X-Gm-Message-State: AOJu0YxDtO/xRWiZkCOuuKS3Px/oULPykLcqICKFLNPtMZpApkhg8Et7 nJEJjH28RFgJtCPIIATuSomASvaWa2wM X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:829:6e77:9093:f39b]) (user=irogers job=sendgmr) by 2002:a05:690c:2e87:b0:5cc:3d0c:2b60 with SMTP id eu7-20020a05690c2e8700b005cc3d0c2b60mr369861ywb.4.1701122996145; Mon, 27 Nov 2023 14:09:56 -0800 (PST) Date: Mon, 27 Nov 2023 14:08:26 -0800 In-Reply-To: <20231127220902.1315692-1-irogers@google.com> Message-Id: <20231127220902.1315692-15-irogers@google.com> Mime-Version: 1.0 References: <20231127220902.1315692-1-irogers@google.com> X-Mailer: git-send-email 2.43.0.rc1.413.gea7ed67945-goog Subject: [PATCH v5 14/50] perf thread: Add missing RC_CHK_EQUAL From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Nick Terrell , Kan Liang , Andi Kleen , Kajol Jain , Athira Rajeev , Huacai Chen , Masami Hiramatsu , Vincent Whitchurch , "Steinar H. Gunderson" , Liam Howlett , Miguel Ojeda , Colin Ian King , Dmitrii Dolgov <9erthalion6@gmail.com>, Yang Jihong , Ming Wang , James Clark , K Prateek Nayak , Sean Christopherson , Leo Yan , Ravi Bangoria , German Gomez , Changbin Du , Paolo Bonzini , Li Dong , Sandipan Das , liuwenyu , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Guilherme Amadio X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 27 Nov 2023 14:11:09 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783756827533981029 X-GMAIL-MSGID: 1783756827533981029 Comparing pointers without RC_CHK_ACCESS means the indirect object will be compared rather than the underlying maps when REFCNT_CHECKING is enabled. Fix by adding missing RC_CHK_EQUAL. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim --- tools/perf/util/thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c index fe5e6991ae4b..b9c2039c4230 100644 --- a/tools/perf/util/thread.c +++ b/tools/perf/util/thread.c @@ -385,7 +385,7 @@ static int thread__clone_maps(struct thread *thread, struct thread *parent, bool if (thread__pid(thread) == thread__pid(parent)) return thread__prepare_access(thread); - if (thread__maps(thread) == thread__maps(parent)) { + if (RC_CHK_EQUAL(thread__maps(thread), thread__maps(parent))) { pr_debug("broken map groups on thread %d/%d parent %d/%d\n", thread__pid(thread), thread__tid(thread), thread__pid(parent), thread__tid(parent));