Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp377934rwb; Wed, 9 Nov 2022 03:51:45 -0800 (PST) X-Google-Smtp-Source: AMsMyM70UbY2rE6/NKjSv82BUUb0BzDVNLDNwnZxJnPvuoN0UtRfXmHNgfofTNiAR7+53B4BaD/W X-Received: by 2002:a05:6a00:15c3:b0:56d:4ae4:e1e7 with SMTP id o3-20020a056a0015c300b0056d4ae4e1e7mr53682011pfu.23.1667994705133; Wed, 09 Nov 2022 03:51:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667994705; cv=none; d=google.com; s=arc-20160816; b=m95wwUA4gvPTYXY0eMwxYfl3nn1CovJ3W3ej9RkbQhbBn/iUvQvdOIXiSCZdjf/MwW jc7Qt4RlJz04oWFMYSmK4on8dEvYCV1qqjraJ5gpXx5EfwaGkkBamZrjKH72PjhpxEwG LCeNbIJBX9hjWxs6Us2BYPXLp2eJuuHgPMZ0F8U65TTwD76azFQCVwfsJdDIQvF83D89 SJT8GkZ87W7iGwz2J27zhTKwFIY9Drlg8hA2HhJJCn9HujSSapsjGZQZE7fHZ3xKfMDj nPzPcHIzYd1PWFMX19ANv9j8tf1ZhSChedu60tYg8MfBZqc85l9YLEpl+3rXGGjEJOnZ p59Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=8ty86dzyatTGKy5T98ZiamjxeIELgL8K3lxjgQXZlYM=; b=X1LJ0vXde8U+JLGJLTBOEtQ/xAzVv9jpOuHlLoUIZTd/vD4aUaAX5smxY6jf7s+T4Q VsMtM3kGHLRD3sjC/QuE+ItBWt2LvHXGWjOPDkNKxtXKhrSM1avgF+UadxHWhbEYuDn5 sMNnhGCQFi2upQI/IPf65XZYSBGHMfzJUnq8wgYpWhpTU+kjyz5ZdnAuH92yHQJ76+2q CCVXfvfVXSLwKFVlAWG7yKIIIcL0OwJ9Mhsaip2sBfSkk/gqmad8AsSgZVBZsj/TB6Ak xmQTOtoDSG67zlv6WZAngEp5apZnNG/f2zLCUQa7oBuTZ86870PLydCepWX8LDPMrvEL DoGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k195-20020a633dcc000000b0046f75bc53d0si17980833pga.241.2022.11.09.03.51.33; Wed, 09 Nov 2022 03:51:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229579AbiKILap (ORCPT + 93 others); Wed, 9 Nov 2022 06:30:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbiKILan (ORCPT ); Wed, 9 Nov 2022 06:30:43 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CC1561CFF5; Wed, 9 Nov 2022 03:30:41 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 445581FB; Wed, 9 Nov 2022 03:30:47 -0800 (PST) Received: from [10.1.36.52] (FVFF763DQ05P.cambridge.arm.com [10.1.36.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 60D5A3F534; Wed, 9 Nov 2022 03:30:39 -0800 (PST) Message-ID: <8f6d3424-2650-8e8b-61f7-1431aec4633b@arm.com> Date: Wed, 9 Nov 2022 11:30:38 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH V5 2/7] arm64/perf: Update struct arm_pmu for BRBE To: Anshuman Khandual , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, peterz@infradead.org, acme@kernel.org, mark.rutland@arm.com, will@kernel.org, catalin.marinas@arm.com Cc: Mark Brown , James Clark , Rob Herring , Marc Zyngier , Ingo Molnar References: <20221107062514.2851047-1-anshuman.khandual@arm.com> <20221107062514.2851047-3-anshuman.khandual@arm.com> From: Suzuki K Poulose In-Reply-To: <20221107062514.2851047-3-anshuman.khandual@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/11/2022 06:25, Anshuman Khandual wrote: > Although BRBE is an armv8 speciifc HW feature, abstracting out its various > function callbacks at the struct arm_pmu level is preferred, as it cleaner > , easier to follow and maintain. > > Besides some helpers i.e brbe_supported(), brbe_probe() and brbe_reset() > might not fit seamlessly, when tried to be embedded via existing arm_pmu > helpers in the armv8 implementation. > > Updates the struct arm_pmu to include all required helpers that will drive > BRBE functionality for a given PMU implementation. These are the following. > > - brbe_filter : Convert perf event filters into BRBE HW filters > - brbe_probe : Probe BRBE HW and capture its attributes > - brbe_enable : Enable BRBE HW with a given config > - brbe_disable : Disable BRBE HW > - brbe_read : Read BRBE buffer for captured branch records > - brbe_reset : Reset BRBE buffer > - brbe_supported: Whether BRBE is supported or not > > A BRBE driver implementation needs to provide these functionalities. Could these not be hidden from the generic arm_pmu and kept in the arm64 pmu backend ? It looks like they are quite easy to simply move these to the corresponding hooks in arm64 pmu. Suzuki