[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <759e5f85-354c-fdf0-f31d-5df90481d75e@linux.intel.com>
Date: Wed, 5 Jun 2019 14:48:45 +0800
From: Lu Baolu <baolu.lu@...ux.intel.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: baolu.lu@...ux.intel.com, David Woodhouse <dwmw2@...radead.org>,
Joerg Roedel <joro@...tes.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Christoph Hellwig <hch@....de>, ashok.raj@...el.com,
jacob.jun.pan@...el.com, alan.cox@...el.com, kevin.tian@...el.com,
mika.westerberg@...ux.intel.com, Ingo Molnar <mingo@...hat.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
pengfei.xu@...el.com,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Robin Murphy <robin.murphy@....com>,
Jonathan Corbet <corbet@....net>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Juergen Gross <jgross@...e.com>,
Stefano Stabellini <sstabellini@...nel.org>,
iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org,
Jacob Pan <jacob.jun.pan@...ux.intel.com>
Subject: Re: [PATCH v4 7/9] iommu/vt-d: Add trace events for domain map/unmap
Hi Steve,
On 6/4/19 5:01 PM, Steven Rostedt wrote:
> On Mon, 3 Jun 2019 09:16:18 +0800
> Lu Baolu <baolu.lu@...ux.intel.com> wrote:
>
>
>> +TRACE_EVENT(bounce_unmap_single,
>> + TP_PROTO(struct device *dev, dma_addr_t dev_addr, size_t size),
>> +
>> + TP_ARGS(dev, dev_addr, size),
>> +
>> + TP_STRUCT__entry(
>> + __string(dev_name, dev_name(dev))
>> + __field(dma_addr_t, dev_addr)
>> + __field(size_t, size)
>> + ),
>> +
>> + TP_fast_assign(
>> + __assign_str(dev_name, dev_name(dev));
>> + __entry->dev_addr = dev_addr;
>> + __entry->size = size;
>> + ),
>> +
>> + TP_printk("dev=%s dev_addr=0x%llx size=%zu",
>> + __get_str(dev_name),
>> + (unsigned long long)__entry->dev_addr,
>> + __entry->size)
>> +);
>> +
>> +TRACE_EVENT(bounce_map_sg,
>> + TP_PROTO(struct device *dev, unsigned int i, unsigned int nelems,
>> + dma_addr_t dev_addr, phys_addr_t phys_addr, size_t size),
>> +
>> + TP_ARGS(dev, i, nelems, dev_addr, phys_addr, size),
>> +
>> + TP_STRUCT__entry(
>> + __string(dev_name, dev_name(dev))
>> + __field(unsigned int, i)
>> + __field(unsigned int, last)
>> + __field(dma_addr_t, dev_addr)
>> + __field(phys_addr_t, phys_addr)
>> + __field(size_t, size)
>> + ),
>> +
>> + TP_fast_assign(
>> + __assign_str(dev_name, dev_name(dev));
>> + __entry->i = i;
>> + __entry->last = nelems - 1;
>> + __entry->dev_addr = dev_addr;
>> + __entry->phys_addr = phys_addr;
>> + __entry->size = size;
>> + ),
>> +
>> + TP_printk("dev=%s elem=%u/%u dev_addr=0x%llx phys_addr=0x%llx size=%zu",
>> + __get_str(dev_name), __entry->i, __entry->last,
>> + (unsigned long long)__entry->dev_addr,
>> + (unsigned long long)__entry->phys_addr,
>> + __entry->size)
>> +);
>> +
>> +TRACE_EVENT(bounce_unmap_sg,
>> + TP_PROTO(struct device *dev, unsigned int i, unsigned int nelems,
>> + dma_addr_t dev_addr, phys_addr_t phys_addr, size_t size),
>> +
>> + TP_ARGS(dev, i, nelems, dev_addr, phys_addr, size),
>> +
>> + TP_STRUCT__entry(
>> + __string(dev_name, dev_name(dev))
>> + __field(unsigned int, i)
>> + __field(unsigned int, last)
>> + __field(dma_addr_t, dev_addr)
>> + __field(phys_addr_t, phys_addr)
>> + __field(size_t, size)
>> + ),
>> +
>> + TP_fast_assign(
>> + __assign_str(dev_name, dev_name(dev));
>> + __entry->i = i;
>> + __entry->last = nelems - 1;
>> + __entry->dev_addr = dev_addr;
>> + __entry->phys_addr = phys_addr;
>> + __entry->size = size;
>> + ),
>> +
>> + TP_printk("dev=%s elem=%u/%u dev_addr=0x%llx phys_addr=0x%llx size=%zu",
>> + __get_str(dev_name), __entry->i, __entry->last,
>> + (unsigned long long)__entry->dev_addr,
>> + (unsigned long long)__entry->phys_addr,
>> + __entry->size)
>> +);
>
> These last two events look identical. Please use the
> DECLARE_EVENT_CLASS() to describe the event and then DEFINE_EVENT() for
> the two events.
>
> Each TRACE_EVENT() can add up to 5k of data/text, where as a
> DEFINE_EVENT() just adds around 250 bytes.
>
> (Note, a TRACE_EVENT() is defined as a
> DECLARE_EVENT_CLASS()/DEFINE_EVENT() pair)
Thanks for reviewing. I will rework this patch according to your
comments here.
>
> -- Steve
>
Best regards,
Baolu
>
>> +#endif /* _TRACE_INTEL_IOMMU_H */
>> +
>> +/* This part must be outside protection */
>> +#include <trace/define_trace.h>
>
>
Powered by blists - more mailing lists