From: Tom St Denis <tom.stdenis-5C7GfCeVMHo@public.gmane.org>
To: "Christian König"
<deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] drm/amd/amdgpu: Add tracepoint for DMA page mapping
Date: Tue, 1 Aug 2017 08:29:01 -0400 [thread overview]
Message-ID: <21a75bbf-e9ca-e9e9-5831-e58908911e9b@amd.com> (raw)
In-Reply-To: <b4945fed-aea3-1b15-b383-26bc65307139-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
On 01/08/17 07:55 AM, Christian König wrote:
> Am 01.08.2017 um 13:51 schrieb Tom St Denis:
>> This helps map DMA addresses back to physical addresses.
>>
>> Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 28
>> ++++++++++++++++++++++++++++
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 8 ++++++++
>> 2 files changed, 36 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
>> index 509f7a63d40c..5b2bb28da504 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
>> @@ -14,6 +14,34 @@
>> #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(uint16_t domain, uint8_t bus, uint8_t slot, uint8_t
>> func, uint64_t dma_address, uint64_t phys_address),
>> + TP_ARGS(domain, bus, slot, func, 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)
>> + ),
>
> Better just give adev here and extract the values during the fast assign.
Easy enough, I've done this now.
>
>> + TP_fast_assign(
>> + __entry->domain = domain;
>> + __entry->bus = bus;
>> + __entry->slot = slot;
>> + __entry->func = func;
>> + __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 8da59d212b3b..1cf274603476 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> @@ -43,6 +43,7 @@
>> #include <linux/pagemap.h>
>> #include <linux/debugfs.h>
>> #include "amdgpu.h"
>> +#include "amdgpu_trace.h"
>> #include "bif/bif_4_1_d.h"
>> #define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT)
>> @@ -944,6 +945,13 @@ static int amdgpu_ttm_tt_populate(struct ttm_tt
>> *ttm)
>> ttm_pool_unpopulate(ttm);
>> return -EFAULT;
>> }
>> + trace_amdgpu_ttm_tt_populate(
>> + pci_domain_nr(adev->pdev->bus),
>> + adev->pdev->bus->number,
>> + PCI_SLOT(adev->pdev->devfn),
>> + PCI_FUNC(adev->pdev->devfn),
>> + gtt->ttm.dma_address[i],
>> + page_to_phys(ttm->pages[i]));
>
> Please add that tracing for the dma pool path as well.
>
> With that fixed the change looks good to me,
> Christian.
Unsure what you mean here. The ttm_pool_populate() seems to be
preparing the page list to back the request.
Tom
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2017-08-01 12:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-01 11:51 [PATCH] drm/amd/amdgpu: Add tracepoint for DMA page mapping Tom St Denis
[not found] ` <20170801115131.27610-1-tom.stdenis-5C7GfCeVMHo@public.gmane.org>
2017-08-01 11:55 ` Christian König
[not found] ` <b4945fed-aea3-1b15-b383-26bc65307139-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-08-01 12:29 ` Tom St Denis [this message]
[not found] ` <21a75bbf-e9ca-e9e9-5831-e58908911e9b-5C7GfCeVMHo@public.gmane.org>
2017-08-01 14:10 ` Christian König
[not found] ` <56a6ecd5-d210-cd71-0fc0-2d0ffd36ab00-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-08-01 14:26 ` Tom St Denis
[not found] ` <29f09f3b-154d-70d2-f5c6-315022b408ea-5C7GfCeVMHo@public.gmane.org>
2017-08-01 14:54 ` Christian König
[not found] ` <67a7f3ec-fd54-e997-75a0-4d6e3d2ff908-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-08-01 15:00 ` axie
[not found] ` <ae6e3523-dd8e-a14e-9bb2-297b0114bd5e-5C7GfCeVMHo@public.gmane.org>
2017-08-01 15:41 ` Christian König
[not found] ` <b38d7cac-533d-7029-f73f-445a92d6b952-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-08-01 15:56 ` Xie, AlexBin
[not found] ` <DM5PR12MB12572F535B64B97DF2C93C6EF2B30-2J9CzHegvk/NHlLGalgXawdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-08-01 16:26 ` Tom St Denis
2017-08-01 17:00 ` Tom St Denis
[not found] ` <8ba09a77-9bc6-35a1-8169-246a144430e8-5C7GfCeVMHo@public.gmane.org>
2017-08-01 18:25 ` Christian König
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=21a75bbf-e9ca-e9e9-5831-e58908911e9b@amd.com \
--to=tom.stdenis-5c7gfcevmho@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.