blob: 42febb6bc1d56a00256a62cbb9149c3b5e3c92a7 [file] [log] [blame]
Robert Jarzmikfe0bfaa2013-04-29 15:06:10 -07001#undef TRACE_SYSTEM
2#define TRACE_SYSTEM filemap
3
4#if !defined(_TRACE_FILEMAP_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_FILEMAP_H
6
7#include <linux/types.h>
8#include <linux/tracepoint.h>
9#include <linux/mm.h>
10#include <linux/memcontrol.h>
11#include <linux/device.h>
12#include <linux/kdev_t.h>
13
14DECLARE_EVENT_CLASS(mm_filemap_op_page_cache,
15
16 TP_PROTO(struct page *page),
17
18 TP_ARGS(page),
19
20 TP_STRUCT__entry(
Namhyung Kim9fdd8a82015-04-06 14:36:09 +090021 __field(unsigned long, pfn)
Robert Jarzmikfe0bfaa2013-04-29 15:06:10 -070022 __field(unsigned long, i_ino)
23 __field(unsigned long, index)
24 __field(dev_t, s_dev)
25 ),
26
27 TP_fast_assign(
Namhyung Kim9fdd8a82015-04-06 14:36:09 +090028 __entry->pfn = page_to_pfn(page);
Robert Jarzmikfe0bfaa2013-04-29 15:06:10 -070029 __entry->i_ino = page->mapping->host->i_ino;
30 __entry->index = page->index;
31 if (page->mapping->host->i_sb)
32 __entry->s_dev = page->mapping->host->i_sb->s_dev;
33 else
34 __entry->s_dev = page->mapping->host->i_rdev;
35 ),
36
37 TP_printk("dev %d:%d ino %lx page=%p pfn=%lu ofs=%lu",
38 MAJOR(__entry->s_dev), MINOR(__entry->s_dev),
39 __entry->i_ino,
Namhyung Kim9fdd8a82015-04-06 14:36:09 +090040 pfn_to_page(__entry->pfn),
41 __entry->pfn,
Robert Jarzmikfe0bfaa2013-04-29 15:06:10 -070042 __entry->index << PAGE_SHIFT)
43);
44
45DEFINE_EVENT(mm_filemap_op_page_cache, mm_filemap_delete_from_page_cache,
46 TP_PROTO(struct page *page),
47 TP_ARGS(page)
48 );
49
50DEFINE_EVENT(mm_filemap_op_page_cache, mm_filemap_add_to_page_cache,
51 TP_PROTO(struct page *page),
52 TP_ARGS(page)
53 );
54
55#endif /* _TRACE_FILEMAP_H */
56
57/* This part must be outside protection */
58#include <trace/define_trace.h>