From patchwork Thu Dec 22 08:42:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Datta, Shubhrajyoti" X-Patchwork-Id: 13079521 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 7219AC4167B for ; Thu, 22 Dec 2022 08:44:15 +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:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=IiyxW5SzbphJUo9MEM6mhEXXVagqu2lc00Z4nIG5xk0=; b=2Oof7R+EdnLkHD SA/pnyt2hPhEH08yy7FT6a/YUuFyT2U1VQl59VSQSXOWA+qKKf9uD57pgrD77J7pX7heS6/VmX0hI 5xEi1QsTcNeFdDQ1G9U4ZjIzmqUVt9bwgQdUGqwkqjLw8VOV9ENI8d/OATH5FFRp94sjJcX3WhxbR qAJNabkSEn8/ZZHOPzLvMpoRy7WIeREIr3HmLZnvKFLnpMhef/SBD8gsi8Neo12EIF1S6O2kuTghf mX/07GUzn875pHdf9ty8I9AxefHiUeQgo7fJicnEy9ojABIAOpWkM4mq7LWA7WtgirYDn7cux/L3K BPX6vBA9zKpBeN2v0+4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p8HAA-0099Fw-Dy; Thu, 22 Dec 2022 08:42:50 +0000 Received: from mail-mw2nam12on2076.outbound.protection.outlook.com ([40.107.244.76] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p8HA5-00995U-Be for linux-arm-kernel@lists.infradead.org; Thu, 22 Dec 2022 08:42:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CIaQUH/ZV8YlzB/O+vY36fyldOQVst+MIIXx1dyi6FGyZTPKXSBfTbQd7l4qIzvmmFar80juYV61JVYqE7uhndtj1/SjbmuRJaVys/uxM6MZdhalJvyyQ8spGgQIr8HNfvPUnxUJVWpwu+iBdjZC7YzrZRkODZM9S73U8OHbLowBzEWftMT6BmTGGENvqW+LEfr7pOPq4UCfnUg83DEAcoXS8o99PNF55OoQwQDMDqmaxWRNCSgD21Kjpx1MxBceC8s1EgosxwAMKSLJsqnNaqaLbeJEYUtnvmpvyNU2Bw7fLbvVkKV+Ec/2oBdLEg+jlan1WdrquOSM0L6V2bQCNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uM3T9L2/jDeri9nhTkWpFTekXEYO3c3Am6xOjx+cUzQ=; b=OHntPJVTVo8UJEuG0zuqzIm4zOsofRwDdR/bdRMii8ARMIy+iJ0zHNc9eGnFZ/4GoZoLBoHKAlOrr+1IZ3lv5N7LYGw0sceJflEmCcA2VgJWSXIHq9O7hLa1nOUisF3HpH1ycXiyGPTvgSmT6ZFGe5umAmizd1Gcj2x61040Y2khAO2LT+KvFt9fwkuRenx1tEqwcH/tNG61oPNmkTrp6BopMG45G81EAQzT6zDOfkhTFnnxaBMpoVV7aT2lmzvbMddomHeeTIA9F0GOsXTAYkVBliYeT/rlGI9Lg+/a5HZNspYD95sNB7oNiur/lDLZFvKbX4pbFUuSz8NxD2404Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uM3T9L2/jDeri9nhTkWpFTekXEYO3c3Am6xOjx+cUzQ=; b=mHueaFNctYYVMihPSheGwNQ4lhpXt4v3/lmkf8AnY8Fr58ZyeS9bcCPyRuKus5Th4GXEM8GzRiVDFbaEvahovNCAJKHnp6To5qvIl/7VtXRYBZTjKdz/sVtNKsOGuwRUJQhuFuhgACngrxFD0FnMT2eMq+mtgA+PXGufJsbcgIA= Received: from MW4PR04CA0293.namprd04.prod.outlook.com (2603:10b6:303:89::28) by DS0PR12MB6559.namprd12.prod.outlook.com (2603:10b6:8:d1::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Thu, 22 Dec 2022 08:42:40 +0000 Received: from CO1NAM11FT035.eop-nam11.prod.protection.outlook.com (2603:10b6:303:89:cafe::23) by MW4PR04CA0293.outlook.office365.com (2603:10b6:303:89::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.21 via Frontend Transport; Thu, 22 Dec 2022 08:42:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT035.mail.protection.outlook.com (10.13.175.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5944.12 via Frontend Transport; Thu, 22 Dec 2022 08:42:39 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 22 Dec 2022 02:42:38 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 22 Dec 2022 00:42:37 -0800 Received: from xhdshubhraj40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Thu, 22 Dec 2022 02:42:36 -0600 From: Shubhrajyoti Datta To: CC: , , , , Subject: [PATCH v2 0/2] perf: Add xilinx APM support Date: Thu, 22 Dec 2022 14:12:33 +0530 Message-ID: <20221222084235.12235-1-shubhrajyoti.datta@amd.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT035:EE_|DS0PR12MB6559:EE_ X-MS-Office365-Filtering-Correlation-Id: 7e113225-684c-4acf-b089-08dae3f87be6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KT5ESyIKLLjGv7UIe4Hy4D1KufSogylIPXSTrqAUkwgDHXUYIEYptViPQEu0auL00f6rc8ZGuJ1MJCI+YrETUOvMI2V62Lls5my1Wt7A+09Kztt8gCmXrEbeDkhlR80Un12xjI1sJZK1EMs6SDmpOTUqorr1IW/psiIq69q3sHClKceH/zGiRPRkKRnxXQcdBqomizU/zsRlr4H75PbcSza+/PNJhIWsGgZpwiVJHKvwmA6PmrCXQvr2IiaDKzkKodG62WzL9pkFVje6InxOT9TKuJH2r9XVqZB9uapeWMqa4gADIHwunAR2t7Db67TFIHUssfjSkXC2Xj9Ck0khNyPzDpjWMTtL4KqQ2OTXb8tCV5n1WOm/yfFfpGJ20eFReNGbhUttpr/MZnohp8p1pupsaqVmO6a7ipSFlTzSTci+fKax6OuAlI9Henw+o/inaUJZ+mYBLpkX+8XkrLcLuZb+lzxdR8pb0aNwGf2YN9fFnR+iJe9ojxHWRcg2K96Biy5gCc6b4mlPFwcd8qgZpxh+IUQDXHv1U+xfTtjQ+sKpBw1n91o0yTBqmou7kAP7fRftoaOX9GV0UBg+St8ilIcHKOyaju0GYbtd4qx1resy/7C0daZkubBUbxmSoZun601gbu1BC3/1KhWBzhJChMmyVid/5GI4z711d+Vug6wbmMSOXuIf1x6tNjo8xXaEFJv3EvA9TYnxEm2dS8iVhgbHvHH2xaqdJwyUq2m4xjZqUK1+9301scNnrs8Vt0rckCT+jg5EYM0f1UcEuYEk2Q== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(346002)(39860400002)(376002)(136003)(396003)(451199015)(46966006)(40470700004)(36840700001)(86362001)(70586007)(40460700003)(70206006)(4326008)(8676002)(316002)(5660300002)(2616005)(36756003)(8936002)(1076003)(82310400005)(6666004)(41300700001)(36860700001)(426003)(26005)(356005)(186003)(47076005)(336012)(83380400001)(54906003)(6916009)(82740400003)(478600001)(81166007)(966005)(40480700001)(44832011)(2906002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Dec 2022 08:42:39.4738 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7e113225-684c-4acf-b089-08dae3f87be6 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT035.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6559 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221222_004246_242411_C7C03147 X-CRM114-Status: GOOD ( 14.56 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The programmable AXI performance monitors (APM) collect real-time transaction metrics at multiple points on the PS AXI interconnect to help system software profile real-time activity. In our platform we have it in PL and also some of the hardened instances in PS. Perf is a profiler tool for Linux 2.6+ based systems that abstracts away CPU hardware differences in Linux performance measurements and presents a simple commandline interface. Perf is based on the perf_events interface exported by recent versions of the Linux kernel. Therefore we register to the framework for the APM. The IP has support for multiple slots and ranges that we are supporting by extending the sysfs interface. Datasheet: https://docs.xilinx.com/v/u/en-US/pg037_axi_perf_mon Also the Hardened instances described in AXI Performance Monitor of ug1085. Changes in v2:  - Use boolean for the values xlnx,enable-profile , xlnx,enable-trace and xlnx,enable-event-count - Update the file name - use generic node name pmu - Fix a warn Shubhrajyoti Datta (2): dt-bindings: Add the binding doc for xilinx APM perf: Add xilinx APM support .../bindings/perf/xlnx,axi-perf-monitor.yaml | 133 ++++ drivers/perf/Kconfig | 11 + drivers/perf/Makefile | 1 + drivers/perf/xilinx_apm.c | 666 ++++++++++++++++++ 4 files changed, 811 insertions(+) create mode 100644 Documentation/devicetree/bindings/perf/xlnx,axi-perf-monitor.yaml create mode 100644 drivers/perf/xilinx_apm.c