From patchwork Thu Feb 2 12:26:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandipan Das X-Patchwork-Id: 4873 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp208455wrn; Thu, 2 Feb 2023 04:31:04 -0800 (PST) X-Google-Smtp-Source: AK7set92QjR6X98vChHHy+GBIMPzaQ8HIGrUwSdV1bUT6gkWQHg9SC4nhVc9FLCVZhWjoiA5zPbY X-Received: by 2002:a05:6a21:158e:b0:be:e450:69b3 with SMTP id nr14-20020a056a21158e00b000bee45069b3mr5356965pzb.0.1675341064517; Thu, 02 Feb 2023 04:31:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675341064; cv=pass; d=google.com; s=arc-20160816; b=O7s7NWrxjnDdCxzFDGf+7GiTisKH5G9K5vOnbCxrsaxNci7ai4ztW74jlarbfY+d+I hY4tCNKQFD6g2J//0QHYQUTOkMD9B5m9b42RRkQJhSNbxKxYsx13G9DD3M78uI7K/5Tm FH6zSPbzbB6FgfQPTekroVMhVdlRma0hzw78bVd6PPYF6HY77TfK6cPN9r3//X44Hjhs wlirueon1x98gxI0ASzmPVcWmnnL6ic7fb/UgVkKOGI57qkcyKGjtDbUbHj2/R9/50S2 jiBbuWeyamFEw3snxsF3WwRc9Rok3KXyulP2dNMW8CvXgNqCMWDHsDHD0zl/ZVFn0XN7 GpNQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=B+asTgOkATojkqnA/7qoh8wS6Y0zGNIsG//wHPO0zuw=; b=d36AL2/DBtYJB69iGEnmHJIyw1QC/+YgorYtBC51iHa8OXamMBu0NpQngzz1LjJsSj 5OktU2E4G7sssJuO6ZB3DqlDNQGPnEBzSllGphtRGU1RD+XeTP3guqtX90jlqx5f2vWJ yeNl/b1oGUKOptASqIPYjYjQwNnMJST2WFbj2OoPuWrTaEQyZk8O9h3Feo5vi6Mk8/c3 KCvh/haXaEGDLjwLRVD7tATgywWtf6oVrSQocb4ygbJan+jFU+L8xVJVNQ1Vmdgi5jo6 X3f1UEiz57aVUN5BnIWeUp0AiXGx9zqldh5DRvf8WMT6Cp8l4t7LPRPVa5fQ+eDzvI/B xMqA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=0eLLJtUK; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g8-20020a636b08000000b004b1fea396cdsi21930755pgc.641.2023.02.02.04.30.50; Thu, 02 Feb 2023 04:31:04 -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; dkim=pass header.i=@amd.com header.s=selector1 header.b=0eLLJtUK; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232002AbjBBM0i (ORCPT + 99 others); Thu, 2 Feb 2023 07:26:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229633AbjBBM0f (ORCPT ); Thu, 2 Feb 2023 07:26:35 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3813210E7; Thu, 2 Feb 2023 04:26:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y5KpUEQm9Irr892PzRiSWgTk32VrayOL4SXlcrLgDyVUK0G66Sf220RrKQQlxYriHUa1lPhaA26kH2VeTK6Lpj2p1S73Bv/ir/3den6Vwg9kK8Ai3iBMRgmdF/76rKooZmfgFFESYi+to53YVf/oBRx4iIPVM7TGNqSu0KM3HCJlMJ3sEJOLEKCYza6hiy3r/QOd1P7rE/XyrqktvZOxMq5MA1rWs4QjrB1qi+OMYNSLYvGGsg8TFuRoxxkvlE2WktZKAivklZtLCcl2OVv7efDEjfkRxmmJbEayTWIOz8tV94C/Lb6S0OoHkGO/O4UsG3tNkhkXP/3lOs2y6LvbSQ== 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=B+asTgOkATojkqnA/7qoh8wS6Y0zGNIsG//wHPO0zuw=; b=MOFB/dG3XGj08fRHH0apslULvzlqn6TBw2Tvgf5o0SNsIxuSai5DCFF3LQrEcrpRujpCy1f+JxtAQ/U/ZaPltLV5YIRnKuisQViUo+phFQU686Q84PJ+bpNrJb7YfpVcskpjFgpxMxfZIrVYPIePs8+FiRTLXOirB3AStQg3gZ900FAw/3AMLpLrZB0DfRIfyesJPpRD0vZBqc0H8ZPn2oY8iBhuEOO6WRft76RxkIKWNuE9aB1Fudw+ep+53uSnILGaxysL8HmfeMisY9FpQW/ZABihQ19PcevFwNNhPiWETWEj5Ir4JscbbjIAeNL4S72OaLOVQuvPMwmbk9k89A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.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=B+asTgOkATojkqnA/7qoh8wS6Y0zGNIsG//wHPO0zuw=; b=0eLLJtUK608ZhCtuZXOHbQe/7r5yC3wn4B2xWTOMQ8Qf1aSosrz+JFJYrnpecQ9yVHcoCdSCyQt7FZgH2VHmcrX4aEHr9ywD9VjbsohbvfxzkV/NeLn6GlYhKxFWbEy03ZVAmJvF4lJesPIsfygxggkPu+n+HWPyprnvXuGkKrI= Received: from DM6PR18CA0006.namprd18.prod.outlook.com (2603:10b6:5:15b::19) by SN7PR12MB6669.namprd12.prod.outlook.com (2603:10b6:806:26f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Thu, 2 Feb 2023 12:26:32 +0000 Received: from DS1PEPF0000E631.namprd02.prod.outlook.com (2603:10b6:5:15b:cafe::f4) by DM6PR18CA0006.outlook.office365.com (2603:10b6:5:15b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.27 via Frontend Transport; Thu, 2 Feb 2023 12:26:31 +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 DS1PEPF0000E631.mail.protection.outlook.com (10.167.17.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.17 via Frontend Transport; Thu, 2 Feb 2023 12:26:31 +0000 Received: from sindhu.amdval.net (10.180.168.240) 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, 2 Feb 2023 06:26:25 -0600 From: Sandipan Das To: , , CC: , , , , , , , , , , , , , , , , , , , Subject: [PATCH v4 0/4] tools perf: Add branch speculation info Date: Thu, 2 Feb 2023 17:56:13 +0530 Message-ID: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E631:EE_|SN7PR12MB6669:EE_ X-MS-Office365-Filtering-Correlation-Id: 8a543eba-3fa7-4014-55b6-08db0518b76d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AgIGaX8oSpODpzgTc/RfUHrIyFNqpEDZ3OJKckMLCQB51lUUhnISybVsf+p3obtMHPu1yLL9sTk7Csv/Cb4TN5dHnxAGZyJHMEdVAYLE8+tyVSh3yHz5cJzVamBlexMal4LYoNeCdhhm0f3OdYaZo7jairVXb6JtkGpi+zOupOp0mdQfIgjLnYH4WsF/uk+k8RSVNJPz7nZ2NYkZixN14kQ1FeRTmBPVJOGMxnmBdehwQj4A4cnX6V9EeS9B9eSuE48evIPsdiQ3wUGaHc9+jen9fdhksFUJhxYVZPp8WJXAiFpKU8DWiCLwjb4gfgkav5LsjaimCzdG53u5PVIvplwp+0h5GY6QdBJ2qryJwLoe90ZYr0pebLTTee7sVqtMnNh9h+d5Wv6PQ9I4zRYzvuGWHwkKyIf10i8Oh0319tIZUawyE4D27MnNl40MkTYUAiJ0IIFYfYfs2wtvOzF13f2kwsM9mn1N5U/gkWdytTvI3OX0C3IrFQkh/klRF1wy9OIfTKfEc368TCWQpUNZ9vovbOLJcNJ8orkDxrngitKZEDSX4w0ol5UUNN5yazBOOACsayOjvJXej0/GuW9vXN+YJa3alkgyx9P7EefhevVMDTKr9NWxDakBa1YTIt1OqCR1EEexZvPgwPVzJZvWk4wgcqRcHynLbXxvCBJCqrTjDAmxX6C8/ddcIC237GblvWZS+ZZLK+j5Xex1KSDit80Y0+ukGhJbl0/lvWCvmf/DpDk33w+4Vn7X90j3ILfIMagx2yJm/QGOrSiW7Hq9+4hiPc2DgiGtJvlLFuQTZH3QLNYzTzSVUp6Ba3t39paP 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:(13230025)(4636009)(39860400002)(346002)(376002)(396003)(136003)(451199018)(46966006)(40470700004)(36840700001)(41300700001)(336012)(81166007)(36860700001)(54906003)(110136005)(8936002)(86362001)(40460700003)(82310400005)(82740400003)(316002)(44832011)(2616005)(7416002)(5660300002)(356005)(40480700001)(426003)(47076005)(2906002)(36756003)(83380400001)(4326008)(966005)(478600001)(16526019)(6666004)(186003)(26005)(70586007)(70206006)(8676002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 12:26:31.7025 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8a543eba-3fa7-4014-55b6-08db0518b76d 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: DS1PEPF0000E631.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6669 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756722432082912841?= X-GMAIL-MSGID: =?utf-8?q?1756722432082912841?= AMD Last Branch Record Extension Version 2 (LbrExtV2) provides branch speculation information and the perf UAPI is extended to provide this in a generic way. Make perf tool show this additional information. The UAPI changes can be found in commit 93315e46b000 ("perf/core: Add speculation info to branch entries"). Requesting help from folks having access to big-endian systems to test changes in the sample parsing test as I was only able to test these in a ppc64 simulator. Previous versions can be found at: v3: https://lore.kernel.org/all/cover.1675057032.git.sandipan.das@amd.com/ v2: https://lore.kernel.org/all/cover.1664356751.git.sandipan.das@amd.com/ v1: https://lore.kernel.org/all/cover.1660217326.git.sandipan.das@amd.com/ Changes in v4: - Update tests that were failing due to changes in perf output and sample parsing (thanks to Arnaldo for reporting). Changes in v3: - Drop tools-side UAPI changes as they have already been added by other commits. - Rebase on top of latest perf/core. Changes in v2: - Drop msr-index.h related changes for now. - Rebase on top of latest perf/core. - Fix UAPI breakage introduced by the ARM64 BRBE changes to perf branch entry. Sandipan Das (4): perf script: Show branch speculation info perf session: Show branch speculation info in raw dump perf test sample-parsing: Update expected branch flags perf test brstack: Update regex to include spec field tools/perf/builtin-script.c | 5 +++-- tools/perf/tests/sample-parsing.c | 2 +- tools/perf/tests/shell/test_brstack.sh | 18 +++++++++--------- tools/perf/util/branch.c | 15 +++++++++++++++ tools/perf/util/branch.h | 2 ++ tools/perf/util/evsel.c | 15 ++++++++++++--- tools/perf/util/session.c | 5 +++-- 7 files changed, 45 insertions(+), 17 deletions(-)