aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/lttng/lttng-modules/0004-Fix-update-ext4-instrumentation-for-kernel-4.13.patch
blob: c835d06cf5b48e7178df965092939e3f319eb8b0 (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
From 500c99a45fc0da09d1dc7b9e62bf58d562856a9a Mon Sep 17 00:00:00 2001
From: Michael Jeanson <mjeanson@efficios.com>
Date: Mon, 21 Aug 2017 14:47:08 -0400
Subject: [PATCH 4/8] Fix: update ext4 instrumentation for kernel 4.13
Organization: O.S. Systems Software LTDA.

See this upstream commit :

  commit a627b0a7c15ee4d2c87a86d5be5c8167382e8d0d
  Author: Eric Whitney <enwlinux@gmail.com>
  Date:   Sun Jul 30 22:30:11 2017 -0400

      ext4: remove unused metadata accounting variables

      Two variables in ext4_inode_info, i_reserved_meta_blocks and
      i_allocated_meta_blocks, are unused.  Removing them saves a little
      memory per in-memory inode and cleans up clutter in several tracepoints.
      Adjust tracepoint output from ext4_alloc_da_blocks() for consistency
      and fix a typo and whitespace near these changes.

Upstream-Status: Backport [2.9.4]

      Signed-off-by: Eric Whitney <enwlinux@gmail.com>
      Signed-off-by: Theodore Ts'o <tytso@mit.edu>
      Reviewed-by: Jan Kara <jack@suse.cz>

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
---
 instrumentation/events/lttng-module/ext4.h | 96 ++++++++++++++++++++++++++----
 1 file changed, 86 insertions(+), 10 deletions(-)

diff --git a/instrumentation/events/lttng-module/ext4.h b/instrumentation/events/lttng-module/ext4.h
index e87b534..fe6f802 100644
--- a/instrumentation/events/lttng-module/ext4.h
+++ b/instrumentation/events/lttng-module/ext4.h
@@ -689,6 +689,19 @@ LTTNG_TRACEPOINT_EVENT(ext4_sync_fs,
 	)
 )
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0))
+LTTNG_TRACEPOINT_EVENT(ext4_alloc_da_blocks,
+	TP_PROTO(struct inode *inode),
+
+	TP_ARGS(inode),
+
+	TP_FIELDS(
+		ctf_integer(dev_t, dev, inode->i_sb->s_dev)
+		ctf_integer(ino_t, ino, inode->i_ino)
+		ctf_integer(unsigned int, data_blocks, EXT4_I(inode)->i_reserved_data_blocks)
+	)
+)
+#else
 LTTNG_TRACEPOINT_EVENT(ext4_alloc_da_blocks,
 	TP_PROTO(struct inode *inode),
 
@@ -701,6 +714,7 @@ LTTNG_TRACEPOINT_EVENT(ext4_alloc_da_blocks,
 		ctf_integer(unsigned int, meta_blocks, EXT4_I(inode)->i_reserved_meta_blocks)
 	)
 )
+#endif
 
 LTTNG_TRACEPOINT_EVENT(ext4_mballoc_alloc,
 	TP_PROTO(struct ext4_allocation_context *ac),
@@ -833,17 +847,49 @@ LTTNG_TRACEPOINT_EVENT(ext4_forget,
 )
 #endif
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0))
 LTTNG_TRACEPOINT_EVENT(ext4_da_update_reserve_space,
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
 	TP_PROTO(struct inode *inode, int used_blocks, int quota_claim),
 
 	TP_ARGS(inode, used_blocks, quota_claim),
-#else
+
+	TP_FIELDS(
+		ctf_integer(dev_t, dev, inode->i_sb->s_dev)
+		ctf_integer(ino_t, ino, inode->i_ino)
+		ctf_integer(__u64, i_blocks, inode->i_blocks)
+		ctf_integer(int, used_blocks, used_blocks)
+		ctf_integer(int, reserved_data_blocks,
+				EXT4_I(inode)->i_reserved_data_blocks)
+		ctf_integer(int, quota_claim, quota_claim)
+		ctf_integer(TP_MODE_T, mode, inode->i_mode)
+	)
+)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+LTTNG_TRACEPOINT_EVENT(ext4_da_update_reserve_space,
+	TP_PROTO(struct inode *inode, int used_blocks, int quota_claim),
+
+	TP_ARGS(inode, used_blocks, quota_claim),
+
+	TP_FIELDS(
+		ctf_integer(dev_t, dev, inode->i_sb->s_dev)
+		ctf_integer(ino_t, ino, inode->i_ino)
+		ctf_integer(__u64, i_blocks, inode->i_blocks)
+		ctf_integer(int, used_blocks, used_blocks)
+		ctf_integer(int, reserved_data_blocks,
+				EXT4_I(inode)->i_reserved_data_blocks)
+		ctf_integer(int, reserved_meta_blocks,
+				EXT4_I(inode)->i_reserved_meta_blocks)
+		ctf_integer(int, allocated_meta_blocks,
+				EXT4_I(inode)->i_allocated_meta_blocks)
+		ctf_integer(int, quota_claim, quota_claim)
+		ctf_integer(TP_MODE_T, mode, inode->i_mode)
+	)
+)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
+LTTNG_TRACEPOINT_EVENT(ext4_da_update_reserve_space,
 	TP_PROTO(struct inode *inode, int used_blocks),
 
 	TP_ARGS(inode, used_blocks),
-#endif
 
 	TP_FIELDS(
 		ctf_integer(dev_t, dev, inode->i_sb->s_dev)
@@ -856,14 +902,27 @@ LTTNG_TRACEPOINT_EVENT(ext4_da_update_reserve_space,
 				EXT4_I(inode)->i_reserved_meta_blocks)
 		ctf_integer(int, allocated_meta_blocks,
 				EXT4_I(inode)->i_allocated_meta_blocks)
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
-		ctf_integer(int, quota_claim, quota_claim)
-#endif
 		ctf_integer(TP_MODE_T, mode, inode->i_mode)
 	)
 )
+#endif
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0))
+LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_space,
+	TP_PROTO(struct inode *inode),
+
+	TP_ARGS(inode),
+
+	TP_FIELDS(
+		ctf_integer(dev_t, dev, inode->i_sb->s_dev)
+		ctf_integer(ino_t, ino, inode->i_ino)
+		ctf_integer(__u64, i_blocks, inode->i_blocks)
+		ctf_integer(int, reserved_data_blocks,
+				EXT4_I(inode)->i_reserved_data_blocks)
+		ctf_integer(TP_MODE_T, mode, inode->i_mode)
+	)
+)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0))
 LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_space,
 	TP_PROTO(struct inode *inode),
 
@@ -880,7 +939,7 @@ LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_space,
 		ctf_integer(TP_MODE_T, mode, inode->i_mode)
 	)
 )
-#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
 LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_space,
 	TP_PROTO(struct inode *inode, int md_needed),
 
@@ -898,8 +957,25 @@ LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_space,
 		ctf_integer(TP_MODE_T, mode, inode->i_mode)
 	)
 )
-#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */
+#endif
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0))
+LTTNG_TRACEPOINT_EVENT(ext4_da_release_space,
+	TP_PROTO(struct inode *inode, int freed_blocks),
+
+	TP_ARGS(inode, freed_blocks),
 
+	TP_FIELDS(
+		ctf_integer(dev_t, dev, inode->i_sb->s_dev)
+		ctf_integer(ino_t, ino, inode->i_ino)
+		ctf_integer(__u64, i_blocks, inode->i_blocks)
+		ctf_integer(int, freed_blocks, freed_blocks)
+		ctf_integer(int, reserved_data_blocks,
+				EXT4_I(inode)->i_reserved_data_blocks)
+		ctf_integer(TP_MODE_T, mode, inode->i_mode)
+	)
+)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
 LTTNG_TRACEPOINT_EVENT(ext4_da_release_space,
 	TP_PROTO(struct inode *inode, int freed_blocks),
 
-- 
2.14.1