]> git.pld-linux.org Git - packages/lttng-modules.git/blame - kernel-4.16.patch
- upstream fixes for kernel 4.16
[packages/lttng-modules.git] / kernel-4.16.patch
CommitLineData
ce7edfe3
JR
1From 562860aa5d13249d2c80e51080a3437ef5d2fe0b Mon Sep 17 00:00:00 2001
2From: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
3Date: Mon, 12 Feb 2018 18:31:40 +0100
4Subject: [PATCH] Fix: update timer instrumentation on 4.16 and 4.14-rt
5
6See upstream commit :
7
8 commit 63e2ed3659752a4850e0ef3a07f809988fcd74a4
9 Author: Anna-Maria Gleixner <anna-maria@linutronix.de>
10 Date: Thu Dec 21 11:41:38 2017 +0100
11
12 tracing/hrtimer: Print the hrtimer mode in the 'hrtimer_start' tracepoint
13
14 The 'hrtimer_start' tracepoint lacks the mode information. The mode is
15 important because consecutive starts can switch from ABS to REL or from
16 PINNED to non PINNED.
17
18 Append the mode field.
19
20See linux-rt commit :
21
22 commit 6ee32a49b1ed61c08ac9f1c9fcbf83d3c749b71d
23 Author: Anna-Maria Gleixner <anna-maria@linutronix.de>
24 Date: Sun Oct 22 23:39:46 2017 +0200
25
26 tracing: hrtimer: Print hrtimer mode in hrtimer_start tracepoint
27
28 The hrtimer_start tracepoint lacks the mode information. The mode is
29 important because consecutive starts can switch from ABS to REL or from
30 PINNED to non PINNED.
31
32 Add the mode information.
33
34Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
35Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
36Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
37---
38 instrumentation/events/lttng-module/timer.h | 22 ++++++++++++++++++++++
39 1 file changed, 22 insertions(+)
40
41diff --git a/instrumentation/events/lttng-module/timer.h b/instrumentation/events/lttng-module/timer.h
42index d62fd25..6f0cb7f 100644
43--- a/instrumentation/events/lttng-module/timer.h
44+++ b/instrumentation/events/lttng-module/timer.h
45@@ -160,6 +160,27 @@ LTTNG_TRACEPOINT_EVENT_MAP(hrtimer_init,
46 * hrtimer_start - called when the hrtimer is started
47 * @timer: pointer to struct hrtimer
48 */
49+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0) || \
50+ LTTNG_RT_KERNEL_RANGE(4,14,0,0, 4,15,0,0))
51+LTTNG_TRACEPOINT_EVENT_MAP(hrtimer_start,
52+
53+ timer_hrtimer_start,
54+
55+ TP_PROTO(struct hrtimer *hrtimer, enum hrtimer_mode mode),
56+
57+ TP_ARGS(hrtimer, mode),
58+
59+ TP_FIELDS(
60+ ctf_integer_hex(void *, hrtimer, hrtimer)
61+ ctf_integer_hex(void *, function, hrtimer->function)
62+ ctf_integer(s64, expires,
63+ lttng_ktime_get_tv64(hrtimer_get_expires(hrtimer)))
64+ ctf_integer(s64, softexpires,
65+ lttng_ktime_get_tv64(hrtimer_get_softexpires(hrtimer)))
66+ ctf_integer(enum hrtimer_mode, mode, mode)
67+ )
68+)
69+#else
70 LTTNG_TRACEPOINT_EVENT_MAP(hrtimer_start,
71
72 timer_hrtimer_start,
73@@ -177,6 +198,7 @@ LTTNG_TRACEPOINT_EVENT_MAP(hrtimer_start,
74 lttng_ktime_get_tv64(hrtimer_get_softexpires(hrtimer)))
75 )
76 )
77+#endif
78
79 /**
80 * htimmer_expire_entry - called immediately before the hrtimer callback
81From 9cf057fcd8189b44b11069a3f96be6e53d57c9e9 Mon Sep 17 00:00:00 2001
82From: Michael Jeanson <mjeanson@efficios.com>
83Date: Mon, 12 Feb 2018 18:32:12 +0100
84Subject: [PATCH] Fix: update vmscan instrumentation for v4.16
85
86See upstream commit :
87
88 commit 9092c71bb724dba2ecba849eae69e5c9d39bd3d2
89 Author: Josef Bacik <jbacik@fb.com>
90 Date: Wed Jan 31 16:16:26 2018 -0800
91
92 mm: use sc->priority for slab shrink targets
93
94 Previously we were using the ratio of the number of lru pages scanned to
95 the number of eligible lru pages to determine the number of slab objects
96 to scan. The problem with this is that these two things have nothing to
97 do with each other, so in slab heavy work loads where there is little to
98 no page cache we can end up with the pages scanned being a very low
99 number. This means that we reclaim next to no slab pages and waste a
100 lot of time reclaiming small amounts of space.
101
102Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
103Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
104---
105 instrumentation/events/lttng-module/mm_vmscan.h | 31 ++++++++++++++++++++++---
106 1 file changed, 28 insertions(+), 3 deletions(-)
107
108diff --git a/instrumentation/events/lttng-module/mm_vmscan.h b/instrumentation/events/lttng-module/mm_vmscan.h
109index 9845635..a69b42f 100644
110--- a/instrumentation/events/lttng-module/mm_vmscan.h
111+++ b/instrumentation/events/lttng-module/mm_vmscan.h
112@@ -204,7 +204,32 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template, mm_vmscan
113 TP_ARGS(nr_reclaimed)
114 )
115
116-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
117+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0))
118+LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start,
119+
120+ mm_vmscan_shrink_slab_start,
121+
122+ TP_PROTO(struct shrinker *shr, struct shrink_control *sc,
123+ long nr_objects_to_shrink, unsigned long cache_items,
124+ unsigned long long delta, unsigned long total_scan,
125+ int priority),
126+
127+ TP_ARGS(shr, sc, nr_objects_to_shrink, cache_items, delta, total_scan,
128+ priority),
129+
130+ TP_FIELDS(
131+ ctf_integer_hex(struct shrinker *, shr, shr)
132+ ctf_integer_hex(void *, shrink, shr->scan_objects)
133+ ctf_integer(int, nid, sc->nid)
134+ ctf_integer(long, nr_objects_to_shrink, nr_objects_to_shrink)
135+ ctf_integer(gfp_t, gfp_flags, sc->gfp_mask)
136+ ctf_integer(unsigned long, cache_items, cache_items)
137+ ctf_integer(unsigned long long, delta, delta)
138+ ctf_integer(unsigned long, total_scan, total_scan)
139+ ctf_integer(int, priority, priority)
140+ )
141+)
142+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
143 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start,
144
145 mm_vmscan_shrink_slab_start,
146@@ -233,6 +258,7 @@ LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start,
147 ctf_integer(unsigned long, total_scan, total_scan)
148 )
149 )
150+#endif
151
152 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
153 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end,
154@@ -255,7 +281,7 @@ LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end,
155 ctf_integer(long, total_scan, total_scan)
156 )
157 )
158-#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */
159+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
160 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end,
161
162 mm_vmscan_shrink_slab_end,
163@@ -278,7 +304,6 @@ LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end,
164 ctf_integer(long, total_scan, new_scan_cnt - unused_scan_cnt)
165 )
166 )
167-#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */
168 #endif
169
170 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
171From 760a1caeaf8962c438fdc7b21e1d0a4a6bb74354 Mon Sep 17 00:00:00 2001
172From: Michael Jeanson <mjeanson@efficios.com>
173Date: Mon, 12 Feb 2018 18:32:25 +0100
174Subject: [PATCH] Fix: update rcu instrumentation for v4.16
175
176See upstream commits :
177
178 commit dec98900eae1e22467182e58688abe5fae98bd5f
179 Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
180 Date: Wed Oct 4 16:24:29 2017 -0700
181
182 rcu: Add ->dynticks field to rcu_dyntick trace event
183
184 commit 84585aa8b6ad24e5bdfba9db4a320a6aeed192ab
185 Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
186 Date: Wed Oct 4 15:55:16 2017 -0700
187
188 rcu: Shrink ->dynticks_{nmi_,}nesting from long long to long
189
190 Because the ->dynticks_nesting field now only contains the process-based
191 nesting level instead of a value encoding both the process nesting level
192 and the irq "nesting" level, we no longer need a long long, even on
193 32-bit systems. This commit therefore changes both the ->dynticks_nesting
194 and ->dynticks_nmi_nesting fields to long.
195
196Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
197Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
198---
199 instrumentation/events/lttng-module/rcu.h | 41 ++++++++++++++++++++++++++-----
200 1 file changed, 35 insertions(+), 6 deletions(-)
201
202diff --git a/instrumentation/events/lttng-module/rcu.h b/instrumentation/events/lttng-module/rcu.h
203index 869de08..4528a79 100644
204--- a/instrumentation/events/lttng-module/rcu.h
205+++ b/instrumentation/events/lttng-module/rcu.h
206@@ -220,31 +220,60 @@ LTTNG_TRACEPOINT_EVENT(rcu_fqs,
207 * events use the upper bits of each number, while interrupt-related
208 * events use the lower bits.
209 */
210+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0))
211 LTTNG_TRACEPOINT_EVENT(rcu_dyntick,
212
213+ TP_PROTO(const char *polarity, long oldnesting, long newnesting, atomic_t dynticks),
214+
215+ TP_ARGS(polarity, oldnesting, newnesting, dynticks),
216+
217+ TP_FIELDS(
218+ ctf_string(polarity, polarity)
219+ ctf_integer(long, oldnesting, oldnesting)
220+ ctf_integer(long, newnesting, newnesting)
221+ ctf_integer(int, dynticks, atomic_read(&dynticks))
222+ )
223+)
224+
225+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
226+LTTNG_TRACEPOINT_EVENT(rcu_dyntick,
227
228-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
229 TP_PROTO(const char *polarity, long long oldnesting, long long newnesting),
230
231 TP_ARGS(polarity, oldnesting, newnesting),
232+
233+ TP_FIELDS(
234+ ctf_string(polarity, polarity)
235+ ctf_integer(long long, oldnesting, oldnesting)
236+ ctf_integer(long long, newnesting, newnesting)
237+ )
238+)
239 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
240+LTTNG_TRACEPOINT_EVENT(rcu_dyntick,
241+
242 TP_PROTO(char *polarity, long long oldnesting, long long newnesting),
243
244 TP_ARGS(polarity, oldnesting, newnesting),
245+
246+ TP_FIELDS(
247+ ctf_string(polarity, polarity)
248+ ctf_integer(long long, oldnesting, oldnesting)
249+ ctf_integer(long long, newnesting, newnesting)
250+ )
251+)
252 #else
253+LTTNG_TRACEPOINT_EVENT(rcu_dyntick,
254+
255 TP_PROTO(char *polarity),
256
257 TP_ARGS(polarity),
258-#endif
259
260 TP_FIELDS(
261 ctf_string(polarity, polarity)
262-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
263- ctf_integer(long long, oldnesting, oldnesting)
264- ctf_integer(long long, newnesting, newnesting)
265-#endif
266 )
267 )
268+#endif
269+
270
271 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
272 /*
This page took 0.945509 seconds and 4 git commands to generate.