From patchwork Fri Aug 18 14:03:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "StDenis, Tom" X-Patchwork-Id: 9909439 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3650A60382 for ; Fri, 18 Aug 2017 15:37:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 230A828CF4 for ; Fri, 18 Aug 2017 15:37:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17EB228CFD; Fri, 18 Aug 2017 15:37:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 97BC828CF4 for ; Fri, 18 Aug 2017 15:37:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B37876E735; Fri, 18 Aug 2017 15:37:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0050.outbound.protection.outlook.com [104.47.38.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id 416826E735 for ; Fri, 18 Aug 2017 15:37:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=zuz5kRqbcb20CuSoRuFVaURs/ytxpx83e6MSLVCS8go=; b=zeDp919F5uOVlTrVOloAy/CdweOIwWNBtMdl4j6MGqHiCTucopog0vObH/p3CaNNuF9nFABqRYpslrO2x6ujXhU205s9vo25YMrGv5kA38yCCgLJgNnPP5dnNE8p9nse6av1BiNmqFYreaqLE7gxeZ5YKF82jn1hI28VfXFSsXA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Tom.StDenis@amd.com; Received: from fx8.amd.com (165.204.55.251) by CY4PR1201MB0071.namprd12.prod.outlook.com (10.172.77.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1362.18; Fri, 18 Aug 2017 14:03:35 +0000 From: Tom St Denis To: amd-gfx@lists.freedesktop.org Subject: [PATCH 2/2] drm/amd/amdgpu: Remove AMDGPU tracepoint and use new TTM tracepoint (v2) Date: Fri, 18 Aug 2017 10:03:24 -0400 Message-Id: <20170818140324.6849-2-tom.stdenis@amd.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170818140324.6849-1-tom.stdenis@amd.com> References: <20170818140324.6849-1-tom.stdenis@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.55.251] X-ClientProxiedBy: CY4PR06CA0058.namprd06.prod.outlook.com (10.175.122.148) To CY4PR1201MB0071.namprd12.prod.outlook.com (10.172.77.146) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 27d30750-98c6-4ee9-dee9-08d4e641eb72 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY4PR1201MB0071; X-Microsoft-Exchange-Diagnostics: 1; CY4PR1201MB0071; 3:iob3HGQGTxSDxL0B7WVLNR0pcS3T8pVzUrmM7ZTd9IrCeITu2b8ltHwSZZyXedR+jNJ4D4utC9VIt3mONibvu7r5EvNE8RW6grcd6NmpuVWOSBnlyRUidhkzdJVDBsVgIys0uiekqRV8PH4z4S2YD7IncLYhn/dhU+CwoPcOA6nTY9radKGtrYw7Jmkfi1WGYhX4Pr+kE7saSnZ2zsoL+6QUaoITgZLR7f/cMLV9fFxmfYDW0hC9yVx+dndzhOFl; 25:Uej5Twlx6n4dMDu81dAKgw6b2cfGTUB7EfVS8qph1FoLZTmUm761Mv6aEzODGzRWyCalt8ExDxxxZ3Ux2gmUI4n/Xm2XlUEFoB3HkzBSPhzuJrHhA1+C20CcagXT17OJt/gaRwZmiO4ad29WKFm4xyQUaI1v1CTp++6ivm4+2Tys7hayVekR5YSm3EyB+d3jaR87AXSJhoiaqA4rgJr++cu3L3htyYsuBs7J1KF9AewU6gfDSklKkNQUJBcznI7QdEF8hI4GqkLcQGm0g2YKx98EOTimL7vgwJXEFUyjrfMNjfkphHRdHbNP7bP7/mmfN2vPyUBYPBjv5eleRPDcpA==; 31:zDMLZh5n1G/QRBfmUmSnB4Ycf3L43sUeLEdpQTi6lylxNLISpJ6sGqfMLCr0BePSVctsgNfsdUUb8/SxfHU7mpyfzdXdToxzYfZRAdijFlxayCqXBU/ZuRNbmAPl53gT9o9ztSRMASrNnQbItGdwINQGDC7Uh5+GBSLJRH+ekJZDIR6dh0tLJfTTPc+qFomk5iIe+M0Mw/wn3spDptDujgkulTbOPF8NuSS6FNPhgfk= X-MS-TrafficTypeDiagnostic: CY4PR1201MB0071: X-Microsoft-Exchange-Diagnostics: 1; CY4PR1201MB0071; 20:EHey2flQL4Ir6Eio7XKG5d4bN5C/G+xrxCxIycxUjCWy2GC2Dq9rlYYB0E/8NKLc3/Q45u7bKBg9ZKJKcBWy7mSAL6e1oTC6Eoef6uMFItxbbYI6m36/XMe5+71zBD8k/nfHW2EcjHr3xcsRF/KI1HCoQ6zK9qolDDHyAz8jqgC+so/4qiLLeFYz2h7q7dHF9sg3Qb71zgjBR3NNike4B8W/3mCxf9hHq0/MZKjNzyrFFOBua2ntWJXZ876bwTOArVJBdsuvNmXRvKFimkGMQG/4MdTXvay+faZqdk9wcwo9ESA6vAB70r1unoeljtPx1xnXfsePdynycJdCv1gbMJJgwgawbZUjb3iTLqXoN1xNp6SCwYocS2NowUXxKFQTQLRePNYkmtm5q9mwGmcELwH2SuPrTjkxjh6o0Ri96QKhbEYDU53EILRXph01jtdiVVXwknfpUxMxxa4nQOT4k/K5GT2fJ7/hSuUmE1THXEFnlMVexAbvtYrkFpAokHEk; 4:YA2E48ov4J3PQ6CwYBLFEqTlgwOBd2NdWfWPAFg03nbG0NtfoCXvCS9fvqK9d9yBehOpyN/BCz6/8uwJdeUI0J3T92WnWqY0pnbn9xj4Dpni/XHXOxnFOR4dy9nENZm1gsOYt5fYg3TXUK8YKqu3eyGr2ryRjIhyavC8Be2Gs1bFwt6itnM1FIFGvy5jDea+BHlT5ykJeDVA3f8aTjwGsisnvgn7Ni4DZH6PyUn3j/tQzYrn7sAT1KHsFRhkEwwRI99vV67mLeSd18Sh6CmoW9xktHBemOyw67fjY0kxqso= X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123558100)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR1201MB0071; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR1201MB0071; X-Forefront-PRVS: 040359335D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(39860400002)(189002)(199003)(50466002)(1076002)(53936002)(23676002)(189998001)(2906002)(3846002)(33646002)(305945005)(86362001)(7350300001)(25786009)(5660300001)(36756003)(2870700001)(6116002)(478600001)(575784001)(450100002)(97736004)(6486002)(72206003)(66066001)(101416001)(50986999)(47776003)(4326008)(76176999)(53416004)(6666003)(6916009)(42186005)(2950100002)(105586002)(106356001)(110136004)(7736002)(8676002)(81156014)(50226002)(68736007)(81166006)(2351001)(2361001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1201MB0071; H:fx8.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyMDFNQjAwNzE7MjM6M1dMRXNKY2pESVRiVUN1Q1FqM1d6Uytu?= =?utf-8?B?YjVvUkVvM0I0Z0tlcFdQak14cHNnSTVxcjhwd2Y1VHJyU290eXFSd3hWK1lo?= =?utf-8?B?MG5ULzBmMEk1MWx1VWRXWmh6WmZIZXovK1lucSticXgzRVI1dGowYlVMS25E?= =?utf-8?B?cUpWVy9EdjRsUzBhT2ZZMWk3SERyTHRCbHRGTFNHcXhhbkRJZjUyc2ZBZjJG?= =?utf-8?B?a2ZSekl6MnQ4SnZZcnFpUllBWTA5R24rTXhUR3h3OFhtbU4zQk9HMlduNnZO?= =?utf-8?B?NlpBYWJDUGUwNUZpbXk5L21nengyU0toZ01DUlhEVzNtU0pYNmZQaGdvbjRU?= =?utf-8?B?c1FiNEVzUmt6cXZsbW5obk1Dai8vaWNycElESCtlL29mWFBIZGNqTDFqNTNU?= =?utf-8?B?Rk00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dzHSOBEMi7FjK0mn5Yxl/gNWRSCbOxj7gEv5jsOLz24yAhzZGQRyWHixl4OamTLUxBlxBPn8fot5v0MmUlQiGmnGEAn92npU2HRZ+rCjfZse0zjRxj2I5VHZ7pg1aufZ8uRjI68ve0MilZqmkcidaSnor9vx58RkHQ/NCbs/6cAq7Qhy0E7u5eqYobQ5SQrZkja4ExUNKp5kGpf6G7hY7k= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR1201MB0071; 20:XR7W9LBWLXLRpcnaYeVHsimbJezgWFksmdqyzEvaoARDfl1MchzD+O1G05tBPS9aN3951EUgyfuMhOKWLOT94hqa3RFKTMiAKCy3gz7Od3dae8LLitk84jukNKPlrjcQrvnPC+dUInsInLiXJO4GM+2+rureRLYF2XZ7k/FN/UmA8i4QJ2o3PU5zeArCmor/TNveou6oO46jXBJwlkkWcMHKM6yzc8CAG6XswkRmBnQsV5xc2DgNUXdzhXIPt0ZI X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2017 14:03:35.8362 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0071 Cc: Tom St Denis , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Switches the AMDGPU driver over to the TTM tracepoint and removes our old one. Now you can enable traces before loading the module and trace all mappings. Signed-off-by: Tom St Denis Reviewed-by: Christian König (v2): Use struct device instead of pci in trace. --- drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 56 ------------------------------- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 21 ++---------- 2 files changed, 3 insertions(+), 74 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h index 1c88bd5e29ad..b1f97417241d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h @@ -14,62 +14,6 @@ #define AMDGPU_JOB_GET_TIMELINE_NAME(job) \ job->base.s_fence->finished.ops->get_timeline_name(&job->base.s_fence->finished) -TRACE_EVENT(amdgpu_ttm_tt_populate, - TP_PROTO(struct amdgpu_device *adev, uint64_t dma_address, uint64_t phys_address), - TP_ARGS(adev, dma_address, phys_address), - TP_STRUCT__entry( - __field(uint16_t, domain) - __field(uint8_t, bus) - __field(uint8_t, slot) - __field(uint8_t, func) - __field(uint64_t, dma) - __field(uint64_t, phys) - ), - TP_fast_assign( - __entry->domain = pci_domain_nr(adev->pdev->bus); - __entry->bus = adev->pdev->bus->number; - __entry->slot = PCI_SLOT(adev->pdev->devfn); - __entry->func = PCI_FUNC(adev->pdev->devfn); - __entry->dma = dma_address; - __entry->phys = phys_address; - ), - TP_printk("%04x:%02x:%02x.%x: 0x%llx => 0x%llx", - (unsigned)__entry->domain, - (unsigned)__entry->bus, - (unsigned)__entry->slot, - (unsigned)__entry->func, - (unsigned long long)__entry->dma, - (unsigned long long)__entry->phys) -); - -TRACE_EVENT(amdgpu_ttm_tt_unpopulate, - TP_PROTO(struct amdgpu_device *adev, uint64_t dma_address, uint64_t phys_address), - TP_ARGS(adev, dma_address, phys_address), - TP_STRUCT__entry( - __field(uint16_t, domain) - __field(uint8_t, bus) - __field(uint8_t, slot) - __field(uint8_t, func) - __field(uint64_t, dma) - __field(uint64_t, phys) - ), - TP_fast_assign( - __entry->domain = pci_domain_nr(adev->pdev->bus); - __entry->bus = adev->pdev->bus->number; - __entry->slot = PCI_SLOT(adev->pdev->devfn); - __entry->func = PCI_FUNC(adev->pdev->devfn); - __entry->dma = dma_address; - __entry->phys = phys_address; - ), - TP_printk("%04x:%02x:%02x.%x: 0x%llx => 0x%llx", - (unsigned)__entry->domain, - (unsigned)__entry->bus, - (unsigned)__entry->slot, - (unsigned)__entry->func, - (unsigned long long)__entry->dma, - (unsigned long long)__entry->phys) -); - TRACE_EVENT(amdgpu_mm_rreg, TP_PROTO(unsigned did, uint32_t reg, uint32_t value), TP_ARGS(did, reg, value), diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 26665b4baf36..38d26a7d5d0d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -667,32 +668,16 @@ static void amdgpu_trace_dma_map(struct ttm_tt *ttm) { struct amdgpu_device *adev = amdgpu_ttm_adev(ttm->bdev); struct amdgpu_ttm_tt *gtt = (void *)ttm; - unsigned i; - if (unlikely(trace_amdgpu_ttm_tt_populate_enabled())) { - for (i = 0; i < ttm->num_pages; i++) { - trace_amdgpu_ttm_tt_populate( - adev, - gtt->ttm.dma_address[i], - page_to_phys(ttm->pages[i])); - } - } + ttm_trace_dma_map(adev->dev, >t->ttm); } static void amdgpu_trace_dma_unmap(struct ttm_tt *ttm) { struct amdgpu_device *adev = amdgpu_ttm_adev(ttm->bdev); struct amdgpu_ttm_tt *gtt = (void *)ttm; - unsigned i; - if (unlikely(trace_amdgpu_ttm_tt_unpopulate_enabled())) { - for (i = 0; i < ttm->num_pages; i++) { - trace_amdgpu_ttm_tt_unpopulate( - adev, - gtt->ttm.dma_address[i], - page_to_phys(ttm->pages[i])); - } - } + ttm_trace_dma_unmap(adev->dev, >t->ttm); } /* prepare the sg table with the user pages */