From patchwork Thu Jan 28 07:13:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Kevin(Yang)" X-Patchwork-Id: 12052139 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2B03C433DB for ; Thu, 28 Jan 2021 07:13:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 57BB664DD6 for ; Thu, 28 Jan 2021 07:13:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 57BB664DD6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5F5216E056; Thu, 28 Jan 2021 07:13:51 +0000 (UTC) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-eopbgr750085.outbound.protection.outlook.com [40.107.75.85]) by gabe.freedesktop.org (Postfix) with ESMTPS id 623006E056; Thu, 28 Jan 2021 07:13:50 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hm7h99mbuwq5Bna9IOlKxgHzLwMSoJy7bYR/hLNCRbjSgQdTrMqXMPV6j5br61KaUHyF8GgFiEcNyMAGaLQMpjuQ9hbilFhxjmdlf34z6DvK/VFFm/owzf73DQkJewi612N0b8H/tJyDO3/0LLl7zwb0ZLicSIkmMMNgS0zQQdGKi4SlAF6PxmLCwq4kRi9EUdOFonSlJIcAVAsLmo1p6KDx+lMA8EvUKZH7oPJ+vsoJyD0sEMl2T7dc4qbvEUVq1GCjU6A0yUDEKRpiOHuHaVGnX0/wH2uxyloGB5tJ8VN1hLVCy39DwAZt9Izg/E+efVGPPGSr5PLIjXkjkekTqg== 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-SenderADCheck; bh=opEqL04Lz7S2KaPyadY2SRKffhLvRbExcfDJvZchvTM=; b=kwgsQhRITdHcMMceNdyMC02mwe93/mdKGSe8B3vkYGJiMifpj4/lqoTZl9FxgNEmMPBiAYjdIMO9sXwjGFpgB+ZLOLJcMJOaXuNCrUacvikAcI5enYg0D8bTRnv5Ro7apSlwj1c5Oec2cRKvxaoXo2Js3RusX1bA714wIsFPmbPlx7LxPPpwwsKjoPLasoy+ynWwEPKzma6mxzo48KFkpFBi8wpjWaWawXV75vX1NQgEQ2kowk9QC6UxfhRjYQFOO4lH6WHlTUfKZe65FW5dZPyMviw6kHcQ4DIsSOk2By+a7Po1bgVKWPIRBq4vjtrx+gPaoO7HJbVmw1nhiEgimA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; 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=opEqL04Lz7S2KaPyadY2SRKffhLvRbExcfDJvZchvTM=; b=1kN+x+LZ2fcVr27YRGRhiC6ctNWRagdzzoIEKmOapCqw1cKIOgW/2aHu0X8d93Fu7PZ0YsO7pD+ZcabX+42Usk9PoQ9gCeg/Phx+yx0lqdXYukeVqkiKhR73gpC1ojvyY/tkoRuDgZiKd7th9UdeLl7X3/lqk6P3GLhK9ZAZ5pc= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none; lists.freedesktop.org; dmarc=none action=none header.from=amd.com; Received: from MN2PR12MB3022.namprd12.prod.outlook.com (2603:10b6:208:ce::32) by MN2PR12MB3280.namprd12.prod.outlook.com (2603:10b6:208:ad::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.11; Thu, 28 Jan 2021 07:13:48 +0000 Received: from MN2PR12MB3022.namprd12.prod.outlook.com ([fe80::709e:b0ae:fbde:fcc6]) by MN2PR12MB3022.namprd12.prod.outlook.com ([fe80::709e:b0ae:fbde:fcc6%7]) with mapi id 15.20.3784.019; Thu, 28 Jan 2021 07:13:48 +0000 From: Kevin Wang To: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [RFC PATCH 0/3] add ttm trace event support Date: Thu, 28 Jan 2021 15:13:19 +0800 Message-Id: <20210128071322.24313-1-kevin1.wang@amd.com> X-Mailer: git-send-email 2.17.1 X-Originating-IP: [58.247.170.245] X-ClientProxiedBy: HKAPR04CA0010.apcprd04.prod.outlook.com (2603:1096:203:d0::20) To MN2PR12MB3022.namprd12.prod.outlook.com (2603:10b6:208:ce::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from MZ01-CE0.amd.com (58.247.170.245) by HKAPR04CA0010.apcprd04.prod.outlook.com (2603:1096:203:d0::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.17 via Frontend Transport; Thu, 28 Jan 2021 07:13:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f2a51fb6-e582-428c-0354-08d8c35c41c0 X-MS-TrafficTypeDiagnostic: MN2PR12MB3280: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tBC9kq1ZS39ckliD/mTPKuVTWWenL2ew5mO9PGsFK7o7mvLTChhjvR1LfoB4NkPgQJL6b7yE/doF67hRQ6i45NcZWApNOJvVwIP4EgrMHVwtRhYbnyqsLxmKUuTxV+8IsJnzO6N/3Pm07aks1c3yXhOloVeEgWEk+t7Trpm/jT4v+vjmPDA5pC/eUw0om78MH7FI/1Wf0zMGStu62fqPNRP5T/ORPHcjntuptRmYbLtwUg18ql3vO45J6bja7EIM9Lz2p9Nlj6EHNsicN81RZ3kHxvg/G1stqfwQvcSU4+/Zw69Z8GyBP2VOPh6a5lGY95/NsZ8QuURCeZ9tddtAeRiV9YG20/sLRMF2EY5B5wKHPgQi/QhvIakZHROzpDtdlaUdtJGvEOBfNYHYnUiJJuvFxbh1JGKGA5hp49WipBE1TyAsJeBep3Tx5nwj+ws1VEqh2T/jPG3yjcwIUDUmE8nKsnUaMjiUgn4N8K0/qnfA5v+o+YHebVg7fN3XrgiVCizWnXtcFwDeXGU+9yGQzA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR12MB3022.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(136003)(39860400002)(396003)(366004)(376002)(186003)(450100002)(66946007)(2616005)(66556008)(66476007)(6486002)(26005)(316002)(8676002)(5660300002)(36756003)(8936002)(83380400001)(4744005)(1076003)(16526019)(2906002)(86362001)(478600001)(7696005)(6666004)(956004)(52116002)(4326008); D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os3oJBqYKflJN/CVSCXHwWOkicK2yML5vSc4EChThL/xWalqJPzuud X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: f2a51fb6-e582-428c-0354-08d8c35c41c0 X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3022.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jan 2021 07:13:48.4283 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: sIGPhUokbuPX98DN8mRiiyO0wcFguE/MmQS+WnsREL6b4ORv7eFJYlPkH0bW2/ub X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3280 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ray.huang@amd.com, christian.koenig@amd.com, Kevin Wang Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" the kernel ftrace can better help analyze the kernel running status. add some trace events to support TTM. add trace events list: ttm:ttm_bo_add_mem_to_lru ttm:ttm_bo_del_from_lru ttm:ttm_bo_move_mem ttm:ttm_bo_wait ttm:ttm_bo_evict ttm:ttm_bo_swapout ttm:ttm_bo_device_init ttm:ttm_bo_device_release ttm:ttm_bo_init_reserved ttm:ttm_bo_validate ttm:ttm_bo_release ttm:ttm_bo_mmap ttm:ttm_bo_vm_fault ttm:ttm_bo_vm_access ttm:ttm_shrink ttm:ttm_mem_global_reserve ttm:ttm_mem_global_free Kevin Wang (3): drm/ttm: add ttm bo trace event support drm/ttm: add ttm vm bo trace event support drm/ttm: add ttm mem trace event support drivers/gpu/drm/ttm/ttm_bo.c | 23 ++ drivers/gpu/drm/ttm/ttm_bo_vm.c | 12 +- drivers/gpu/drm/ttm/ttm_memory.c | 7 + drivers/gpu/drm/ttm/ttm_module.c | 3 + drivers/gpu/drm/ttm/ttm_trace.h | 469 +++++++++++++++++++++++++++++++ 5 files changed, 512 insertions(+), 2 deletions(-) create mode 100644 drivers/gpu/drm/ttm/ttm_trace.h