diff options
author | Stefan Strogin <s.strogin@partner.samsung.com> | 2015-04-15 19:14:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-15 19:35:19 -0400 |
commit | 99e8ea6cd2210cf2271f922384b483cd83f0f8f3 (patch) | |
tree | 78a467028c10e54cf24ed0062e5abdf52b1f63b1 /include/trace/events | |
parent | cdd7875e0c4db5c41e28b645d3bf7d41bd2cbb45 (diff) |
mm: cma: add trace events for CMA allocations and freeings
Add trace events for cma_alloc() and cma_release().
The cma_alloc tracepoint is used both for successful and failed allocations,
in case of allocation failure pfn=-1UL is stored and printed.
Signed-off-by: Stefan Strogin <stefan.strogin@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Michal Nazarewicz <mpn@google.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Cc: Thierry Reding <treding@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/trace/events')
-rw-r--r-- | include/trace/events/cma.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/include/trace/events/cma.h b/include/trace/events/cma.h new file mode 100644 index 000000000000..d7cd961720a7 --- /dev/null +++ b/include/trace/events/cma.h | |||
@@ -0,0 +1,66 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM cma | ||
3 | |||
4 | #if !defined(_TRACE_CMA_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_CMA_H | ||
6 | |||
7 | #include <linux/types.h> | ||
8 | #include <linux/tracepoint.h> | ||
9 | |||
10 | TRACE_EVENT(cma_alloc, | ||
11 | |||
12 | TP_PROTO(unsigned long pfn, const struct page *page, | ||
13 | unsigned int count, unsigned int align), | ||
14 | |||
15 | TP_ARGS(pfn, page, count, align), | ||
16 | |||
17 | TP_STRUCT__entry( | ||
18 | __field(unsigned long, pfn) | ||
19 | __field(const struct page *, page) | ||
20 | __field(unsigned int, count) | ||
21 | __field(unsigned int, align) | ||
22 | ), | ||
23 | |||
24 | TP_fast_assign( | ||
25 | __entry->pfn = pfn; | ||
26 | __entry->page = page; | ||
27 | __entry->count = count; | ||
28 | __entry->align = align; | ||
29 | ), | ||
30 | |||
31 | TP_printk("pfn=%lx page=%p count=%u align=%u", | ||
32 | __entry->pfn, | ||
33 | __entry->page, | ||
34 | __entry->count, | ||
35 | __entry->align) | ||
36 | ); | ||
37 | |||
38 | TRACE_EVENT(cma_release, | ||
39 | |||
40 | TP_PROTO(unsigned long pfn, const struct page *page, | ||
41 | unsigned int count), | ||
42 | |||
43 | TP_ARGS(pfn, page, count), | ||
44 | |||
45 | TP_STRUCT__entry( | ||
46 | __field(unsigned long, pfn) | ||
47 | __field(const struct page *, page) | ||
48 | __field(unsigned int, count) | ||
49 | ), | ||
50 | |||
51 | TP_fast_assign( | ||
52 | __entry->pfn = pfn; | ||
53 | __entry->page = page; | ||
54 | __entry->count = count; | ||
55 | ), | ||
56 | |||
57 | TP_printk("pfn=%lx page=%p count=%u", | ||
58 | __entry->pfn, | ||
59 | __entry->page, | ||
60 | __entry->count) | ||
61 | ); | ||
62 | |||
63 | #endif /* _TRACE_CMA_H */ | ||
64 | |||
65 | /* This part must be outside protection */ | ||
66 | #include <trace/define_trace.h> | ||