diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2021-03-19 14:58:36 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-03-20 18:54:57 +0000 |
commit | 0ffb5a8a49ba2e0438f46d1083f7a58d088bc153 (patch) | |
tree | 9faaf30bf7817befc1d17a0d97c2714af4129469 /meta/recipes-kernel/lttng/lttng-modules/0003-fix-mm-tracing-record-slab-name-for-kmem_cache_free-.patch | |
parent | b020c230c9ddfaa2901fa07df70e4854677e19a7 (diff) | |
download | poky-0ffb5a8a49ba2e0438f46d1083f7a58d088bc153.tar.gz |
lttng-modules: backport patches to fix build against 5.12+ kernel
There are four changes in addition to the 2.12.5 release that we
need to build against the 5.12 kernel. Rather than only rely on
people knowing to use devupstream support to build against newer
kernels, we backport the 4 patches while waiting for release.
(From OE-Core rev: 2d45c09bfbad969549c719654f72714324299f00)
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel/lttng/lttng-modules/0003-fix-mm-tracing-record-slab-name-for-kmem_cache_free-.patch')
-rw-r--r-- | meta/recipes-kernel/lttng/lttng-modules/0003-fix-mm-tracing-record-slab-name-for-kmem_cache_free-.patch | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0003-fix-mm-tracing-record-slab-name-for-kmem_cache_free-.patch b/meta/recipes-kernel/lttng/lttng-modules/0003-fix-mm-tracing-record-slab-name-for-kmem_cache_free-.patch new file mode 100644 index 0000000000..71f99b80a3 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0003-fix-mm-tracing-record-slab-name-for-kmem_cache_free-.patch | |||
@@ -0,0 +1,91 @@ | |||
1 | From 49c603ef2dc6969f4454f0d849af00ee24bb7f04 Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
3 | Date: Thu, 4 Mar 2021 16:50:12 -0500 | ||
4 | Subject: [PATCH 3/4] fix: mm, tracing: record slab name for kmem_cache_free() | ||
5 | (v5.12) | ||
6 | |||
7 | See upstream commit: | ||
8 | |||
9 | commit 3544de8ee6e4817278b15fe08658de49abf58954 | ||
10 | Author: Jacob Wen <jian.w.wen@oracle.com> | ||
11 | Date: Wed Feb 24 12:00:55 2021 -0800 | ||
12 | |||
13 | mm, tracing: record slab name for kmem_cache_free() | ||
14 | |||
15 | Currently, a trace record generated by the RCU core is as below. | ||
16 | |||
17 | ... kmem_cache_free: call_site=rcu_core+0x1fd/0x610 ptr=00000000f3b49a66 | ||
18 | |||
19 | It doesn't tell us what the RCU core has freed. | ||
20 | |||
21 | This patch adds the slab name to trace_kmem_cache_free(). | ||
22 | The new format is as follows. | ||
23 | |||
24 | ... kmem_cache_free: call_site=rcu_core+0x1fd/0x610 ptr=0000000037f79c8d name=dentry | ||
25 | ... kmem_cache_free: call_site=rcu_core+0x1fd/0x610 ptr=00000000f78cb7b5 name=sock_inode_cache | ||
26 | ... kmem_cache_free: call_site=rcu_core+0x1fd/0x610 ptr=0000000018768985 name=pool_workqueue | ||
27 | ... kmem_cache_free: call_site=rcu_core+0x1fd/0x610 ptr=000000006a6cb484 name=radix_tree_node | ||
28 | |||
29 | We can use it to understand what the RCU core is going to free. For | ||
30 | example, some users maybe interested in when the RCU core starts | ||
31 | freeing reclaimable slabs like dentry to reduce memory pressure. | ||
32 | |||
33 | Link: https://lkml.kernel.org/r/20201216072804.8838-1-jian.w.wen@oracle.com | ||
34 | |||
35 | Upstream-status: backport | ||
36 | |||
37 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
38 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
39 | Change-Id: I1ee2fc476614cadcc8d3ac5d8feddc7910e1aa3a | ||
40 | --- | ||
41 | instrumentation/events/lttng-module/kmem.h | 27 ++++++++++++++++++++++ | ||
42 | 1 file changed, 27 insertions(+) | ||
43 | |||
44 | diff --git a/instrumentation/events/lttng-module/kmem.h b/instrumentation/events/lttng-module/kmem.h | ||
45 | index b134620a..d787ea54 100644 | ||
46 | --- a/instrumentation/events/lttng-module/kmem.h | ||
47 | +++ b/instrumentation/events/lttng-module/kmem.h | ||
48 | @@ -87,6 +87,32 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(kmem_alloc_node, kmem_cache_alloc_node, | ||
49 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node) | ||
50 | ) | ||
51 | |||
52 | +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,12,0)) | ||
53 | +LTTNG_TRACEPOINT_EVENT(kfree, | ||
54 | + | ||
55 | + TP_PROTO(unsigned long call_site, const void *ptr), | ||
56 | + | ||
57 | + TP_ARGS(call_site, ptr), | ||
58 | + | ||
59 | + TP_FIELDS( | ||
60 | + ctf_integer_hex(unsigned long, call_site, call_site) | ||
61 | + ctf_integer_hex(const void *, ptr, ptr) | ||
62 | + ) | ||
63 | +) | ||
64 | + | ||
65 | +LTTNG_TRACEPOINT_EVENT(kmem_cache_free, | ||
66 | + | ||
67 | + TP_PROTO(unsigned long call_site, const void *ptr, const char *name), | ||
68 | + | ||
69 | + TP_ARGS(call_site, ptr, name), | ||
70 | + | ||
71 | + TP_FIELDS( | ||
72 | + ctf_integer_hex(unsigned long, call_site, call_site) | ||
73 | + ctf_integer_hex(const void *, ptr, ptr) | ||
74 | + ctf_string(name, name) | ||
75 | + ) | ||
76 | +) | ||
77 | +#else | ||
78 | LTTNG_TRACEPOINT_EVENT_CLASS(kmem_free, | ||
79 | |||
80 | TP_PROTO(unsigned long call_site, const void *ptr), | ||
81 | @@ -114,6 +140,7 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(kmem_free, kmem_cache_free, | ||
82 | |||
83 | TP_ARGS(call_site, ptr) | ||
84 | ) | ||
85 | +#endif | ||
86 | |||
87 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | ||
88 | LTTNG_TRACEPOINT_EVENT_MAP(mm_page_free, kmem_mm_page_free, | ||
89 | -- | ||
90 | 2.19.1 | ||
91 | |||