Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp174334lqo; Wed, 15 May 2024 10:47:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVvO53qKnI+6ggcLVZtZb+mUraglbnpNHAepawYlZiem5QiQnV15yg1D38wW2TYB3lkaCs9qv+Sl564ScqXOYjcscZ7Mx2u7iF60mVMow== X-Google-Smtp-Source: AGHT+IG359c4b3TKPb6nTYIPYpFhkAITlOgCGCcWOpVYaivCjx/JGX1IfpWxQfZxEf5R4F1UW0zJ X-Received: by 2002:a05:6358:988d:b0:17c:263a:5b8e with SMTP id e5c5f4694b2df-193baf01ae1mr1657842855d.14.1715795255922; Wed, 15 May 2024 10:47:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715795255; cv=pass; d=google.com; s=arc-20160816; b=j6CURTOUio4M9Ab1Wn72J/65d8SzZd7OtEnpp9KTXsPxLNAhAKho4JKN1A8CIEJG59 ogmpB1liK1EF2m7Wc2sKwvYUNpX77sZQfY+Bd9bqvogTx4QjC+WxNrsOYA4k+XdNA+Oa T1NDSSKaMmLb5khUrOBj6rPFDxar4+W3am9tAY3i41lHUGycwLse+t3WQ5P6CXK1Mc+U fMWw+RrTzeiP9kFkC0qFAGcPjPVYkEMFPPIB/3NvFHR/viV8SENrc/0ucGeaH3LkQ5ui msWZBEqpFo9bAqpiGsZ2zbo0tdAzzO4pVRgcYkETeh0z82nnsTFCnkfQCEi/6IXhWExf A1nQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=/zCcP1X1di1bJ8igzkeKa8QLS6+W1fjEL6lp+hEgy6k=; fh=KNJ73094KrOuRU7VKl1zdT82fr/3p+6eqrTUYijLkZU=; b=SrwTFYk4BNTLFUq5QU9fG4VBXgCJNOkNKjnD079HW8/vAm5af7EeZx8j+fs/sNU/2F dU5fuahjmPO4Ngt3Oy5OaAQIO9BnWR7URxSLSDxwjmPbPq+FQVGQhnvpEDG9tAociPIn O6SeyPA3SK4/Yx0SIFxfGLDDJIKC12yajo0NVxle4Ak7Okh5GLqAmfSZcjfNc7cJqF8O Oim7OHxnzsXfsNFTGJQO0+cQc/KIyp8PPEU8dFWj9/CoyC9+V16rIekn2tuYyVWBzSxq r5xo0uHdFjH7rEq2Q7b//GmA9Wd1wjlyESimkQpaEtB2Vg4f4EqKwaAYIMPh0ZmzGSMf VmUw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=xYahn0dK; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-180228-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180228-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6340a06dec3si14739709a12.134.2024.05.15.10.47.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 10:47:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180228-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=xYahn0dK; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-180228-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180228-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id BAE14281414 for ; Wed, 15 May 2024 17:47:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B7AF6158868; Wed, 15 May 2024 17:47:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="xYahn0dK" Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66534158855 for ; Wed, 15 May 2024 17:47:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715795247; cv=none; b=pwpQEM7SLWZUHkZL6i3KCgJqY35mc8q8Z5ILpfaCvr3cbmj5ETlj1bimTHmqAt6EvxDx0iKr28271ZE9WV9p/caQbnPYFm6gHeocEl1CjAir9TgPosjOGG5rKK28oBLPzZ3c0TQLf3N2Fb7UUHG0O1nw/ljdZXaAeKFZfS7Kz+w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715795247; c=relaxed/simple; bh=/zCcP1X1di1bJ8igzkeKa8QLS6+W1fjEL6lp+hEgy6k=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ATjOHXwtBsyY17zhbJH6AiZbG+orfqas6Wf0A+hmCgvbICoUfQl4hhfWBmSqHfidUec1f3JGd6DiyfVKLMtgpT7hW8JZlmRuN+59ivBJCkY1Pi2uufG31yWCdsGUnyndm/S/7NEROJLl2nU0F9AgIjd7b6RoI7EsjVBKXRjBtrw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=xYahn0dK; arc=none smtp.client-ip=209.85.208.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5724736770cso28706a12.1 for ; Wed, 15 May 2024 10:47:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715795244; x=1716400044; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/zCcP1X1di1bJ8igzkeKa8QLS6+W1fjEL6lp+hEgy6k=; b=xYahn0dKtXhY820/F6CDXFoP2gqTb3Hyfibp5IhGBY3fywmEfVxRVozqL6hItqnjnO 73RLzB7KCmKM0I3TXcX/6+7KP/ldHnAKgdM57sUa2XOpDyDsCQGCBT/QAhjBWCgfm/V9 u27KFFgy07GkEfUxR4YN+0E6bH0YfVYZKH4RG1WXz4bVxJAUJGSGaxXNh5IVF/r5F0Lr 7DyJouQ+vssBpPZW2Qlx/9mMMOVzgCu4C4UpFSti3OYZkOL/j5JYtOSOt6b6GhsTF1/t jeuqic9Jwm+9EhQbl9/vwBfrxgxlRkOecOmKXKHIpZ6UHf4OnFBlF6olubIFhO5fAmzo qTaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715795244; x=1716400044; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/zCcP1X1di1bJ8igzkeKa8QLS6+W1fjEL6lp+hEgy6k=; b=gSXLfHIgUiEBma9z2l5tZTrQ3qImBjQ8rQEL7YA8xkG99Af8RJ8H1TscvQsfHWn/sB ndpA0XGmMvwrnJSrTkLeZbdVTlTYnX+fYIV0a8DEXisgbRLxfj7/UExh5Fjcxcbk+6o1 vYQsBKW6h+vfQU8iripIERY8UyVuVztZjAWwU/OBMe1imKXaQSNHT9ubDkcVAWeWyFUC lxFLwIfPJANB65YUaH3mkbHWVBBggZQpFBD6nMkFfGETnPL+3zQlQ83SGEHqy7UcpbkQ GVIFIhhnNlq9KPpQZjSaABTut24W6aap7sjxo/pGp9t8Dbno4/CO+mqCV9Pzp5AryO7H ONTQ== X-Forwarded-Encrypted: i=1; AJvYcCX1ScKodaqc1hs0JzilP1Ur52Q9Ik6qDhL7fSJXwcFDlQI9ymjw74i9vEu1NCo0O9IU7kPLXQNLOtGCVEYq3FEPizTey3qQzzSrRi+j X-Gm-Message-State: AOJu0YwBE8vp4a0HicKrVNe/u5Yr9eUZf7eP/VA+GM8EftZCFfq26ile SBedPFpBiBx3hJhwbenL0TI0sHlCOORxQqt2yi8YQexQJgXvGeLfqDeFbAEDgSOw1S8xADMihB+ hEpXrORB7zZWfF5nwTpcxChodAPSN45hegdU= X-Received: by 2002:a50:cb8c:0:b0:573:438c:778d with SMTP id 4fb4d7f45d1cf-574ae3c1280mr810495a12.1.1715795243503; Wed, 15 May 2024 10:47:23 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240510191423.2297538-1-yabinc@google.com> <20240510191423.2297538-4-yabinc@google.com> <20240515085840.GD40213@noisy.programming.kicks-ass.net> In-Reply-To: <20240515085840.GD40213@noisy.programming.kicks-ass.net> From: Yabin Cui Date: Wed, 15 May 2024 10:47:11 -0700 Message-ID: Subject: Re: [PATCH v4 3/3] perf/core: Check sample_type in perf_sample_save_brstack To: Peter Zijlstra Cc: Namhyung Kim , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, May 15, 2024 at 1:58=E2=80=AFAM Peter Zijlstra wrote: > > On Fri, May 10, 2024 at 02:29:58PM -0700, Namhyung Kim wrote: > > On Fri, May 10, 2024 at 12:14=E2=80=AFPM Yabin Cui = wrote: > > > > > > Check sample_type in perf_sample_save_brstack() to prevent > > > saving branch stack data when it isn't required. > > > > > > Suggested-by: Namhyung Kim > > > Signed-off-by: Yabin Cui > > > > It seems powerpc has the similar bug, then you need this: > > > > Fixes: eb55b455ef9c ("perf/core: Add perf_sample_save_brstack() helper"= ) > > Is this really a bug? AFAICT it just does unneeded work, no? It's not a bug. As I replied to Namhyuang, the powerpc code checks sample_type before calling perf_sample_save_brstack().