Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1540376rwd; Tue, 16 May 2023 19:56:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4nqN98+9SvqZWhIvp00m7Lg5m4PaTVBJJozeSh/ZaprColHR5zN4sSoB3zcPX7n4CGK7JP X-Received: by 2002:a17:90b:4f89:b0:24d:f816:7952 with SMTP id qe9-20020a17090b4f8900b0024df8167952mr38262072pjb.5.1684292179148; Tue, 16 May 2023 19:56:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684292179; cv=none; d=google.com; s=arc-20160816; b=H8RMojg4uO25CTeh80iLALWh8KG5HvQ44Ktr8guT6+PkHOqD4dobrx8qiTPp8/xTxg lYw4tWx04Kh1v5kNRApsuVmtjAON3HvaM4SXukilWz++w37gbPp+9Ba8vcxQCCvMokrB YFY7c1aa7KoYSqnNEt2WKNrXPDHpV5DhUlvnKw1sI1EnavPeI5NdjZ+Ez+3FjhglJTBx k7KhjcPg6GWPwypbsQ735NFZm88euGlngmTdxLcN/4jxI9bXK4yiO21rDmSPhjD3Zest E89gc1TxSFiwKQgfWoWaxSrRYFiD2RysESLcFwtqNhWActOgvS3hgzKlBdUmCuAoiBW4 6Rww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=jd1CClrkuyTwmPY/mXbnZOlXelB1bE9jdEQDQdFyXYE=; b=Yl3+5cZLTPCb3gXZaVhnHaBwhpQ8gbNmwu9Dvjku6qmAjnV0/gxDTyrFP5bAoHlLo8 65UHQIhgwRil7ir/fw2y2PENirhK3tjyp9JB73eSqlBOEO25/mBGhnTtJbD79okVjlB1 oQbDmM3OKJR4kM5hZi1TQZWOHHVNeRPWLSitn3EVe+VBzjBkia/kpj8kks08jfB3BJ/1 Y0AqzyBFvpfDiQjHpDjAJ/WWMjlXLFG/Tb/VGxyTAuGMD7BOj2BEOWWCwm781QVSmSfN sl42WG3evzhyQRNSeR2n3ikioNBV+caojrKaKyEFOtqrTrzk2HCpzf3L5Ki+1Gb2ouf/ z7FQ== 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 x11-20020a17090a970b00b002498408b1c5si719396pjo.39.2023.05.16.19.56.07; Tue, 16 May 2023 19:56:19 -0700 (PDT) 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 S231801AbjEQCZE (ORCPT + 99 others); Tue, 16 May 2023 22:25:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231966AbjEQCY5 (ORCPT ); Tue, 16 May 2023 22:24:57 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8CD3D1FD4; Tue, 16 May 2023 19:24:45 -0700 (PDT) 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 191CA1FB; Tue, 16 May 2023 19:25:30 -0700 (PDT) Received: from a077893.arm.com (unknown [10.163.70.237]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 19CF03F793; Tue, 16 May 2023 19:24:39 -0700 (PDT) From: Anshuman Khandual To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com Cc: Anshuman Khandual , Mark Brown , James Clark , Rob Herring , Marc Zyngier , Suzuki Poulose , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , linux-perf-users@vger.kernel.org Subject: [PATCH V10 04/10] arm64/perf: Add branch stack support in struct pmu_hw_events Date: Wed, 17 May 2023 07:54:04 +0530 Message-Id: <20230517022410.722287-5-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230517022410.722287-1-anshuman.khandual@arm.com> References: <20230517022410.722287-1-anshuman.khandual@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 This adds branch records buffer pointer in 'struct pmu_hw_events' which can be used to capture branch records during PMU interrupt. This percpu pointer here needs to be allocated first before usage. Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- include/linux/perf/arm_pmu.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/linux/perf/arm_pmu.h b/include/linux/perf/arm_pmu.h index 0da745eaf426..694b241e456c 100644 --- a/include/linux/perf/arm_pmu.h +++ b/include/linux/perf/arm_pmu.h @@ -44,6 +44,13 @@ static_assert((PERF_EVENT_FLAG_ARCH & ARMPMU_EVT_47BIT) == ARMPMU_EVT_47BIT); }, \ } +#define MAX_BRANCH_RECORDS 64 + +struct branch_records { + struct perf_branch_stack branch_stack; + struct perf_branch_entry branch_entries[MAX_BRANCH_RECORDS]; +}; + /* The events for a given PMU register set. */ struct pmu_hw_events { /* @@ -70,6 +77,8 @@ struct pmu_hw_events { struct arm_pmu *percpu_pmu; int irq; + + struct branch_records *branches; }; enum armpmu_attr_groups { -- 2.25.1