summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/lttng/lttng-modules/Update-vmscan-instrumentation-to-3.16-kernel.patch
blob: 5f02270e89c1717a67ef1037f9e036375482af8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
From 5defe623568273e9b87da1b817e373ff087fd862 Mon Sep 17 00:00:00 2001
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Date: Sun, 13 Jul 2014 13:27:01 -0400
Subject: [PATCH 1/2] Update vmscan instrumentation to 3.16 kernel

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
---
 instrumentation/events/lttng-module/vmscan.h | 39 ++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/instrumentation/events/lttng-module/vmscan.h b/instrumentation/events/lttng-module/vmscan.h
index 1fd50ba7c235..0b4aa56761dc 100644
--- a/instrumentation/events/lttng-module/vmscan.h
+++ b/instrumentation/events/lttng-module/vmscan.h
@@ -238,6 +238,44 @@ TRACE_EVENT(mm_shrink_slab_start,
 		__entry->total_scan)
 )
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
+TRACE_EVENT(mm_shrink_slab_end,
+	TP_PROTO(struct shrinker *shr, int nid, int shrinker_retval,
+		long unused_scan_cnt, long new_scan_cnt, long total_scan),
+
+	TP_ARGS(shr, nid, shrinker_retval, unused_scan_cnt, new_scan_cnt,
+		total_scan),
+
+	TP_STRUCT__entry(
+		__field(struct shrinker *, shr)
+		__field(int, nid)
+		__field(void *, shrink)
+		__field(long, unused_scan)
+		__field(long, new_scan)
+		__field(int, retval)
+		__field(long, total_scan)
+	),
+
+	TP_fast_assign(
+		tp_assign(shr, shr)
+		tp_assign(nid, nid)
+		tp_assign(shrink, shr->scan_objects)
+		tp_assign(unused_scan, unused_scan_cnt)
+		tp_assign(new_scan, new_scan_cnt)
+		tp_assign(retval, shrinker_retval)
+		tp_assign(total_scan, total_scan)
+	),
+
+	TP_printk("%pF %p: nid %d unused scan count %ld new scan count %ld total_scan %ld last shrinker return val %d",
+		__entry->shrink,
+		__entry->shr,
+		__entry->nid,
+		__entry->unused_scan,
+		__entry->new_scan,
+		__entry->total_scan,
+		__entry->retval)
+)
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */
 TRACE_EVENT(mm_shrink_slab_end,
 	TP_PROTO(struct shrinker *shr, int shrinker_retval,
 		long unused_scan_cnt, long new_scan_cnt),
@@ -274,6 +312,7 @@ TRACE_EVENT(mm_shrink_slab_end,
 		__entry->total_scan,
 		__entry->retval)
 )
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */
 #endif
 
 DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template,
-- 
1.8.1.2