swiotlb.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM swiotlb
  4. #if !defined(_TRACE_SWIOTLB_H) || defined(TRACE_HEADER_MULTI_READ)
  5. #define _TRACE_SWIOTLB_H
  6. #include <linux/tracepoint.h>
  7. TRACE_EVENT(swiotlb_bounced,
  8. TP_PROTO(struct device *dev,
  9. dma_addr_t dev_addr,
  10. size_t size,
  11. enum swiotlb_force swiotlb_force),
  12. TP_ARGS(dev, dev_addr, size, swiotlb_force),
  13. TP_STRUCT__entry(
  14. __string( dev_name, dev_name(dev) )
  15. __field( u64, dma_mask )
  16. __field( dma_addr_t, dev_addr )
  17. __field( size_t, size )
  18. __field( enum swiotlb_force, swiotlb_force )
  19. ),
  20. TP_fast_assign(
  21. __assign_str(dev_name, dev_name(dev));
  22. __entry->dma_mask = (dev->dma_mask ? *dev->dma_mask : 0);
  23. __entry->dev_addr = dev_addr;
  24. __entry->size = size;
  25. __entry->swiotlb_force = swiotlb_force;
  26. ),
  27. TP_printk("dev_name: %s dma_mask=%llx dev_addr=%llx "
  28. "size=%zu %s",
  29. __get_str(dev_name),
  30. __entry->dma_mask,
  31. (unsigned long long)__entry->dev_addr,
  32. __entry->size,
  33. __print_symbolic(__entry->swiotlb_force,
  34. { SWIOTLB_NORMAL, "NORMAL" },
  35. { SWIOTLB_FORCE, "FORCE" },
  36. { SWIOTLB_NO_FORCE, "NO_FORCE" }))
  37. );
  38. #endif /* _TRACE_SWIOTLB_H */
  39. /* This part must be outside protection */
  40. #include <trace/define_trace.h>