Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp3179598lqo; Wed, 15 May 2024 02:00:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWt0O2aUDQC3S8aegfuFkhOnVbnCn4GAqh7UmKsDvzfIMj/SjNA/r0kITDn48jBBw2qzAs1YKueHa8ZdihngaXBb7e6Dutjc0hIK8TBbw== X-Google-Smtp-Source: AGHT+IEuGZHaRSYdRM0Dt6kYVhSW9LtDH9HHRS4TrKDFvlpDL/rG8SuGZ/zFu/oyNp7t7VM5A7YR X-Received: by 2002:a05:6402:1bc6:b0:572:e81d:6e70 with SMTP id 4fb4d7f45d1cf-573328e4e6dmr14445860a12.15.1715763628939; Wed, 15 May 2024 02:00:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715763628; cv=pass; d=google.com; s=arc-20160816; b=0Vw7tYTF+Q4G9RyTlXth6T3AJTw4ZK2PHHhQ6Sf2fgjQj2bg26//tSrRXlGbGo85qY QXLTPhOC6Y4V2yezZ75i2w91hRmmVIASaXxqTbScJnfQ397yWv2bNCZirYcOhzQU4Hoh qXCqA4j/3X2WYahZ1uWt9gQbULljr47S1t8RlUNJL4RG4Z3TAoaGIvVIORIQTJ7Bd2sS p2LEKpmqYbWEdSq0m4UNeaw8qGPvUWJpgCsNgka9CIW+itRnGIwzsceZWht4LCSL839U 1Qiy/mBoaD5DzAuUV9iCB/mZVdN0MJsiEpwJL0TBKt4zRgrv8jJ4CUO49Pc7oT3Gclkv 2j9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bw07bIpSCJ/6547TDCpYtK4MhhGWZ4UOhTjbzZBecaw=; fh=5jMPbvexkA7LbnOLp+qZUSoKEHk4H2cyhiWwPJ98kLo=; b=Hyl/4wUhiMro1+qKZuPzKnRCQKQqFQOleuPozr7fSwAGo6yQa0UBWvkHbFAdWoImdx rn3UVL7rpraMtPk7yIAHObg8BeSJcbRNHEPnBxIPa+oWEBlirfu8boj5TrQrKmX+y6gE +gQmkJbpUKXk6wpvct1JSk1Wml9jm3js9jXl9bTupSie6Fro1/jv7SnrVP3O05bd4vCM 0OT9hbSoIA+IO8qd+rhNpRWDKg41v/PJHqFoteFE1+lsdOFjqj5D0SjCKqL1OxkXFrTx meOJkkDnBDpBl+t3tsxZzQ5v8pbaMAXClEhDMXc0NnE4rSZgJjAjFN0XvQIgmsFVPJzq zFZw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=X+PkpahR; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-179685-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179685-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-574cd64acbcsi3111338a12.246.2024.05.15.02.00.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 02:00:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179685-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=X+PkpahR; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-179685-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179685-linux.lists.archive=gmail.com@vger.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 am.mirrors.kernel.org (Postfix) with ESMTPS id A9CB41F23646 for ; Wed, 15 May 2024 09:00:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6A7E857C8A; Wed, 15 May 2024 08:58:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="X+PkpahR" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 5036B5A0F5; Wed, 15 May 2024 08:58:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715763528; cv=none; b=lGLDzoKutCX7O3upF4XBx/2GznfGADJPV6OGY63kFhnrgBqWmRxbEWVg/gqDtWr3P5HPLpeCLFcHy//gozk3pJsTNLUmXSpqUE0XknDqIVM+iJHA5lDU/5z7pohJjf1lll/4kegsBroMTh0uPsq91WGg86CAi5E4h3/9lDjvT50= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715763528; c=relaxed/simple; bh=mIm962IF10bdWS0VjUWThN6tROwBuUJv1m8MYht87Qs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=X1fdbe2XQQEnqlJ0sl6wRD61HRnYeRBWuvZrcs1yZlnbyIeGhKN32S3+Ap7YE/zf58/yRGctFFxTopT3Hcu+ImNTz3HkRPKj2Abzkw6Atcb4+kiLcsTAtfPylIf1YwC/XtTlcENaNNCQcqPm8iIMZCXTbUdVR7qONqDOlTCUUeY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=X+PkpahR; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=bw07bIpSCJ/6547TDCpYtK4MhhGWZ4UOhTjbzZBecaw=; b=X+PkpahRQrFnvf3SXhfKjeI5rP c7Km4Hfpcl06bjSZvd1AgoInaxPlctKsMtlsNqHOtFf6GGFdbk68VIwaFuKZbN6D48KFBQ8a41gMK aeLMpi6vtJB+nWe5i/aGk7XGoSKfrNGIorJvXuCQqbl8u79Nywsvq02vrypAGZ8j00mfBLYlo38Jh gvviAqOAqJUB0vNBVOWFZKinU40WNZu8bXUsBXz5ZP66LKyTXkOT8qvU3B8rQ0vVA/RuD6xsPOK2k fFaxd4sEX6gsbJ0pK1uoYRA1ykOnb1zbKZd1lwje1muDusiDnl6mFPC3yyB3wCdepJNGVX9yQPI0A pl8zH4kQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1s7ATA-0000000A8lu-1oQT; Wed, 15 May 2024 08:58:40 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 1C94630068B; Wed, 15 May 2024 10:58:40 +0200 (CEST) Date: Wed, 15 May 2024 10:58:40 +0200 From: Peter Zijlstra To: Namhyung Kim Cc: Yabin Cui , 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 Subject: Re: [PATCH v4 3/3] perf/core: Check sample_type in perf_sample_save_brstack Message-ID: <20240515085840.GD40213@noisy.programming.kicks-ass.net> References: <20240510191423.2297538-1-yabinc@google.com> <20240510191423.2297538-4-yabinc@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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, May 10, 2024 at 02:29:58PM -0700, Namhyung Kim wrote: > On Fri, May 10, 2024 at 12:14 PM 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?