filemap.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM filemap
  3. #if !defined(_TRACE_FILEMAP_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_FILEMAP_H
  5. #include <linux/types.h>
  6. #include <linux/tracepoint.h>
  7. #include <linux/mm.h>
  8. #include <linux/memcontrol.h>
  9. #include <linux/device.h>
  10. #include <linux/kdev_t.h>
  11. DECLARE_EVENT_CLASS(mm_filemap_op_page_cache,
  12. TP_PROTO(struct page *page),
  13. TP_ARGS(page),
  14. TP_STRUCT__entry(
  15. __field(unsigned long, pfn)
  16. __field(unsigned long, i_ino)
  17. __field(unsigned long, index)
  18. __field(dev_t, s_dev)
  19. ),
  20. TP_fast_assign(
  21. __entry->pfn = page_to_pfn(page);
  22. __entry->i_ino = page->mapping->host->i_ino;
  23. __entry->index = page->index;
  24. if (page->mapping->host->i_sb)
  25. __entry->s_dev = page->mapping->host->i_sb->s_dev;
  26. else
  27. __entry->s_dev = page->mapping->host->i_rdev;
  28. ),
  29. TP_printk("dev %d:%d ino %lx page=%p pfn=%lu ofs=%lu",
  30. MAJOR(__entry->s_dev), MINOR(__entry->s_dev),
  31. __entry->i_ino,
  32. pfn_to_page(__entry->pfn),
  33. __entry->pfn,
  34. __entry->index << PAGE_SHIFT)
  35. );
  36. DEFINE_EVENT(mm_filemap_op_page_cache, mm_filemap_delete_from_page_cache,
  37. TP_PROTO(struct page *page),
  38. TP_ARGS(page)
  39. );
  40. DEFINE_EVENT(mm_filemap_op_page_cache, mm_filemap_add_to_page_cache,
  41. TP_PROTO(struct page *page),
  42. TP_ARGS(page)
  43. );
  44. #endif /* _TRACE_FILEMAP_H */
  45. /* This part must be outside protection */
  46. #include <trace/define_trace.h>