diff options
author | Zoltan Kiss <zoltan.kiss@citrix.com> | 2013-09-04 16:11:05 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-10-02 12:53:26 -0400 |
commit | 2b2b614dd24e4e6474fcf2dcf69c95c908838959 (patch) | |
tree | 9874899c477d237e1ec207834fc730c1151088f5 /drivers/xen/swiotlb-xen.c | |
parent | 04b772d2b819f0dda2163e3193fa7cd447a6245c (diff) |
tracing/events: Add bounce tracing to swiotbl
Ftrace is currently not able to detect when SWIOTLB has to do double buffering.
Under Xen you can only see it indirectly in function_graph, when
xen_swiotlb_map_page() doesn't stop after range_straddles_page_boundary(), but
calls spinlock functions, memcpy() and xen_phys_to_bus() as well. This patch
introduces the swiotlb:swiotlb_bounced event, which also prints out the
following informations to help you find out why bouncing happened:
dev_name: 0000:08:00.0 dma_mask=ffffffffffffffff dev_addr=9149f000 size=32768
swiotlb_force=0
If you use Xen, and (dev_addr + size + 1) > dma_mask, the buffer is out of the
device's DMA range. If swiotlb_force == 1, you should really change the kernel
parameters. Otherwise, the buffer is not contiguous in mfn space.
Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
[v1: Don't print 'swiotlb_force=X', just print swiotlb_force if it is enabled]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/xen/swiotlb-xen.c')
-rw-r--r-- | drivers/xen/swiotlb-xen.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index 1b2277c311d2..b31081007a81 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c | |||
@@ -42,6 +42,9 @@ | |||
42 | #include <xen/page.h> | 42 | #include <xen/page.h> |
43 | #include <xen/xen-ops.h> | 43 | #include <xen/xen-ops.h> |
44 | #include <xen/hvc-console.h> | 44 | #include <xen/hvc-console.h> |
45 | |||
46 | #define CREATE_TRACE_POINTS | ||
47 | #include <trace/events/swiotlb.h> | ||
45 | /* | 48 | /* |
46 | * Used to do a quick range check in swiotlb_tbl_unmap_single and | 49 | * Used to do a quick range check in swiotlb_tbl_unmap_single and |
47 | * swiotlb_tbl_sync_single_*, to see if the memory was in fact allocated by this | 50 | * swiotlb_tbl_sync_single_*, to see if the memory was in fact allocated by this |
@@ -358,6 +361,8 @@ dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page, | |||
358 | /* | 361 | /* |
359 | * Oh well, have to allocate and map a bounce buffer. | 362 | * Oh well, have to allocate and map a bounce buffer. |
360 | */ | 363 | */ |
364 | trace_swiotlb_bounced(dev, dev_addr, size, swiotlb_force); | ||
365 | |||
361 | map = swiotlb_tbl_map_single(dev, start_dma_addr, phys, size, dir); | 366 | map = swiotlb_tbl_map_single(dev, start_dma_addr, phys, size, dir); |
362 | if (map == SWIOTLB_MAP_ERROR) | 367 | if (map == SWIOTLB_MAP_ERROR) |
363 | return DMA_ERROR_CODE; | 368 | return DMA_ERROR_CODE; |