From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CF3A3C43334 for ; Mon, 13 Jun 2022 12:17:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=f7L/lK7GQRueTyVAPL0HwuJ+oIB1w9/vg9hqVJec6b0=; b=KmHeGmnAsTuO+8ubxP3SOPSCGe 2nC0+teHfoYbZHMrr1Lng4Og3Udy5kihS0MUWNj6TGheUGujsWS+a2+piTAYGLE7Wc8N18uzlJnTP Ks3XLpMCvIQp1WHpvwhJZnbWd5PYqvJTCt3ZaY7kuLf3/G8gp58b5XCaD1LeL6RmUmWgJHKD6DXQN ko1PlhxAXq8dgq5ih87Z3w03ah8X/ADzcUI6cis0KBYbz+FE9Reh6JR5oncsycYMSrm6as5rK+9Xi fmCA4NRFQ5CQP1LPsQ/v4zcZgMMAIqdQwJ7wDrQ4esxYZoQAH01N6W1P8pKi1nGQ2Qg775Gc5EAIg fu9IVLSQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o0izk-003T0c-Nw; Mon, 13 Jun 2022 12:16:36 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o0izg-003Sxc-V9 for linux-arm-kernel@lists.infradead.org; Mon, 13 Jun 2022 12:16:34 +0000 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 7BDA0D6E; Mon, 13 Jun 2022 05:16:28 -0700 (PDT) Received: from [10.1.29.148] (e127744.cambridge.arm.com [10.1.29.148]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 512913F73B; Mon, 13 Jun 2022 05:16:25 -0700 (PDT) Subject: Re: [PATCH 7/8] arm64/perf: Add BRBE driver To: Anshuman Khandual , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, peterz@infradead.org, acme@kernel.org, mark.rutland@arm.com, will@kernel.org Cc: Catalin Marinas , James Clark , Rob Herring , Marc Zyngier , Ingo Molnar , linux-perf-users@vger.kernel.org References: <20220613100119.684673-1-anshuman.khandual@arm.com> <20220613100119.684673-8-anshuman.khandual@arm.com> From: German Gomez Message-ID: Date: Mon, 13 Jun 2022 13:16:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20220613100119.684673-8-anshuman.khandual@arm.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220613_051633_105043_B2DDBCA4 X-CRM114-Status: GOOD ( 14.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Anshuman, thanks for the update, As I mentioned offline, I have a perf test that I've been using for the branch records and filters. I'll let you know the result using this set. On 13/06/2022 11:01, Anshuman Khandual wrote: > [...] > > + > +static int brbe_fetch_perf_priv(u64 brbinf) > +{ > + int brbe_el = brbe_fetch_el(brbinf); > + > + switch (brbe_el) { > + case BRBINF_EL_EL0: > + return PERF_BR_PRIV_USER; > + case BRBINF_EL_EL1: > + return PERF_BR_PRIV_KERNEL; > + case BRBINF_EL_EL2: > + if (is_kernel_in_hyp_mode()) > + return PERF_BR_PRIV_KERNEL; > + return PERF_BR_PRIV_HV; > + default: > + pr_warn("unknown branch privilege captured\n"); > + return -1; This looks like it should return PERF_BR_PRIV_UNKNOWN. Thanks, German > + } > +} > + > +static void capture_brbe_flags(struct pmu_hw_events *cpuc, struct perf_event *event, > + u64 brbinf, int idx) > +{ > > [...] > > + > + if (branch_sample_priv(event)) { > + /* > + * All these information (i.e branch privilege level) are not > + * available for source only branch records. > + */ > + if (type != BRBINF_VALID_SOURCE) > + cpuc->brbe_entries[idx].priv = brbe_fetch_perf_priv(brbinf); > + } > +} > + > > [...] _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel