diff options
Diffstat (limited to 'meta/recipes-kernel/lttng/lttng-modules/fix-jbd2-use-the-correct-print-format.patch')
-rw-r--r-- | meta/recipes-kernel/lttng/lttng-modules/fix-jbd2-use-the-correct-print-format.patch | 147 |
1 files changed, 147 insertions, 0 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-modules/fix-jbd2-use-the-correct-print-format.patch b/meta/recipes-kernel/lttng/lttng-modules/fix-jbd2-use-the-correct-print-format.patch new file mode 100644 index 0000000000..b4939188cc --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/fix-jbd2-use-the-correct-print-format.patch | |||
@@ -0,0 +1,147 @@ | |||
1 | fix: jbd2: use the correct print format | ||
2 | See upstream commit : | ||
3 | |||
4 | commit d87a7b4c77a997d5388566dd511ca8e6b8e8a0a8 | ||
5 | Author: Bixuan Cui <cuibixuan@linux.alibaba.com> | ||
6 | Date: Tue Oct 11 19:33:44 2022 +0800 | ||
7 | |||
8 | jbd2: use the correct print format | ||
9 | |||
10 | The print format error was found when using ftrace event: | ||
11 | <...>-1406 [000] .... 23599442.895823: jbd2_end_commit: dev 252,8 transaction -1866216965 sync 0 head -1866217368 | ||
12 | <...>-1406 [000] .... 23599442.896299: jbd2_start_commit: dev 252,8 transaction -1866216964 sync 0 | ||
13 | |||
14 | Use the correct print format for transaction, head and tid. | ||
15 | |||
16 | Change-Id: Ic053f0e0c1e24ebc75bae51d07696aaa5e1c0094 | ||
17 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
18 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
19 | |||
20 | Upstream-status: Backport | ||
21 | Signed-off-by: Steve Sakoman <steve@sakoman.com> | ||
22 | Note: combines three upstream commits: | ||
23 | https://github.com/lttng/lttng-modules/commit/b28830a0dcdf95ec3e6b390b4d032667deaad0c0 | ||
24 | https://github.com/lttng/lttng-modules/commit/4fd2615b87b3cac0fd5bdc5fc82db05f6fcfdecf | ||
25 | https://github.com/lttng/lttng-modules/commit/612c99eb24bf72f4d47d02025e92de8c35ece14e | ||
26 | |||
27 | diff --git a/instrumentation/events/lttng-module/jbd2.h b/instrumentation/events/lttng-module/jbd2.h | ||
28 | --- a/instrumentation/events/lttng-module/jbd2.h | ||
29 | +++ b/instrumentation/events/lttng-module/jbd2.h | ||
30 | @@ -29,6 +29,25 @@ LTTNG_TRACEPOINT_EVENT(jbd2_checkpoint, | ||
31 | ) | ||
32 | ) | ||
33 | |||
34 | +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,2,0) \ | ||
35 | + || LTTNG_KERNEL_RANGE(5,4,229, 5,5,0) \ | ||
36 | + || LTTNG_KERNEL_RANGE(5,10,163, 5,11,0) \ | ||
37 | + || LTTNG_KERNEL_RANGE(5,15,87, 5,16,0) \ | ||
38 | + || LTTNG_KERNEL_RANGE(6,0,18, 6,1,0) \ | ||
39 | + || LTTNG_KERNEL_RANGE(6,1,4, 6,2,0)) | ||
40 | +LTTNG_TRACEPOINT_EVENT_CLASS(jbd2_commit, | ||
41 | + | ||
42 | + TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | ||
43 | + | ||
44 | + TP_ARGS(journal, commit_transaction), | ||
45 | + | ||
46 | + TP_FIELDS( | ||
47 | + ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) | ||
48 | + ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit) | ||
49 | + ctf_integer(tid_t, transaction, commit_transaction->t_tid) | ||
50 | + ) | ||
51 | +) | ||
52 | +#else | ||
53 | LTTNG_TRACEPOINT_EVENT_CLASS(jbd2_commit, | ||
54 | |||
55 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | ||
56 | @@ -41,6 +60,7 @@ LTTNG_TRACEPOINT_EVENT_CLASS(jbd2_commit | ||
57 | ctf_integer(int, transaction, commit_transaction->t_tid) | ||
58 | ) | ||
59 | ) | ||
60 | +#endif | ||
61 | |||
62 | LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_start_commit, | ||
63 | |||
64 | @@ -79,6 +99,25 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_com | ||
65 | ) | ||
66 | #endif | ||
67 | |||
68 | +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,2,0) \ | ||
69 | + || LTTNG_KERNEL_RANGE(5,4,229, 5,5,0) \ | ||
70 | + || LTTNG_KERNEL_RANGE(5,10,163, 5,11,0) \ | ||
71 | + || LTTNG_KERNEL_RANGE(5,15,87, 5,16,0) \ | ||
72 | + || LTTNG_KERNEL_RANGE(6,0,18, 6,1,0) \ | ||
73 | + || LTTNG_KERNEL_RANGE(6,1,4, 6,2,0)) | ||
74 | +LTTNG_TRACEPOINT_EVENT(jbd2_end_commit, | ||
75 | + TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | ||
76 | + | ||
77 | + TP_ARGS(journal, commit_transaction), | ||
78 | + | ||
79 | + TP_FIELDS( | ||
80 | + ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) | ||
81 | + ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit) | ||
82 | + ctf_integer(tid_t, transaction, commit_transaction->t_tid) | ||
83 | + ctf_integer(tid_t, head, journal->j_tail_sequence) | ||
84 | + ) | ||
85 | +) | ||
86 | +#else | ||
87 | LTTNG_TRACEPOINT_EVENT(jbd2_end_commit, | ||
88 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | ||
89 | |||
90 | @@ -91,6 +130,7 @@ LTTNG_TRACEPOINT_EVENT(jbd2_end_commit, | ||
91 | ctf_integer(int, head, journal->j_tail_sequence) | ||
92 | ) | ||
93 | ) | ||
94 | +#endif | ||
95 | |||
96 | LTTNG_TRACEPOINT_EVENT(jbd2_submit_inode_data, | ||
97 | TP_PROTO(struct inode *inode), | ||
98 | @@ -103,7 +143,48 @@ LTTNG_TRACEPOINT_EVENT(jbd2_submit_inode | ||
99 | ) | ||
100 | ) | ||
101 | |||
102 | -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(2,6,32)) | ||
103 | +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,2,0) \ | ||
104 | + || LTTNG_KERNEL_RANGE(5,4,229, 5,5,0) \ | ||
105 | + || LTTNG_KERNEL_RANGE(5,10,163, 5,11,0) \ | ||
106 | + || LTTNG_KERNEL_RANGE(5,15,87, 5,16,0) \ | ||
107 | + || LTTNG_KERNEL_RANGE(6,0,18, 6,1,0) \ | ||
108 | + || LTTNG_KERNEL_RANGE(6,1,4, 6,2,0)) | ||
109 | +LTTNG_TRACEPOINT_EVENT(jbd2_run_stats, | ||
110 | + TP_PROTO(dev_t dev, tid_t tid, | ||
111 | + struct transaction_run_stats_s *stats), | ||
112 | + | ||
113 | + TP_ARGS(dev, tid, stats), | ||
114 | + | ||
115 | + TP_FIELDS( | ||
116 | + ctf_integer(dev_t, dev, dev) | ||
117 | + ctf_integer(tid_t, tid, tid) | ||
118 | + ctf_integer(unsigned long, wait, stats->rs_wait) | ||
119 | + ctf_integer(unsigned long, running, stats->rs_running) | ||
120 | + ctf_integer(unsigned long, locked, stats->rs_locked) | ||
121 | + ctf_integer(unsigned long, flushing, stats->rs_flushing) | ||
122 | + ctf_integer(unsigned long, logging, stats->rs_logging) | ||
123 | + ctf_integer(__u32, handle_count, stats->rs_handle_count) | ||
124 | + ctf_integer(__u32, blocks, stats->rs_blocks) | ||
125 | + ctf_integer(__u32, blocks_logged, stats->rs_blocks_logged) | ||
126 | + ) | ||
127 | +) | ||
128 | + | ||
129 | +LTTNG_TRACEPOINT_EVENT(jbd2_checkpoint_stats, | ||
130 | + TP_PROTO(dev_t dev, tid_t tid, | ||
131 | + struct transaction_chp_stats_s *stats), | ||
132 | + | ||
133 | + TP_ARGS(dev, tid, stats), | ||
134 | + | ||
135 | + TP_FIELDS( | ||
136 | + ctf_integer(dev_t, dev, dev) | ||
137 | + ctf_integer(tid_t, tid, tid) | ||
138 | + ctf_integer(unsigned long, chp_time, stats->cs_chp_time) | ||
139 | + ctf_integer(__u32, forced_to_close, stats->cs_forced_to_close) | ||
140 | + ctf_integer(__u32, written, stats->cs_written) | ||
141 | + ctf_integer(__u32, dropped, stats->cs_dropped) | ||
142 | + ) | ||
143 | +) | ||
144 | +#else | ||
145 | LTTNG_TRACEPOINT_EVENT(jbd2_run_stats, | ||
146 | TP_PROTO(dev_t dev, unsigned long tid, | ||
147 | struct transaction_run_stats_s *stats), | ||