New upstream version 2.12.5
Michael Jeanson
3 years ago
0 | 2021-02-17 (Random Act of Kindness Day) LTTng modules 2.12.5 | |
1 | * fix: Adjust ranges for Ubuntu 5.8.0-44 kernel | |
2 | * fix: missing include for 'task_struct' in fdtable.h | |
3 | * fix: file: Rename fcheck lookup_fd_rcu (v5.11) | |
4 | * Fix: do not use bdi_unknown_name symbol | |
5 | * fix: memcg: fix a crash in wb_workfn when a device disappears (5.6) | |
6 | * Fix: writeback: out-of-bound reads | |
7 | * fix: Add one digit to RHEL major release version | |
8 | * fix: Add one digit to SLES minor release version | |
9 | * fix: RT_PATCH_VERSION is close to overflow | |
10 | * fix: cast LTTNG_KERNEL_VERSION/LTTNG_LINUX_VERSION_CODE to uint64_t | |
11 | * fix: UTS_UBUNTU_RELEASE_ABI is close to overflow | |
12 | * fix: sublevel version overflow in LINUX_VERSION_CODE | |
13 | * Namespace kernel version macros | |
14 | * aarch64: blacklist gcc prior to 5.1 | |
15 | * fix: genirq: Restrict export of irq_to_desc() (v5.11) | |
16 | * fix: block: merge struct block_device and struct hd_struct (v5.11) | |
17 | * fix: kprobes: Remove kretprobe hash (v5.11) | |
18 | * fix: block: remove the request_queue argument to the block_bio_remap tracepoint (v5.11) | |
19 | * fix: block: remove the request_queue argument to the block_split tracepoint (v5.11) | |
20 | * fix: block: simplify and extend the block_bio_merge tracepoint class (v5.11) | |
21 | * fix: block: remove the request_queue to argument request based tracepoints (v5.11) | |
22 | ||
0 | 23 | 2021-01-11 (National Clean Off Your Desk Day) LTTng modules 2.12.4 |
1 | 24 | * fix: adjust version range for trace_find_free_extent() |
2 | 25 | * Improve the release script |
0 | 0 | # SPDX-License-Identifier: (GPL-2.0 OR LGPL-2.1) |
1 | ||
2 | ccflags-y += -DLTTNG_LINUX_MAJOR=$(VERSION) | |
3 | ccflags-y += -DLTTNG_LINUX_MINOR=$(PATCHLEVEL) | |
4 | ccflags-y += -DLTTNG_LINUX_PATCH=$(SUBLEVEL) | |
1 | 5 | |
2 | 6 | # Work-around for distro-specific public modules ABI breakages. |
3 | 7 | # Some distributions break the public module instrumentation ABI |
5 | 5 | #define LTTNG_TRACE_9P_H |
6 | 6 | |
7 | 7 | #include <probes/lttng-tracepoint-event.h> |
8 | #include <linux/version.h> | |
8 | #include <lttng-kernel-version.h> | |
9 | 9 | |
10 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) | |
10 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0)) | |
11 | 11 | LTTNG_TRACEPOINT_EVENT(9p_client_req, |
12 | 12 | |
13 | 13 | TP_PROTO(struct p9_client *clnt, int8_t type, int tag), |
2 | 2 | #define LTTNG_TRACE_EXCEPTIONS_H |
3 | 3 | |
4 | 4 | #include <probes/lttng-tracepoint-event.h> |
5 | #include <linux/version.h> | |
5 | #include <lttng-kernel-version.h> | |
6 | 6 | |
7 | 7 | #undef TRACE_SYSTEM |
8 | 8 | #define TRACE_SYSTEM x86_exceptions |
2 | 2 | #define LTTNG_TRACE_IRQ_VECTORS_H |
3 | 3 | |
4 | 4 | #include <probes/lttng-tracepoint-event.h> |
5 | #include <linux/version.h> | |
5 | #include <lttng-kernel-version.h> | |
6 | 6 | |
7 | 7 | #undef TRACE_SYSTEM |
8 | 8 | #define TRACE_SYSTEM x86_irq_vectors |
2 | 2 | #define LTTNG_TRACE_KVM_MMU_H |
3 | 3 | |
4 | 4 | #include <probes/lttng-tracepoint-event.h> |
5 | #include <linux/version.h> | |
6 | ||
7 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) | |
5 | #include <lttng-kernel-version.h> | |
6 | ||
7 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,2,0)) | |
8 | 8 | #include <linux/trace_events.h> |
9 | #else /* if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ | |
9 | #else /* if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,2,0)) */ | |
10 | 10 | #include <linux/ftrace_event.h> |
11 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ | |
11 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,2,0)) */ | |
12 | 12 | |
13 | 13 | #undef TRACE_SYSTEM |
14 | 14 | #define TRACE_SYSTEM kvm_mmu |
15 | 15 | |
16 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0) || \ | |
16 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,1,0) || \ | |
17 | 17 | LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0)) |
18 | 18 | |
19 | 19 | #define LTTNG_KVM_MMU_PAGE_FIELDS \ |
22 | 22 | ctf_integer(__u32, root_count, (sp)->root_count) \ |
23 | 23 | ctf_integer(bool, unsync, (sp)->unsync) |
24 | 24 | |
25 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) | |
25 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) | |
26 | 26 | |
27 | 27 | #define LTTNG_KVM_MMU_PAGE_FIELDS \ |
28 | 28 | ctf_integer(unsigned long, mmu_valid_gen, (sp)->mmu_valid_gen) \ |
31 | 31 | ctf_integer(__u32, root_count, (sp)->root_count) \ |
32 | 32 | ctf_integer(bool, unsync, (sp)->unsync) |
33 | 33 | |
34 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) */ | |
34 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) */ | |
35 | 35 | |
36 | 36 | #define LTTNG_KVM_MMU_PAGE_FIELDS \ |
37 | 37 | ctf_integer(__u64, gfn, (sp)->gfn) \ |
39 | 39 | ctf_integer(__u32, root_count, (sp)->root_count) \ |
40 | 40 | ctf_integer(bool, unsync, (sp)->unsync) |
41 | 41 | |
42 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) */ | |
43 | ||
44 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) | |
42 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) */ | |
43 | ||
44 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,6,0)) | |
45 | 45 | /* |
46 | 46 | * A pagetable walk has started |
47 | 47 | */ |
55 | 55 | ctf_integer(__u32, pferr, pferr) |
56 | 56 | ) |
57 | 57 | ) |
58 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) */ | |
58 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,6,0)) */ | |
59 | 59 | /* |
60 | 60 | * A pagetable walk has started |
61 | 61 | */ |
71 | 71 | | (!!fetch_fault << 4)) |
72 | 72 | ) |
73 | 73 | ) |
74 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) */ | |
74 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,6,0)) */ | |
75 | 75 | |
76 | 76 | /* We just walked a paging element */ |
77 | 77 | LTTNG_TRACEPOINT_EVENT( |
162 | 162 | TP_ARGS(sp) |
163 | 163 | ) |
164 | 164 | |
165 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0)) | |
165 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,10,0)) | |
166 | 166 | |
167 | 167 | LTTNG_TRACEPOINT_EVENT_MAP( |
168 | 168 | mark_mmio_spte, |
180 | 180 | ) |
181 | 181 | ) |
182 | 182 | |
183 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) | |
183 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) | |
184 | 184 | |
185 | 185 | LTTNG_TRACEPOINT_EVENT_MAP( |
186 | 186 | mark_mmio_spte, |
198 | 198 | ) |
199 | 199 | ) |
200 | 200 | |
201 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) */ | |
201 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) */ | |
202 | 202 | |
203 | 203 | LTTNG_TRACEPOINT_EVENT_MAP( |
204 | 204 | mark_mmio_spte, |
215 | 215 | ) |
216 | 216 | ) |
217 | 217 | |
218 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) */ | |
218 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) */ | |
219 | 219 | |
220 | 220 | LTTNG_TRACEPOINT_EVENT_MAP( |
221 | 221 | handle_mmio_page_fault, |
232 | 232 | ) |
233 | 233 | ) |
234 | 234 | |
235 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0)) | |
235 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,10,0)) | |
236 | 236 | LTTNG_TRACEPOINT_EVENT_MAP( |
237 | 237 | fast_page_fault, |
238 | 238 | |
252 | 252 | ctf_integer(int, ret, ret) |
253 | 253 | ) |
254 | 254 | ) |
255 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) || \ | |
255 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0) || \ | |
256 | 256 | LTTNG_KERNEL_RANGE(4,19,103, 4,20,0) || \ |
257 | 257 | LTTNG_KERNEL_RANGE(5,4,19, 5,5,0) || \ |
258 | 258 | LTTNG_KERNEL_RANGE(5,5,3, 5,6,0) || \ |
4 | 4 | #include <probes/lttng-tracepoint-event.h> |
5 | 5 | #include <asm/vmx.h> |
6 | 6 | #include <asm/svm.h> |
7 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
7 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
8 | 8 | #include <asm/clocksource.h> |
9 | 9 | #endif |
10 | #include <linux/version.h> | |
10 | #include <lttng-kernel-version.h> | |
11 | 11 | #include <../arch/x86/kvm/lapic.h> |
12 | 12 | #include <../arch/x86/kvm/kvm_cache_regs.h> |
13 | 13 | |
114 | 114 | /* |
115 | 115 | * Tracepoint for kvm guest exit: |
116 | 116 | */ |
117 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0)) | |
117 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,10,0)) | |
118 | 118 | LTTNG_TRACEPOINT_EVENT_CODE_MAP(kvm_exit, kvm_x86_exit, |
119 | 119 | TP_PROTO(unsigned int exit_reason, struct kvm_vcpu *vcpu, u32 isa), |
120 | 120 | TP_ARGS(exit_reason, vcpu, isa), |
144 | 144 | |
145 | 145 | TP_code_post() |
146 | 146 | ) |
147 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) | |
147 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,7,0)) | |
148 | 148 | LTTNG_TRACEPOINT_EVENT_CODE_MAP(kvm_exit, kvm_x86_exit, |
149 | 149 | TP_PROTO(unsigned int exit_reason, struct kvm_vcpu *vcpu, u32 isa), |
150 | 150 | TP_ARGS(exit_reason, vcpu, isa), |
479 | 479 | TP_ARGS(vcpu, failed), |
480 | 480 | |
481 | 481 | TP_FIELDS( |
482 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)) | |
482 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,1,0)) | |
483 | 483 | ctf_integer(__u64, rip, vcpu->arch.emulate_ctxt.decode.fetch.start) |
484 | 484 | ctf_integer(__u32, csbase, kvm_x86_ops->get_segment_base(vcpu, VCPU_SREG_CS)) |
485 | 485 | ctf_integer(__u8, len, vcpu->arch.emulate_ctxt.decode.eip |
486 | 486 | - vcpu->arch.emulate_ctxt.decode.fetch.start) |
487 | 487 | ctf_array(__u8, insn, vcpu->arch.emulate_ctxt.decode.fetch.data, 15) |
488 | 488 | ctf_integer(__u8, flags, kei_decode_mode(vcpu->arch.emulate_ctxt.mode)) |
489 | #elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)) | |
489 | #elif (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,17,0)) | |
490 | 490 | ctf_integer(__u64, rip, vcpu->arch.emulate_ctxt.fetch.start) |
491 | 491 | ctf_integer(__u32, csbase, kvm_x86_ops->get_segment_base(vcpu, VCPU_SREG_CS)) |
492 | 492 | ctf_integer(__u8, len, vcpu->arch.emulate_ctxt._eip |
493 | 493 | - vcpu->arch.emulate_ctxt.fetch.start) |
494 | 494 | ctf_array(__u8, insn, vcpu->arch.emulate_ctxt.fetch.data, 15) |
495 | 495 | ctf_integer(__u8, flags, kei_decode_mode(vcpu->arch.emulate_ctxt.mode)) |
496 | #elif (LINUX_VERSION_CODE < KERNEL_VERSION(5,7,0)) | |
496 | #elif (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(5,7,0)) | |
497 | 497 | ctf_integer(__u64, rip, vcpu->arch.emulate_ctxt._eip - |
498 | 498 | (vcpu->arch.emulate_ctxt.fetch.ptr - |
499 | 499 | vcpu->arch.emulate_ctxt.fetch.data)) |
532 | 532 | ) |
533 | 533 | ) |
534 | 534 | |
535 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) | |
535 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) | |
536 | 536 | LTTNG_TRACEPOINT_EVENT_MAP(kvm_write_tsc_offset, kvm_x86_write_tsc_offset, |
537 | 537 | TP_PROTO(unsigned int vcpu_id, __u64 previous_tsc_offset, |
538 | 538 | __u64 next_tsc_offset), |
546 | 546 | ) |
547 | 547 | #endif |
548 | 548 | |
549 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
549 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
550 | 550 | #ifdef CONFIG_X86_64 |
551 | 551 | |
552 | 552 | LTTNG_TRACEPOINT_EVENT_MAP(kvm_update_master_clock, kvm_x86_update_master_clock, |
577 | 577 | ) |
578 | 578 | |
579 | 579 | #endif /* CONFIG_X86_64 */ |
580 | #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) */ | |
580 | #endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0) */ | |
581 | 581 | |
582 | 582 | #endif /* LTTNG_TRACE_KVM_H */ |
583 | 583 |
6 | 6 | |
7 | 7 | #include <probes/lttng-tracepoint-event.h> |
8 | 8 | #include <linux/ktime.h> |
9 | #include <linux/version.h> | |
9 | #include <lttng-kernel-version.h> | |
10 | 10 | |
11 | 11 | #define DAPM_DIRECT "(direct)" |
12 | 12 | |
13 | 13 | #ifndef _TRACE_ASOC_DEF |
14 | 14 | #define _TRACE_ASOC_DEF |
15 | 15 | struct snd_soc_jack; |
16 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)) | |
16 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,19,0)) | |
17 | 17 | struct snd_soc_codec; |
18 | 18 | #endif |
19 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) && \ | |
20 | LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)) | |
19 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0) && \ | |
20 | LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,16,0)) | |
21 | 21 | struct snd_soc_platform; |
22 | 22 | #endif |
23 | 23 | struct snd_soc_card; |
24 | 24 | struct snd_soc_dapm_widget; |
25 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) | |
25 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,5,0)) | |
26 | 26 | struct snd_soc_dapm_path; |
27 | 27 | #endif |
28 | 28 | #endif |
29 | 29 | |
30 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0) \ | |
30 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,16,0) \ | |
31 | 31 | || LTTNG_RHEL_KERNEL_RANGE(3,10,0,514,0,0, 3,11,0,0,0,0)) |
32 | 32 | #define CODEC_NAME_FIELD component.name |
33 | 33 | #define CODEC_ID_FIELD component.id |
36 | 36 | #define CODEC_ID_FIELD id |
37 | 37 | #endif |
38 | 38 | |
39 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)) | |
39 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,16,0)) | |
40 | 40 | /* |
41 | 41 | * Log register events |
42 | 42 | */ |
78 | 78 | ) |
79 | 79 | #endif |
80 | 80 | |
81 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) && \ | |
82 | LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)) | |
81 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0) && \ | |
82 | LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,16,0)) | |
83 | 83 | LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_preg, |
84 | 84 | |
85 | 85 | TP_PROTO(struct snd_soc_platform *platform, unsigned int reg, |
223 | 223 | |
224 | 224 | ) |
225 | 225 | |
226 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) | |
226 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,2,0)) | |
227 | 227 | LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_walk_done, |
228 | 228 | |
229 | 229 | asoc_snd_soc_dapm_walk_done, |
241 | 241 | ) |
242 | 242 | #endif |
243 | 243 | |
244 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) | |
244 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) | |
245 | 245 | LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_path, |
246 | 246 | |
247 | 247 | asoc_snd_soc_dapm_path, |
261 | 261 | ctf_integer(int, path_dir, dir) |
262 | 262 | ) |
263 | 263 | ) |
264 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) | |
264 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,5,0)) | |
265 | 265 | LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_output_path, |
266 | 266 | |
267 | 267 | asoc_snd_soc_dapm_output_path, |
299 | 299 | ) |
300 | 300 | #endif |
301 | 301 | |
302 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) | |
302 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,5,0)) | |
303 | 303 | LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_connected, |
304 | 304 | |
305 | 305 | asoc_snd_soc_dapm_connected, |
328 | 328 | ) |
329 | 329 | ) |
330 | 330 | |
331 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) | |
331 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,5,0)) | |
332 | 332 | LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_report, |
333 | 333 | |
334 | 334 | asoc_snd_soc_jack_report, |
388 | 388 | ) |
389 | 389 | #endif |
390 | 390 | |
391 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)) | |
391 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,19,0)) | |
392 | 392 | LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_cache_sync, |
393 | 393 | |
394 | 394 | asoc_snd_soc_cache_sync, |
8 | 8 | #include <linux/blktrace_api.h> |
9 | 9 | #include <linux/blkdev.h> |
10 | 10 | #include <linux/trace_seq.h> |
11 | #include <linux/version.h> | |
12 | ||
13 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) | |
11 | #include <lttng-kernel-version.h> | |
12 | ||
13 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) | |
14 | 14 | #include <scsi/scsi_request.h> |
15 | #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ | |
15 | #endif /* (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) */ | |
16 | 16 | |
17 | 17 | #ifndef _TRACE_BLOCK_DEF_ |
18 | 18 | #define _TRACE_BLOCK_DEF_ |
49 | 49 | ) |
50 | 50 | ) |
51 | 51 | |
52 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0) || \ | |
52 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,8,0) || \ | |
53 | 53 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
54 | 54 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ |
55 | 55 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ |
77 | 77 | | ((rw) & REQ_PREFLUSH ? RWBS_FLAG_PREFLUSH : 0) \ |
78 | 78 | | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0)) |
79 | 79 | |
80 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) | |
80 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0)) | |
81 | 81 | |
82 | 82 | #define lttng_req_op(rq) |
83 | 83 | #define lttng_req_rw(rq) ((rq)->cmd_flags) |
115 | 115 | |
116 | 116 | #endif |
117 | 117 | |
118 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) | |
118 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) | |
119 | 119 | LTTNG_TRACEPOINT_EVENT_CLASS(block_buffer, |
120 | 120 | |
121 | 121 | TP_PROTO(struct buffer_head *bh), |
156 | 156 | ) |
157 | 157 | #endif |
158 | 158 | |
159 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) | |
159 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,12,0)) | |
160 | 160 | /* block_rq_with_error event class removed in kernel 4.12 */ |
161 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) | |
161 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) | |
162 | 162 | LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq_with_error, |
163 | 163 | |
164 | 164 | TP_PROTO(struct request_queue *q, struct request *rq), |
201 | 201 | |
202 | 202 | TP_code_post() |
203 | 203 | ) |
204 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ | |
204 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) */ | |
205 | 205 | LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq_with_error, |
206 | 206 | |
207 | 207 | TP_PROTO(struct request_queue *q, struct request *rq), |
244 | 244 | |
245 | 245 | TP_code_post() |
246 | 246 | ) |
247 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ | |
248 | ||
249 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0)) | |
247 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) */ | |
248 | ||
249 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(4,12,0)) | |
250 | 250 | /** |
251 | 251 | * block_rq_abort - abort block operation request |
252 | 252 | * @q: queue containing the block operation request |
265 | 265 | ) |
266 | 266 | #endif |
267 | 267 | |
268 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) | |
269 | /** | |
270 | * block_rq_requeue - place block IO request back on a queue | |
271 | * @rq: block IO operation request | |
272 | * | |
273 | * The block operation request @rq is being placed back into queue | |
274 | * @q. For some reason the request was not completed and needs to be | |
275 | * put back in the queue. | |
276 | */ | |
277 | LTTNG_TRACEPOINT_EVENT(block_rq_requeue, | |
278 | ||
279 | TP_PROTO(struct request *rq), | |
280 | ||
281 | TP_ARGS(rq), | |
282 | ||
283 | TP_FIELDS( | |
284 | ctf_integer(dev_t, dev, | |
285 | rq->rq_disk ? disk_devt(rq->rq_disk) : 0) | |
286 | ctf_integer(sector_t, sector, blk_rq_trace_sector(rq)) | |
287 | ctf_integer(unsigned int, nr_sector, blk_rq_trace_nr_sectors(rq)) | |
288 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
289 | lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq)) | |
290 | ) | |
291 | ) | |
292 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,12,0)) | |
268 | 293 | /** |
269 | 294 | * block_rq_requeue - place block IO request back on a queue |
270 | 295 | * @q: queue holding operation |
274 | 299 | * @q. For some reason the request was not completed and needs to be |
275 | 300 | * put back in the queue. |
276 | 301 | */ |
277 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) | |
278 | 302 | LTTNG_TRACEPOINT_EVENT(block_rq_requeue, |
279 | 303 | |
280 | 304 | TP_PROTO(struct request_queue *q, struct request *rq), |
311 | 335 | * do for the request. If @rq->bio is non-NULL then there is |
312 | 336 | * additional work required to complete the request. |
313 | 337 | */ |
314 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) | |
338 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,12,0)) | |
315 | 339 | LTTNG_TRACEPOINT_EVENT(block_rq_complete, |
316 | 340 | |
317 | 341 | TP_PROTO(struct request *rq, int error, unsigned int nr_bytes), |
328 | 352 | lttng_req_op(rq), lttng_req_rw(rq), nr_bytes) |
329 | 353 | ) |
330 | 354 | ) |
331 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) | |
355 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) | |
332 | 356 | LTTNG_TRACEPOINT_EVENT_CODE(block_rq_complete, |
333 | 357 | |
334 | 358 | TP_PROTO(struct request_queue *q, struct request *rq, |
366 | 390 | |
367 | 391 | TP_code_post() |
368 | 392 | ) |
369 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,5) \ | |
393 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,5) \ | |
370 | 394 | || LTTNG_KERNEL_RANGE(3,12,21, 3,13,0) \ |
371 | 395 | || LTTNG_KERNEL_RANGE(3,10,41, 3,11,0) \ |
372 | 396 | || LTTNG_KERNEL_RANGE(3,4,91, 3,5,0) \ |
411 | 435 | TP_code_post() |
412 | 436 | ) |
413 | 437 | |
414 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */ | |
438 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,15,0)) */ | |
415 | 439 | |
416 | 440 | /** |
417 | 441 | * block_rq_complete - block IO operation completed by device driver |
431 | 455 | TP_ARGS(q, rq) |
432 | 456 | ) |
433 | 457 | |
434 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */ | |
435 | ||
436 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) | |
458 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,15,0)) */ | |
459 | ||
460 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) | |
437 | 461 | LTTNG_TRACEPOINT_EVENT_CLASS(block_rq, |
438 | 462 | |
439 | TP_PROTO(struct request_queue *q, struct request *rq), | |
440 | ||
441 | TP_ARGS(q, rq), | |
463 | TP_PROTO(struct request *rq), | |
464 | ||
465 | TP_ARGS(rq), | |
442 | 466 | |
443 | 467 | TP_FIELDS( |
444 | 468 | ctf_integer(dev_t, dev, |
452 | 476 | ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) |
453 | 477 | ) |
454 | 478 | ) |
455 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) | |
479 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,12,0)) | |
480 | LTTNG_TRACEPOINT_EVENT_CLASS(block_rq, | |
481 | ||
482 | TP_PROTO(struct request_queue *q, struct request *rq), | |
483 | ||
484 | TP_ARGS(q, rq), | |
485 | ||
486 | TP_FIELDS( | |
487 | ctf_integer(dev_t, dev, | |
488 | rq->rq_disk ? disk_devt(rq->rq_disk) : 0) | |
489 | ctf_integer(sector_t, sector, blk_rq_trace_sector(rq)) | |
490 | ctf_integer(unsigned int, nr_sector, blk_rq_trace_nr_sectors(rq)) | |
491 | ctf_integer(unsigned int, bytes, blk_rq_bytes(rq)) | |
492 | ctf_integer(pid_t, tid, current->pid) | |
493 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
494 | lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq)) | |
495 | ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) | |
496 | ) | |
497 | ) | |
498 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) | |
456 | 499 | LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq, |
457 | 500 | |
458 | 501 | TP_PROTO(struct request_queue *q, struct request *rq), |
500 | 543 | |
501 | 544 | TP_code_post() |
502 | 545 | ) |
503 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ | |
546 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) */ | |
504 | 547 | LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq, |
505 | 548 | |
506 | 549 | TP_PROTO(struct request_queue *q, struct request *rq), |
547 | 590 | |
548 | 591 | TP_code_post() |
549 | 592 | ) |
550 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ | |
551 | ||
593 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) */ | |
594 | ||
595 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) | |
552 | 596 | /** |
553 | 597 | * block_rq_insert - insert block operation request into queue |
554 | * @q: target queue | |
555 | 598 | * @rq: block IO operation request |
556 | 599 | * |
557 | 600 | * Called immediately before block operation request @rq is inserted |
561 | 604 | */ |
562 | 605 | LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq, block_rq_insert, |
563 | 606 | |
607 | TP_PROTO(struct request *rq), | |
608 | ||
609 | TP_ARGS(rq) | |
610 | ) | |
611 | #else | |
612 | /** | |
613 | * block_rq_insert - insert block operation request into queue | |
614 | * @q: target queue | |
615 | * @rq: block IO operation request | |
616 | * | |
617 | * Called immediately before block operation request @rq is inserted | |
618 | * into queue @q. The fields in the operation request @rq struct can | |
619 | * be examined to determine which device and sectors the pending | |
620 | * operation would access. | |
621 | */ | |
622 | LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq, block_rq_insert, | |
623 | ||
564 | 624 | TP_PROTO(struct request_queue *q, struct request *rq), |
565 | 625 | |
566 | 626 | TP_ARGS(q, rq) |
567 | 627 | ) |
568 | ||
628 | #endif | |
629 | ||
630 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) | |
631 | /** | |
632 | * block_rq_issue - issue pending block IO request operation to device driver | |
633 | * @rq: block IO operation operation request | |
634 | * | |
635 | * Called when block operation request @rq from queue @q is sent to a | |
636 | * device driver for processing. | |
637 | */ | |
638 | LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq, block_rq_issue, | |
639 | ||
640 | TP_PROTO(struct request *rq), | |
641 | ||
642 | TP_ARGS(rq) | |
643 | ) | |
644 | #else | |
569 | 645 | /** |
570 | 646 | * block_rq_issue - issue pending block IO request operation to device driver |
571 | 647 | * @q: queue holding operation |
580 | 656 | |
581 | 657 | TP_ARGS(q, rq) |
582 | 658 | ) |
583 | ||
659 | #endif | |
660 | ||
661 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) | |
662 | /** | |
663 | * block_rq_merge - merge request with another one in the elevator | |
664 | * @rq: block IO operation operation request | |
665 | * | |
666 | * Called when block operation request @rq from queue @q is merged to another | |
667 | * request queued in the elevator. | |
668 | */ | |
669 | LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq, block_rq_merge, | |
670 | ||
671 | TP_PROTO(struct request *rq), | |
672 | ||
673 | TP_ARGS(rq) | |
674 | ) | |
675 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,9,0)) | |
676 | /** | |
677 | * block_rq_merge - merge request with another one in the elevator | |
678 | * @q: queue holding operation | |
679 | * @rq: block IO operation operation request | |
680 | * | |
681 | * Called when block operation request @rq from queue @q is merged to another | |
682 | * request queued in the elevator. | |
683 | */ | |
684 | LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq, block_rq_merge, | |
685 | ||
686 | TP_PROTO(struct request_queue *q, struct request *rq), | |
687 | ||
688 | TP_ARGS(q, rq) | |
689 | ) | |
690 | #endif | |
691 | ||
692 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,8,0)) | |
693 | /** | |
694 | * block_bio_complete - completed all work on the block operation | |
695 | * @q: queue holding the block operation | |
696 | * @bio: block operation completed | |
697 | * @error: io error value | |
698 | * | |
699 | * This tracepoint indicates there is no further work to do on this | |
700 | * block IO operation @bio. | |
701 | */ | |
702 | LTTNG_TRACEPOINT_EVENT(block_bio_complete, | |
703 | ||
704 | TP_PROTO(struct request_queue *q, struct bio *bio), | |
705 | ||
706 | TP_ARGS(q, bio), | |
707 | ||
708 | TP_FIELDS( | |
709 | ctf_integer(dev_t, dev, bio_dev(bio)) | |
710 | ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) | |
711 | ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) | |
712 | ctf_integer(int, error, blk_status_to_errno(bio->bi_status)) | |
713 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
714 | lttng_bio_op(bio), lttng_bio_rw(bio), | |
715 | bio->bi_iter.bi_size) | |
716 | ) | |
717 | ) | |
718 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0)) | |
719 | /** | |
720 | * block_bio_complete - completed all work on the block operation | |
721 | * @q: queue holding the block operation | |
722 | * @bio: block operation completed | |
723 | * @error: io error value | |
724 | * | |
725 | * This tracepoint indicates there is no further work to do on this | |
726 | * block IO operation @bio. | |
727 | */ | |
728 | LTTNG_TRACEPOINT_EVENT(block_bio_complete, | |
729 | ||
730 | TP_PROTO(struct request_queue *q, struct bio *bio, int error), | |
731 | ||
732 | TP_ARGS(q, bio, error), | |
733 | ||
734 | TP_FIELDS( | |
735 | ctf_integer(dev_t, dev, bio_dev(bio)) | |
736 | ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) | |
737 | ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) | |
738 | ctf_integer(int, error, error) | |
739 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
740 | lttng_bio_op(bio), lttng_bio_rw(bio), | |
741 | bio->bi_iter.bi_size) | |
742 | ) | |
743 | ) | |
744 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0)) | |
745 | /** | |
746 | * block_bio_complete - completed all work on the block operation | |
747 | * @q: queue holding the block operation | |
748 | * @bio: block operation completed | |
749 | * @error: io error value | |
750 | * | |
751 | * This tracepoint indicates there is no further work to do on this | |
752 | * block IO operation @bio. | |
753 | */ | |
754 | LTTNG_TRACEPOINT_EVENT(block_bio_complete, | |
755 | ||
756 | TP_PROTO(struct request_queue *q, struct bio *bio, int error), | |
757 | ||
758 | TP_ARGS(q, bio, error), | |
759 | ||
760 | TP_FIELDS( | |
761 | ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) | |
762 | ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) | |
763 | ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) | |
764 | ctf_integer(int, error, error) | |
765 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
766 | lttng_bio_op(bio), lttng_bio_rw(bio), | |
767 | bio->bi_iter.bi_size) | |
768 | ) | |
769 | ) | |
770 | #else | |
771 | /** | |
772 | * block_bio_complete - completed all work on the block operation | |
773 | * @q: queue holding the block operation | |
774 | * @bio: block operation completed | |
775 | * @error: io error value | |
776 | * | |
777 | * This tracepoint indicates there is no further work to do on this | |
778 | * block IO operation @bio. | |
779 | */ | |
780 | LTTNG_TRACEPOINT_EVENT(block_bio_complete, | |
781 | ||
782 | TP_PROTO(struct request_queue *q, struct bio *bio, int error), | |
783 | ||
784 | TP_ARGS(q, bio, error), | |
785 | ||
786 | TP_FIELDS( | |
787 | ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) | |
788 | ctf_integer(sector_t, sector, bio->bi_sector) | |
789 | ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) | |
790 | ctf_integer(int, error, error) | |
791 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
792 | lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) | |
793 | ) | |
794 | ) | |
795 | #endif | |
796 | ||
797 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) | |
798 | LTTNG_TRACEPOINT_EVENT_CLASS(block_bio, | |
799 | ||
800 | TP_PROTO(struct bio *bio), | |
801 | ||
802 | TP_ARGS(bio), | |
803 | ||
804 | TP_FIELDS( | |
805 | ctf_integer(dev_t, dev, bio_dev(bio)) | |
806 | ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) | |
807 | ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) | |
808 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
809 | lttng_bio_op(bio), lttng_bio_rw(bio), | |
810 | bio->bi_iter.bi_size) | |
811 | ctf_integer(pid_t, tid, current->pid) | |
812 | ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) | |
813 | ) | |
814 | ) | |
815 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0)) | |
816 | LTTNG_TRACEPOINT_EVENT_CLASS(block_bio_merge, | |
817 | ||
818 | TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio), | |
819 | ||
820 | TP_ARGS(q, rq, bio), | |
821 | ||
822 | TP_FIELDS( | |
823 | ctf_integer(dev_t, dev, bio_dev(bio)) | |
824 | ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) | |
825 | ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) | |
826 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
827 | lttng_bio_op(bio), lttng_bio_rw(bio), | |
828 | bio->bi_iter.bi_size) | |
829 | ctf_integer(pid_t, tid, current->pid) | |
830 | ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) | |
831 | ) | |
832 | ) | |
833 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0)) | |
834 | LTTNG_TRACEPOINT_EVENT_CLASS(block_bio_merge, | |
835 | ||
836 | TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio), | |
837 | ||
838 | TP_ARGS(q, rq, bio), | |
839 | ||
840 | TP_FIELDS( | |
841 | ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) | |
842 | ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) | |
843 | ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) | |
844 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
845 | lttng_bio_op(bio), lttng_bio_rw(bio), | |
846 | bio->bi_iter.bi_size) | |
847 | ctf_integer(pid_t, tid, current->pid) | |
848 | ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) | |
849 | ) | |
850 | ) | |
851 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) | |
852 | LTTNG_TRACEPOINT_EVENT_CLASS(block_bio_merge, | |
853 | ||
854 | TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio), | |
855 | ||
856 | TP_ARGS(q, rq, bio), | |
857 | ||
858 | TP_FIELDS( | |
859 | ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) | |
860 | ctf_integer(sector_t, sector, bio->bi_sector) | |
861 | ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) | |
862 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
863 | lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) | |
864 | ctf_integer(pid_t, tid, current->pid) | |
865 | ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) | |
866 | ) | |
867 | ) | |
868 | #endif | |
869 | ||
870 | ||
871 | ||
872 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) | |
584 | 873 | /** |
585 | 874 | * block_bio_bounce - used bounce buffer when processing block operation |
586 | * @q: queue holding the block operation | |
587 | 875 | * @bio: block operation |
588 | 876 | * |
589 | 877 | * A bounce buffer was used to handle the block operation @bio in @q. |
592 | 880 | * bounce buffer requires extra copying of data and decreases |
593 | 881 | * performance. |
594 | 882 | */ |
883 | LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_bounce, | |
884 | ||
885 | TP_PROTO(struct bio *bio), | |
886 | ||
887 | TP_ARGS(bio) | |
888 | ) | |
889 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0)) | |
890 | /** | |
891 | * block_bio_bounce - used bounce buffer when processing block operation | |
892 | * @q: queue holding the block operation | |
893 | * @bio: block operation | |
894 | * | |
895 | * A bounce buffer was used to handle the block operation @bio in @q. | |
896 | * This occurs when hardware limitations prevent a direct transfer of | |
897 | * data between the @bio data memory area and the IO device. Use of a | |
898 | * bounce buffer requires extra copying of data and decreases | |
899 | * performance. | |
900 | */ | |
595 | 901 | LTTNG_TRACEPOINT_EVENT(block_bio_bounce, |
596 | ||
597 | TP_PROTO(struct request_queue *q, struct bio *bio), | |
598 | ||
599 | TP_ARGS(q, bio), | |
600 | ||
601 | TP_FIELDS( | |
602 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) | |
603 | ctf_integer(dev_t, dev, bio_dev(bio)) | |
604 | #else | |
605 | ctf_integer(dev_t, dev, bio->bi_bdev ? bio->bi_bdev->bd_dev : 0) | |
606 | #endif | |
607 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) | |
608 | ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) | |
609 | ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) | |
610 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
611 | lttng_bio_op(bio), lttng_bio_rw(bio), | |
612 | bio->bi_iter.bi_size) | |
613 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ | |
614 | ctf_integer(sector_t, sector, bio->bi_sector) | |
615 | ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) | |
616 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
617 | lttng_bio_op(bio), lttng_bio_rw(bio), | |
618 | bio->bi_size) | |
619 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ | |
620 | ctf_integer(pid_t, tid, current->pid) | |
621 | ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) | |
622 | ) | |
623 | ) | |
624 | ||
625 | ||
626 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0)) | |
627 | /** | |
628 | * block_bio_complete - completed all work on the block operation | |
629 | * @q: queue holding the block operation | |
630 | * @bio: block operation completed | |
631 | * @error: io error value | |
632 | * | |
633 | * This tracepoint indicates there is no further work to do on this | |
634 | * block IO operation @bio. | |
635 | */ | |
636 | LTTNG_TRACEPOINT_EVENT(block_bio_complete, | |
637 | 902 | |
638 | 903 | TP_PROTO(struct request_queue *q, struct bio *bio), |
639 | 904 | |
643 | 908 | ctf_integer(dev_t, dev, bio_dev(bio)) |
644 | 909 | ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) |
645 | 910 | ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) |
646 | ctf_integer(int, error, blk_status_to_errno(bio->bi_status)) | |
647 | 911 | blk_rwbs_ctf_integer(unsigned int, rwbs, |
648 | 912 | lttng_bio_op(bio), lttng_bio_rw(bio), |
649 | 913 | bio->bi_iter.bi_size) |
650 | ) | |
651 | ) | |
652 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) | |
653 | /** | |
654 | * block_bio_complete - completed all work on the block operation | |
655 | * @q: queue holding the block operation | |
656 | * @bio: block operation completed | |
657 | * @error: io error value | |
658 | * | |
659 | * This tracepoint indicates there is no further work to do on this | |
660 | * block IO operation @bio. | |
661 | */ | |
662 | LTTNG_TRACEPOINT_EVENT(block_bio_complete, | |
663 | ||
664 | TP_PROTO(struct request_queue *q, struct bio *bio, int error), | |
665 | ||
666 | TP_ARGS(q, bio, error), | |
667 | ||
668 | TP_FIELDS( | |
669 | ctf_integer(dev_t, dev, bio_dev(bio)) | |
914 | ctf_integer(pid_t, tid, current->pid) | |
915 | ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) | |
916 | ) | |
917 | ) | |
918 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0)) | |
919 | LTTNG_TRACEPOINT_EVENT(block_bio_bounce, | |
920 | ||
921 | TP_PROTO(struct request_queue *q, struct bio *bio), | |
922 | ||
923 | TP_ARGS(q, bio), | |
924 | ||
925 | TP_FIELDS( | |
926 | ctf_integer(dev_t, dev, bio->bi_bdev ? bio->bi_bdev->bd_dev : 0) | |
670 | 927 | ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) |
671 | 928 | ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) |
672 | ctf_integer(int, error, error) | |
673 | 929 | blk_rwbs_ctf_integer(unsigned int, rwbs, |
674 | 930 | lttng_bio_op(bio), lttng_bio_rw(bio), |
675 | 931 | bio->bi_iter.bi_size) |
676 | ) | |
677 | ) | |
678 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) | |
679 | /** | |
680 | * block_bio_complete - completed all work on the block operation | |
681 | * @q: queue holding the block operation | |
682 | * @bio: block operation completed | |
683 | * @error: io error value | |
684 | * | |
685 | * This tracepoint indicates there is no further work to do on this | |
686 | * block IO operation @bio. | |
687 | */ | |
688 | LTTNG_TRACEPOINT_EVENT(block_bio_complete, | |
689 | ||
690 | TP_PROTO(struct request_queue *q, struct bio *bio, int error), | |
691 | ||
692 | TP_ARGS(q, bio, error), | |
693 | ||
694 | TP_FIELDS( | |
695 | ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) | |
696 | ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) | |
697 | ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) | |
698 | ctf_integer(int, error, error) | |
699 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
700 | lttng_bio_op(bio), lttng_bio_rw(bio), | |
701 | bio->bi_iter.bi_size) | |
932 | ctf_integer(pid_t, tid, current->pid) | |
933 | ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) | |
702 | 934 | ) |
703 | 935 | ) |
704 | 936 | #else |
705 | /** | |
706 | * block_bio_complete - completed all work on the block operation | |
707 | * @q: queue holding the block operation | |
708 | * @bio: block operation completed | |
709 | * @error: io error value | |
710 | * | |
711 | * This tracepoint indicates there is no further work to do on this | |
712 | * block IO operation @bio. | |
713 | */ | |
714 | LTTNG_TRACEPOINT_EVENT(block_bio_complete, | |
715 | ||
716 | TP_PROTO(struct request_queue *q, struct bio *bio, int error), | |
717 | ||
718 | TP_ARGS(q, bio, error), | |
719 | ||
720 | TP_FIELDS( | |
721 | ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) | |
937 | LTTNG_TRACEPOINT_EVENT(block_bio_bounce, | |
938 | ||
939 | TP_PROTO(struct request_queue *q, struct bio *bio), | |
940 | ||
941 | TP_ARGS(q, bio), | |
942 | ||
943 | TP_FIELDS( | |
944 | ctf_integer(dev_t, dev, bio->bi_bdev ? bio->bi_bdev->bd_dev : 0) | |
722 | 945 | ctf_integer(sector_t, sector, bio->bi_sector) |
723 | 946 | ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) |
724 | ctf_integer(int, error, error) | |
725 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
726 | lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) | |
947 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
948 | lttng_bio_op(bio), lttng_bio_rw(bio), | |
949 | bio->bi_size) | |
950 | ctf_integer(pid_t, tid, current->pid) | |
951 | ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) | |
727 | 952 | ) |
728 | 953 | ) |
729 | 954 | #endif |
730 | 955 | |
731 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) | |
732 | LTTNG_TRACEPOINT_EVENT_CLASS(block_bio_merge, | |
956 | ||
957 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) | |
958 | /** | |
959 | * block_bio_backmerge - merging block operation to the end of an existing operation | |
960 | * @bio: new block operation to merge | |
961 | * | |
962 | * Merging block request @bio to the end of an existing block request. | |
963 | */ | |
964 | LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_backmerge, | |
965 | ||
966 | TP_PROTO(struct bio *bio), | |
967 | ||
968 | TP_ARGS(bio) | |
969 | ) | |
970 | ||
971 | /** | |
972 | * block_bio_frontmerge - merging block operation to the beginning of an existing operation | |
973 | * @bio: new block operation to merge | |
974 | * | |
975 | * Merging block IO operation @bio to the beginning of an existing block request. | |
976 | */ | |
977 | LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_frontmerge, | |
978 | ||
979 | TP_PROTO(struct bio *bio), | |
980 | ||
981 | TP_ARGS(bio) | |
982 | ) | |
983 | ||
984 | /** | |
985 | * block_bio_queue - putting new block IO operation in queue | |
986 | * @bio: new block operation | |
987 | * | |
988 | * About to place the block IO operation @bio into queue @q. | |
989 | */ | |
990 | LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_queue, | |
991 | ||
992 | TP_PROTO(struct bio *bio), | |
993 | ||
994 | TP_ARGS(bio) | |
995 | ) | |
996 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) | |
997 | /** | |
998 | * block_bio_backmerge - merging block operation to the end of an existing operation | |
999 | * @q: queue holding operation | |
1000 | * @rq: request bio is being merged into | |
1001 | * @bio: new block operation to merge | |
1002 | * | |
1003 | * Merging block request @bio to the end of an existing block request | |
1004 | * in queue @q. | |
1005 | */ | |
1006 | LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio_merge, block_bio_backmerge, | |
733 | 1007 | |
734 | 1008 | TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio), |
735 | 1009 | |
736 | TP_ARGS(q, rq, bio), | |
737 | ||
738 | TP_FIELDS( | |
739 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) | |
1010 | TP_ARGS(q, rq, bio) | |
1011 | ) | |
1012 | ||
1013 | /** | |
1014 | * block_bio_frontmerge - merging block operation to the beginning of an existing operation | |
1015 | * @q: queue holding operation | |
1016 | * @rq: request bio is being merged into | |
1017 | * @bio: new block operation to merge | |
1018 | * | |
1019 | * Merging block IO operation @bio to the beginning of an existing block | |
1020 | * operation in queue @q. | |
1021 | */ | |
1022 | LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio_merge, block_bio_frontmerge, | |
1023 | ||
1024 | TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio), | |
1025 | ||
1026 | TP_ARGS(q, rq, bio) | |
1027 | ) | |
1028 | ||
1029 | /** | |
1030 | * block_bio_queue - putting new block IO operation in queue | |
1031 | * @q: queue holding operation | |
1032 | * @bio: new block operation | |
1033 | * | |
1034 | * About to place the block IO operation @bio into queue @q. | |
1035 | */ | |
1036 | LTTNG_TRACEPOINT_EVENT(block_bio_queue, | |
1037 | ||
1038 | TP_PROTO(struct request_queue *q, struct bio *bio), | |
1039 | ||
1040 | TP_ARGS(q, bio), | |
1041 | ||
1042 | TP_FIELDS( | |
1043 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0)) | |
740 | 1044 | ctf_integer(dev_t, dev, bio_dev(bio)) |
741 | 1045 | #else |
742 | 1046 | ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) |
743 | 1047 | #endif |
744 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) | |
1048 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0)) | |
745 | 1049 | ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) |
746 | 1050 | ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) |
747 | 1051 | blk_rwbs_ctf_integer(unsigned int, rwbs, |
748 | 1052 | lttng_bio_op(bio), lttng_bio_rw(bio), |
749 | 1053 | bio->bi_iter.bi_size) |
750 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ | |
1054 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0)) */ | |
751 | 1055 | ctf_integer(sector_t, sector, bio->bi_sector) |
752 | 1056 | ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) |
753 | 1057 | blk_rwbs_ctf_integer(unsigned int, rwbs, |
754 | 1058 | lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) |
755 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ | |
1059 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0)) */ | |
1060 | ctf_integer(pid_t, tid, current->pid) | |
1061 | ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) | |
1062 | ) | |
1063 | ) | |
1064 | #else /* if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) */ | |
1065 | LTTNG_TRACEPOINT_EVENT_CLASS(block_bio, | |
1066 | ||
1067 | TP_PROTO(struct request_queue *q, struct bio *bio), | |
1068 | ||
1069 | TP_ARGS(q, bio), | |
1070 | ||
1071 | TP_FIELDS( | |
1072 | ctf_integer(dev_t, dev, bio->bi_bdev ? bio->bi_bdev->bd_dev : 0) | |
1073 | ctf_integer(sector_t, sector, bio->bi_sector) | |
1074 | ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) | |
1075 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
1076 | lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) | |
756 | 1077 | ctf_integer(pid_t, tid, current->pid) |
757 | 1078 | ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) |
758 | 1079 | ) |
766 | 1087 | * Merging block request @bio to the end of an existing block request |
767 | 1088 | * in queue @q. |
768 | 1089 | */ |
769 | LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio_merge, block_bio_backmerge, | |
770 | ||
771 | TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio), | |
772 | ||
773 | TP_ARGS(q, rq, bio) | |
1090 | LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_backmerge, | |
1091 | ||
1092 | TP_PROTO(struct request_queue *q, struct bio *bio), | |
1093 | ||
1094 | TP_ARGS(q, bio) | |
774 | 1095 | ) |
775 | 1096 | |
776 | 1097 | /** |
781 | 1102 | * Merging block IO operation @bio to the beginning of an existing block |
782 | 1103 | * operation in queue @q. |
783 | 1104 | */ |
784 | LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio_merge, block_bio_frontmerge, | |
785 | ||
786 | TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio), | |
787 | ||
788 | TP_ARGS(q, rq, bio) | |
1105 | LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_frontmerge, | |
1106 | ||
1107 | TP_PROTO(struct request_queue *q, struct bio *bio), | |
1108 | ||
1109 | TP_ARGS(q, bio) | |
789 | 1110 | ) |
790 | 1111 | |
791 | 1112 | /** |
795 | 1116 | * |
796 | 1117 | * About to place the block IO operation @bio into queue @q. |
797 | 1118 | */ |
798 | LTTNG_TRACEPOINT_EVENT(block_bio_queue, | |
1119 | LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_queue, | |
799 | 1120 | |
800 | 1121 | TP_PROTO(struct request_queue *q, struct bio *bio), |
801 | 1122 | |
802 | TP_ARGS(q, bio), | |
803 | ||
804 | TP_FIELDS( | |
805 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) | |
806 | ctf_integer(dev_t, dev, bio_dev(bio)) | |
1123 | TP_ARGS(q, bio) | |
1124 | ) | |
1125 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) */ | |
1126 | ||
1127 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) | |
1128 | /** | |
1129 | * block_getrq - get a free request entry in queue for block IO operations | |
1130 | * @bio: pending block IO operation (can be %NULL) | |
1131 | * | |
1132 | * A request struct has been allocated to handle the block IO operation @bio. | |
1133 | */ | |
1134 | LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_getrq, | |
1135 | ||
1136 | TP_PROTO(struct bio *bio), | |
1137 | ||
1138 | TP_ARGS(bio) | |
1139 | ) | |
807 | 1140 | #else |
808 | ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) | |
809 | #endif | |
810 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) | |
811 | ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) | |
812 | ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) | |
813 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
814 | lttng_bio_op(bio), lttng_bio_rw(bio), | |
815 | bio->bi_iter.bi_size) | |
816 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ | |
817 | ctf_integer(sector_t, sector, bio->bi_sector) | |
818 | ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) | |
819 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
820 | lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) | |
821 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ | |
822 | ctf_integer(pid_t, tid, current->pid) | |
823 | ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) | |
824 | ) | |
825 | ) | |
826 | #else /* if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) */ | |
827 | LTTNG_TRACEPOINT_EVENT_CLASS(block_bio, | |
828 | ||
829 | TP_PROTO(struct request_queue *q, struct bio *bio), | |
830 | ||
831 | TP_ARGS(q, bio), | |
832 | ||
833 | TP_FIELDS( | |
834 | ctf_integer(dev_t, dev, bio->bi_bdev ? bio->bi_bdev->bd_dev : 0) | |
835 | ctf_integer(sector_t, sector, bio->bi_sector) | |
836 | ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) | |
837 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
838 | lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) | |
839 | ctf_integer(pid_t, tid, current->pid) | |
840 | ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) | |
841 | ) | |
842 | ) | |
843 | ||
844 | /** | |
845 | * block_bio_backmerge - merging block operation to the end of an existing operation | |
846 | * @q: queue holding operation | |
847 | * @bio: new block operation to merge | |
848 | * | |
849 | * Merging block request @bio to the end of an existing block request | |
850 | * in queue @q. | |
851 | */ | |
852 | LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_backmerge, | |
853 | ||
854 | TP_PROTO(struct request_queue *q, struct bio *bio), | |
855 | ||
856 | TP_ARGS(q, bio) | |
857 | ) | |
858 | ||
859 | /** | |
860 | * block_bio_frontmerge - merging block operation to the beginning of an existing operation | |
861 | * @q: queue holding operation | |
862 | * @bio: new block operation to merge | |
863 | * | |
864 | * Merging block IO operation @bio to the beginning of an existing block | |
865 | * operation in queue @q. | |
866 | */ | |
867 | LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_frontmerge, | |
868 | ||
869 | TP_PROTO(struct request_queue *q, struct bio *bio), | |
870 | ||
871 | TP_ARGS(q, bio) | |
872 | ) | |
873 | ||
874 | /** | |
875 | * block_bio_queue - putting new block IO operation in queue | |
876 | * @q: queue holding operation | |
877 | * @bio: new block operation | |
878 | * | |
879 | * About to place the block IO operation @bio into queue @q. | |
880 | */ | |
881 | LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_queue, | |
882 | ||
883 | TP_PROTO(struct request_queue *q, struct bio *bio), | |
884 | ||
885 | TP_ARGS(q, bio) | |
886 | ) | |
887 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) */ | |
888 | ||
889 | 1141 | LTTNG_TRACEPOINT_EVENT_CLASS(block_get_rq, |
890 | 1142 | |
891 | 1143 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), |
893 | 1145 | TP_ARGS(q, bio, rw), |
894 | 1146 | |
895 | 1147 | TP_FIELDS( |
896 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) | |
1148 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0)) | |
897 | 1149 | ctf_integer(dev_t, dev, bio ? bio_dev(bio) : 0) |
898 | 1150 | #else |
899 | 1151 | ctf_integer(dev_t, dev, bio ? bio->bi_bdev->bd_dev : 0) |
900 | 1152 | #endif |
901 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) | |
1153 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0)) | |
902 | 1154 | ctf_integer(sector_t, sector, bio ? bio->bi_iter.bi_sector : 0) |
903 | 1155 | ctf_integer(unsigned int, nr_sector, |
904 | 1156 | bio ? bio_sectors(bio) : 0) |
906 | 1158 | bio ? lttng_bio_op(bio) : 0, |
907 | 1159 | bio ? lttng_bio_rw(bio) : 0, |
908 | 1160 | bio ? bio->bi_iter.bi_size : 0) |
909 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ | |
1161 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0)) */ | |
910 | 1162 | ctf_integer(sector_t, sector, bio ? bio->bi_sector : 0) |
911 | 1163 | ctf_integer(unsigned int, nr_sector, |
912 | 1164 | bio ? bio->bi_size >> 9 : 0) |
914 | 1166 | bio ? lttng_bio_op(bio) : 0, |
915 | 1167 | bio ? lttng_bio_rw(bio) : 0, |
916 | 1168 | bio ? bio->bi_size : 0) |
917 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ | |
1169 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0)) */ | |
918 | 1170 | ctf_integer(pid_t, tid, current->pid) |
919 | 1171 | ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) |
920 | 1172 | ) |
953 | 1205 | |
954 | 1206 | TP_ARGS(q, bio, rw) |
955 | 1207 | ) |
1208 | #endif | |
956 | 1209 | |
957 | 1210 | /** |
958 | 1211 | * block_plug - keep operations requests in request queue |
1003 | 1256 | TP_ARGS(q, depth, explicit) |
1004 | 1257 | ) |
1005 | 1258 | |
1259 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) | |
1260 | /** | |
1261 | * block_split - split a single bio struct into two bio structs | |
1262 | * @bio: block operation being split | |
1263 | * @new_sector: The starting sector for the new bio | |
1264 | * | |
1265 | * The bio request @bio needs to be split into two bio requests. The newly | |
1266 | * created @bio request starts at @new_sector. This split may be required due to | |
1267 | * hardware limitations such as operation crossing device boundaries in a RAID | |
1268 | * system. | |
1269 | */ | |
1270 | LTTNG_TRACEPOINT_EVENT(block_split, | |
1271 | ||
1272 | TP_PROTO(struct bio *bio, unsigned int new_sector), | |
1273 | ||
1274 | TP_ARGS(bio, new_sector), | |
1275 | ||
1276 | TP_FIELDS( | |
1277 | ctf_integer(dev_t, dev, bio_dev(bio)) | |
1278 | ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) | |
1279 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
1280 | lttng_bio_op(bio), lttng_bio_rw(bio), | |
1281 | bio->bi_iter.bi_size) | |
1282 | ctf_integer(sector_t, new_sector, new_sector) | |
1283 | ctf_integer(pid_t, tid, current->pid) | |
1284 | ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) | |
1285 | ) | |
1286 | ) | |
1287 | ||
1288 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0)) | |
1006 | 1289 | /** |
1007 | 1290 | * block_split - split a single bio struct into two bio structs |
1008 | 1291 | * @q: queue containing the bio |
1022 | 1305 | TP_ARGS(q, bio, new_sector), |
1023 | 1306 | |
1024 | 1307 | TP_FIELDS( |
1025 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) | |
1026 | 1308 | ctf_integer(dev_t, dev, bio_dev(bio)) |
1027 | #else | |
1028 | ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) | |
1029 | #endif | |
1030 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) | |
1031 | 1309 | ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) |
1032 | 1310 | blk_rwbs_ctf_integer(unsigned int, rwbs, |
1033 | 1311 | lttng_bio_op(bio), lttng_bio_rw(bio), |
1034 | 1312 | bio->bi_iter.bi_size) |
1035 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ | |
1313 | ctf_integer(sector_t, new_sector, new_sector) | |
1314 | ctf_integer(pid_t, tid, current->pid) | |
1315 | ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) | |
1316 | ) | |
1317 | ) | |
1318 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0)) | |
1319 | LTTNG_TRACEPOINT_EVENT(block_split, | |
1320 | ||
1321 | TP_PROTO(struct request_queue *q, struct bio *bio, | |
1322 | unsigned int new_sector), | |
1323 | ||
1324 | TP_ARGS(q, bio, new_sector), | |
1325 | ||
1326 | TP_FIELDS( | |
1327 | ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) | |
1328 | ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) | |
1329 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
1330 | lttng_bio_op(bio), lttng_bio_rw(bio), | |
1331 | bio->bi_iter.bi_size) | |
1332 | ctf_integer(sector_t, new_sector, new_sector) | |
1333 | ctf_integer(pid_t, tid, current->pid) | |
1334 | ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) | |
1335 | ) | |
1336 | ) | |
1337 | #else | |
1338 | LTTNG_TRACEPOINT_EVENT(block_split, | |
1339 | ||
1340 | TP_PROTO(struct request_queue *q, struct bio *bio, | |
1341 | unsigned int new_sector), | |
1342 | ||
1343 | TP_ARGS(q, bio, new_sector), | |
1344 | ||
1345 | TP_FIELDS( | |
1346 | ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) | |
1036 | 1347 | ctf_integer(sector_t, sector, bio->bi_sector) |
1037 | 1348 | blk_rwbs_ctf_integer(unsigned int, rwbs, |
1038 | 1349 | lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) |
1039 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ | |
1040 | 1350 | ctf_integer(sector_t, new_sector, new_sector) |
1041 | 1351 | ctf_integer(pid_t, tid, current->pid) |
1042 | 1352 | ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) |
1043 | 1353 | ) |
1044 | 1354 | ) |
1045 | ||
1355 | #endif | |
1356 | ||
1357 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) | |
1358 | /** | |
1359 | * block_bio_remap - map request for a logical device to the raw device | |
1360 | * @bio: revised operation | |
1361 | * @dev: original device for the operation | |
1362 | * @from: original sector for the operation | |
1363 | * | |
1364 | * An operation for a logical device has been mapped to the | |
1365 | * raw block device. | |
1366 | */ | |
1367 | LTTNG_TRACEPOINT_EVENT(block_bio_remap, | |
1368 | ||
1369 | TP_PROTO(struct bio *bio, dev_t dev, sector_t from), | |
1370 | ||
1371 | TP_ARGS(bio, dev, from), | |
1372 | ||
1373 | TP_FIELDS( | |
1374 | ctf_integer(dev_t, dev, bio_dev(bio)) | |
1375 | ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) | |
1376 | ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) | |
1377 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
1378 | lttng_bio_op(bio), lttng_bio_rw(bio), | |
1379 | bio->bi_iter.bi_size) | |
1380 | ctf_integer(dev_t, old_dev, dev) | |
1381 | ctf_integer(sector_t, old_sector, from) | |
1382 | ) | |
1383 | ) | |
1384 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0)) | |
1046 | 1385 | /** |
1047 | 1386 | * block_bio_remap - map request for a logical device to the raw device |
1048 | 1387 | * @q: queue holding the operation |
1061 | 1400 | TP_ARGS(q, bio, dev, from), |
1062 | 1401 | |
1063 | 1402 | TP_FIELDS( |
1064 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) | |
1065 | 1403 | ctf_integer(dev_t, dev, bio_dev(bio)) |
1066 | #else | |
1067 | ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) | |
1068 | #endif | |
1069 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) | |
1070 | 1404 | ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) |
1071 | 1405 | ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) |
1072 | 1406 | blk_rwbs_ctf_integer(unsigned int, rwbs, |
1073 | 1407 | lttng_bio_op(bio), lttng_bio_rw(bio), |
1074 | 1408 | bio->bi_iter.bi_size) |
1075 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ | |
1409 | ctf_integer(dev_t, old_dev, dev) | |
1410 | ctf_integer(sector_t, old_sector, from) | |
1411 | ) | |
1412 | ) | |
1413 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0)) | |
1414 | LTTNG_TRACEPOINT_EVENT(block_bio_remap, | |
1415 | ||
1416 | TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev, | |
1417 | sector_t from), | |
1418 | ||
1419 | TP_ARGS(q, bio, dev, from), | |
1420 | ||
1421 | TP_FIELDS( | |
1422 | ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) | |
1423 | ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) | |
1424 | ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) | |
1425 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
1426 | lttng_bio_op(bio), lttng_bio_rw(bio), | |
1427 | bio->bi_iter.bi_size) | |
1428 | ctf_integer(dev_t, old_dev, dev) | |
1429 | ctf_integer(sector_t, old_sector, from) | |
1430 | ) | |
1431 | ) | |
1432 | #else | |
1433 | LTTNG_TRACEPOINT_EVENT(block_bio_remap, | |
1434 | ||
1435 | TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev, | |
1436 | sector_t from), | |
1437 | ||
1438 | TP_ARGS(q, bio, dev, from), | |
1439 | ||
1440 | TP_FIELDS( | |
1441 | ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) | |
1076 | 1442 | ctf_integer(sector_t, sector, bio->bi_sector) |
1077 | 1443 | ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) |
1078 | 1444 | blk_rwbs_ctf_integer(unsigned int, rwbs, |
1079 | 1445 | lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) |
1080 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ | |
1081 | 1446 | ctf_integer(dev_t, old_dev, dev) |
1082 | 1447 | ctf_integer(sector_t, old_sector, from) |
1083 | 1448 | ) |
1084 | 1449 | ) |
1085 | ||
1450 | #endif | |
1451 | ||
1452 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) | |
1453 | /** | |
1454 | * block_rq_remap - map request for a block operation request | |
1455 | * @rq: block IO operation request | |
1456 | * @dev: device for the operation | |
1457 | * @from: original sector for the operation | |
1458 | * | |
1459 | * The block operation request @rq in @q has been remapped. The block | |
1460 | * operation request @rq holds the current information and @from hold | |
1461 | * the original sector. | |
1462 | */ | |
1463 | LTTNG_TRACEPOINT_EVENT(block_rq_remap, | |
1464 | ||
1465 | TP_PROTO(struct request *rq, dev_t dev, sector_t from), | |
1466 | ||
1467 | TP_ARGS(rq, dev, from), | |
1468 | ||
1469 | TP_FIELDS( | |
1470 | ctf_integer(dev_t, dev, disk_devt(rq->rq_disk)) | |
1471 | ctf_integer(sector_t, sector, blk_rq_pos(rq)) | |
1472 | ctf_integer(unsigned int, nr_sector, blk_rq_sectors(rq)) | |
1473 | ctf_integer(dev_t, old_dev, dev) | |
1474 | ctf_integer(sector_t, old_sector, from) | |
1475 | blk_rwbs_ctf_integer(unsigned int, rwbs, | |
1476 | lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq)) | |
1477 | ) | |
1478 | ) | |
1479 | #else | |
1086 | 1480 | /** |
1087 | 1481 | * block_rq_remap - map request for a block operation request |
1088 | 1482 | * @q: queue holding the operation |
1111 | 1505 | lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq)) |
1112 | 1506 | ) |
1113 | 1507 | ) |
1508 | #endif | |
1114 | 1509 | |
1115 | 1510 | #undef __print_rwbs_flags |
1116 | 1511 | #undef blk_fill_rwbs |
6 | 6 | |
7 | 7 | #include <probes/lttng-tracepoint-event.h> |
8 | 8 | #include <linux/writeback.h> |
9 | #include <linux/version.h> | |
9 | #include <lttng-kernel-version.h> | |
10 | 10 | |
11 | 11 | #ifndef _TRACE_BTRFS_DEF_ |
12 | 12 | #define _TRACE_BTRFS_DEF_ |
19 | 19 | struct btrfs_delayed_tree_ref; |
20 | 20 | struct btrfs_delayed_data_ref; |
21 | 21 | struct btrfs_delayed_ref_head; |
22 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) | |
22 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,5,0)) | |
23 | 23 | struct btrfs_block_group; |
24 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
24 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
25 | 25 | struct btrfs_block_group_cache; |
26 | 26 | #endif |
27 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
27 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
28 | 28 | struct btrfs_free_cluster; |
29 | 29 | #endif |
30 | 30 | struct map_lookup; |
31 | 31 | struct extent_buffer; |
32 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
32 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,4,0)) | |
33 | 33 | struct extent_state; |
34 | 34 | #endif |
35 | 35 | #endif |
36 | 36 | |
37 | 37 | #define BTRFS_UUID_SIZE 16 |
38 | 38 | |
39 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)) | |
39 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,0,0)) | |
40 | 40 | #define lttng_fs_info_fsid fs_info->fs_devices->fsid |
41 | 41 | #else |
42 | 42 | #define lttng_fs_info_fsid fs_info->fsid |
43 | 43 | #endif |
44 | 44 | |
45 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ | |
45 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0) || \ | |
46 | 46 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
47 | 47 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ |
48 | 48 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ |
150 | 150 | ) |
151 | 151 | #endif |
152 | 152 | |
153 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) | |
153 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0)) | |
154 | 154 | |
155 | 155 | LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, |
156 | 156 | |
173 | 173 | ) |
174 | 174 | ) |
175 | 175 | |
176 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) | |
176 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,12,0)) | |
177 | 177 | |
178 | 178 | LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, |
179 | 179 | |
196 | 196 | ) |
197 | 197 | ) |
198 | 198 | |
199 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) | |
199 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) | |
200 | 200 | |
201 | 201 | LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, |
202 | 202 | |
219 | 219 | ) |
220 | 220 | ) |
221 | 221 | |
222 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
222 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
223 | 223 | |
224 | 224 | LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, |
225 | 225 | |
266 | 266 | ) |
267 | 267 | ) |
268 | 268 | |
269 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
269 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
270 | 270 | |
271 | 271 | LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, |
272 | 272 | |
287 | 287 | ) |
288 | 288 | ) |
289 | 289 | |
290 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
291 | ||
292 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) | |
290 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
291 | ||
292 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,5,0)) | |
293 | 293 | LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist, |
294 | 294 | |
295 | 295 | TP_PROTO(const struct btrfs_fs_info *fs_info, |
308 | 308 | ctf_integer(u64, len, len) |
309 | 309 | ) |
310 | 310 | ) |
311 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0)) | |
311 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,18,0)) | |
312 | 312 | LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist, |
313 | 313 | |
314 | 314 | TP_PROTO(struct btrfs_fs_info *fs_info, |
327 | 327 | ctf_integer(u64, len, len) |
328 | 328 | ) |
329 | 329 | ) |
330 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) | |
330 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,17,0)) | |
331 | 331 | LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist, |
332 | 332 | |
333 | 333 | TP_PROTO(const struct extent_map *existing, const struct extent_map *map, u64 start, u64 len), |
345 | 345 | ) |
346 | 346 | #endif |
347 | 347 | |
348 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0)) | |
348 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,10,0)) | |
349 | 349 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent, |
350 | 350 | |
351 | 351 | TP_PROTO(const struct btrfs_inode *inode, |
367 | 367 | ctf_integer(u64, root_objectid, inode->root->root_key.objectid) |
368 | 368 | ) |
369 | 369 | ) |
370 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) | |
370 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0)) | |
371 | 371 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent, |
372 | 372 | |
373 | 373 | TP_PROTO(const struct inode *inode, |
389 | 389 | BTRFS_I(inode)->root->root_key.objectid) |
390 | 390 | ) |
391 | 391 | ) |
392 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) | |
392 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0)) | |
393 | 393 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent, |
394 | 394 | |
395 | 395 | TP_PROTO(const struct inode *inode, |
411 | 411 | BTRFS_I(inode)->root->root_key.objectid) |
412 | 412 | ) |
413 | 413 | ) |
414 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) | |
414 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,12,0)) | |
415 | 415 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent, |
416 | 416 | |
417 | 417 | TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), |
479 | 479 | ) |
480 | 480 | #endif |
481 | 481 | |
482 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0)) | |
482 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,10,0)) | |
483 | 483 | LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add, |
484 | 484 | |
485 | 485 | TP_PROTO(const struct btrfs_inode *inode, |
511 | 511 | |
512 | 512 | TP_ARGS(inode, ordered) |
513 | 513 | ) |
514 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ | |
514 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0) || \ | |
515 | 515 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
516 | 516 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ |
517 | 517 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ |
577 | 577 | ) |
578 | 578 | #endif |
579 | 579 | |
580 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ | |
580 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0) || \ | |
581 | 581 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
582 | 582 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ |
583 | 583 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ |
664 | 664 | ctf_integer(long, pages_skipped, wbc->pages_skipped) |
665 | 665 | ctf_integer(loff_t, range_start, wbc->range_start) |
666 | 666 | ctf_integer(loff_t, range_end, wbc->range_end) |
667 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)) | |
667 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,1,0)) | |
668 | 668 | ctf_integer(char, nonblocking, wbc->nonblocking) |
669 | 669 | #endif |
670 | 670 | ctf_integer(char, for_kupdate, wbc->for_kupdate) |
722 | 722 | ) |
723 | 723 | #endif |
724 | 724 | |
725 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ | |
725 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0) || \ | |
726 | 726 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
727 | 727 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ |
728 | 728 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ |
740 | 740 | ctf_integer(int, wait, wait) |
741 | 741 | ) |
742 | 742 | ) |
743 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) | |
743 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,8,0)) | |
744 | 744 | LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs, |
745 | 745 | |
746 | 746 | TP_PROTO(struct btrfs_fs_info *fs_info, int wait), |
764 | 764 | ) |
765 | 765 | #endif |
766 | 766 | |
767 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) | |
767 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,5,0)) | |
768 | 768 | LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group, |
769 | 769 | |
770 | 770 | TP_PROTO(const struct btrfs_fs_info *fs_info, |
782 | 782 | ctf_integer(int, create, create) |
783 | 783 | ) |
784 | 784 | ) |
785 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ | |
785 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0) || \ | |
786 | 786 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
787 | 787 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ |
788 | 788 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ |
824 | 824 | ) |
825 | 825 | #endif |
826 | 826 | |
827 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ | |
827 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0) || \ | |
828 | 828 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
829 | 829 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ |
830 | 830 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ |
881 | 881 | |
882 | 882 | TP_ARGS(fs_info, ref, full_ref, action) |
883 | 883 | ) |
884 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) | |
884 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,8,0)) | |
885 | 885 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref, |
886 | 886 | |
887 | 887 | TP_PROTO(struct btrfs_fs_info *fs_info, |
977 | 977 | |
978 | 978 | TP_ARGS(ref, full_ref, action) |
979 | 979 | ) |
980 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
980 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
981 | 981 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref, |
982 | 982 | |
983 | 983 | TP_PROTO(struct btrfs_delayed_ref_node *ref, |
1023 | 1023 | |
1024 | 1024 | TP_ARGS(ref, full_ref, action) |
1025 | 1025 | ) |
1026 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)) | |
1026 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,7,0)) | |
1027 | 1027 | LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref, |
1028 | 1028 | |
1029 | 1029 | TP_PROTO(struct btrfs_delayed_ref_node *ref, |
1064 | 1064 | ) |
1065 | 1065 | #endif |
1066 | 1066 | |
1067 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ | |
1067 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0) || \ | |
1068 | 1068 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
1069 | 1069 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ |
1070 | 1070 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ |
1122 | 1122 | |
1123 | 1123 | TP_ARGS(fs_info, ref, full_ref, action) |
1124 | 1124 | ) |
1125 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) | |
1125 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,8,0)) | |
1126 | 1126 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref, |
1127 | 1127 | |
1128 | 1128 | TP_PROTO(struct btrfs_fs_info *fs_info, |
1220 | 1220 | |
1221 | 1221 | TP_ARGS(fs_info, ref, full_ref, action) |
1222 | 1222 | ) |
1223 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
1223 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
1224 | 1224 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref, |
1225 | 1225 | |
1226 | 1226 | TP_PROTO(struct btrfs_delayed_ref_node *ref, |
1267 | 1267 | |
1268 | 1268 | TP_ARGS(fs_info, ref, full_ref, action) |
1269 | 1269 | ) |
1270 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)) | |
1270 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,7,0)) | |
1271 | 1271 | LTTNG_TRACEPOINT_EVENT(btrfs_delayed_data_ref, |
1272 | 1272 | |
1273 | 1273 | TP_PROTO(struct btrfs_delayed_ref_node *ref, |
1310 | 1310 | ) |
1311 | 1311 | #endif |
1312 | 1312 | |
1313 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) | |
1313 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0)) | |
1314 | 1314 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, |
1315 | 1315 | |
1316 | 1316 | TP_PROTO(const struct btrfs_fs_info *fs_info, |
1353 | 1353 | TP_ARGS(fs_info, head_ref, action) |
1354 | 1354 | ) |
1355 | 1355 | |
1356 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ | |
1356 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0) || \ | |
1357 | 1357 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
1358 | 1358 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ |
1359 | 1359 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ |
1407 | 1407 | TP_ARGS(fs_info, ref, head_ref, action) |
1408 | 1408 | ) |
1409 | 1409 | |
1410 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) | |
1410 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,8,0)) | |
1411 | 1411 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, |
1412 | 1412 | |
1413 | 1413 | TP_PROTO(struct btrfs_fs_info *fs_info, |
1496 | 1496 | TP_ARGS(ref, head_ref, action) |
1497 | 1497 | ) |
1498 | 1498 | |
1499 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
1499 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
1500 | 1500 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, |
1501 | 1501 | |
1502 | 1502 | TP_PROTO(struct btrfs_delayed_ref_node *ref, |
1557 | 1557 | ) |
1558 | 1558 | #endif |
1559 | 1559 | |
1560 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) | |
1560 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0)) | |
1561 | 1561 | |
1562 | 1562 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk, |
1563 | 1563 | |
1592 | 1592 | TP_ARGS(fs_info, map, offset, size) |
1593 | 1593 | ) |
1594 | 1594 | |
1595 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
1595 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
1596 | 1596 | |
1597 | 1597 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk, |
1598 | 1598 | |
1665 | 1665 | TP_ARGS(root, map, offset, size) |
1666 | 1666 | ) |
1667 | 1667 | |
1668 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
1668 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
1669 | 1669 | |
1670 | 1670 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk, |
1671 | 1671 | |
1700 | 1700 | TP_ARGS(root, map, offset, size) |
1701 | 1701 | ) |
1702 | 1702 | |
1703 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
1704 | ||
1705 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ | |
1703 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
1704 | ||
1705 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0) || \ | |
1706 | 1706 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
1707 | 1707 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ |
1708 | 1708 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ |
1742 | 1742 | ) |
1743 | 1743 | #endif |
1744 | 1744 | |
1745 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) | |
1745 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,5,0)) | |
1746 | 1746 | LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation, |
1747 | 1747 | |
1748 | 1748 | TP_PROTO(const struct btrfs_fs_info *fs_info, const char *type, u64 val, |
1758 | 1758 | ctf_integer(int, reserve, reserve) |
1759 | 1759 | ) |
1760 | 1760 | ) |
1761 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ | |
1761 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0) || \ | |
1762 | 1762 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
1763 | 1763 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ |
1764 | 1764 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ |
1778 | 1778 | ctf_integer(int, reserve, reserve) |
1779 | 1779 | ) |
1780 | 1780 | ) |
1781 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
1781 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
1782 | 1782 | LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation, |
1783 | 1783 | |
1784 | 1784 | TP_PROTO(struct btrfs_fs_info *fs_info, char *type, u64 val, |
1796 | 1796 | ) |
1797 | 1797 | #endif |
1798 | 1798 | |
1799 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) | |
1799 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0)) | |
1800 | 1800 | |
1801 | 1801 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, |
1802 | 1802 | |
1824 | 1824 | TP_ARGS(fs_info, start, len) |
1825 | 1825 | ) |
1826 | 1826 | |
1827 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
1827 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
1828 | 1828 | |
1829 | 1829 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, |
1830 | 1830 | |
1884 | 1884 | TP_ARGS(root, start, len) |
1885 | 1885 | ) |
1886 | 1886 | |
1887 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
1887 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
1888 | 1888 | |
1889 | 1889 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, |
1890 | 1890 | |
1913 | 1913 | TP_ARGS(root, start, len) |
1914 | 1914 | ) |
1915 | 1915 | |
1916 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
1917 | ||
1918 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0) || \ | |
1916 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
1917 | ||
1918 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,10,0) || \ | |
1919 | 1919 | LTTNG_KERNEL_RANGE(5,9,5, 5,10,0) || \ |
1920 | LTTNG_KERNEL_RANGE(5,4,78, 5,5,0)) | |
1920 | LTTNG_KERNEL_RANGE(5,4,78, 5,5,0) || \ | |
1921 | LTTNG_UBUNTU_KERNEL_RANGE(5,8,18,44, 5,9,0,0)) | |
1921 | 1922 | LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, |
1922 | 1923 | |
1923 | 1924 | btrfs_find_free_extent, |
1936 | 1937 | ) |
1937 | 1938 | ) |
1938 | 1939 | |
1939 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) | |
1940 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,5,0)) | |
1940 | 1941 | |
1941 | 1942 | LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, |
1942 | 1943 | |
1955 | 1956 | ) |
1956 | 1957 | ) |
1957 | 1958 | |
1958 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0)) | |
1959 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,18,0)) | |
1959 | 1960 | |
1960 | 1961 | LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, |
1961 | 1962 | |
1974 | 1975 | ) |
1975 | 1976 | ) |
1976 | 1977 | |
1977 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) | |
1978 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0)) | |
1978 | 1979 | |
1979 | 1980 | LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, |
1980 | 1981 | |
1993 | 1994 | ) |
1994 | 1995 | ) |
1995 | 1996 | |
1996 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
1997 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
1997 | 1998 | |
1998 | 1999 | LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, |
1999 | 2000 | |
2033 | 2034 | ctf_integer(u64, data, data) |
2034 | 2035 | ) |
2035 | 2036 | ) |
2036 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
2037 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
2037 | 2038 | |
2038 | 2039 | LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, |
2039 | 2040 | |
2053 | 2054 | ) |
2054 | 2055 | #endif |
2055 | 2056 | |
2056 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) | |
2057 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,5,0)) | |
2057 | 2058 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, |
2058 | 2059 | |
2059 | 2060 | TP_PROTO(const struct btrfs_block_group *block_group, u64 start, |
2086 | 2087 | TP_ARGS(block_group, start, len) |
2087 | 2088 | ) |
2088 | 2089 | |
2089 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0)) | |
2090 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,18,0)) | |
2090 | 2091 | |
2091 | 2092 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, |
2092 | 2093 | |
2120 | 2121 | TP_ARGS(block_group, start, len) |
2121 | 2122 | ) |
2122 | 2123 | |
2123 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) | |
2124 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0)) | |
2124 | 2125 | |
2125 | 2126 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, |
2126 | 2127 | |
2157 | 2158 | TP_ARGS(fs_info, block_group, start, len) |
2158 | 2159 | ) |
2159 | 2160 | |
2160 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
2161 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
2161 | 2162 | |
2162 | 2163 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, |
2163 | 2164 | |
2232 | 2233 | TP_ARGS(root, block_group, start, len) |
2233 | 2234 | ) |
2234 | 2235 | |
2235 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
2236 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
2236 | 2237 | |
2237 | 2238 | LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, |
2238 | 2239 | |
2269 | 2270 | TP_ARGS(root, block_group, start, len) |
2270 | 2271 | ) |
2271 | 2272 | |
2272 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
2273 | ||
2274 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) | |
2273 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
2274 | ||
2275 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,5,0)) | |
2275 | 2276 | LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster, |
2276 | 2277 | |
2277 | 2278 | TP_PROTO(const struct btrfs_block_group *block_group, u64 start, |
2316 | 2317 | ctf_integer(int, bitmap, bitmap) |
2317 | 2318 | ) |
2318 | 2319 | ) |
2319 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ | |
2320 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0) || \ | |
2320 | 2321 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
2321 | 2322 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ |
2322 | 2323 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ |
2365 | 2366 | ctf_integer(int, bitmap, bitmap) |
2366 | 2367 | ) |
2367 | 2368 | ) |
2368 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
2369 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
2369 | 2370 | LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster, |
2370 | 2371 | |
2371 | 2372 | TP_PROTO(struct btrfs_block_group_cache *block_group, u64 start, |
2412 | 2413 | ) |
2413 | 2414 | #endif |
2414 | 2415 | |
2415 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ | |
2416 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0) || \ | |
2416 | 2417 | LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ |
2417 | 2418 | LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ |
2418 | 2419 | LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ |
2445 | 2446 | ctf_integer(unsigned long, ip, IP) |
2446 | 2447 | ) |
2447 | 2448 | ) |
2448 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
2449 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,4,0)) | |
2449 | 2450 | LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state, |
2450 | 2451 | |
2451 | 2452 | btrfs_alloc_extent_state, |
6 | 6 | |
7 | 7 | #include <probes/lttng-tracepoint-event.h> |
8 | 8 | #include <linux/types.h> |
9 | #include <linux/version.h> | |
9 | #include <lttng-kernel-version.h> | |
10 | 10 | |
11 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0) | |
11 | #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,0,0) | |
12 | 12 | |
13 | 13 | LTTNG_TRACEPOINT_EVENT_CLASS(compaction_isolate_template, |
14 | 14 | |
55 | 55 | TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken) |
56 | 56 | ) |
57 | 57 | |
58 | #else /* #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0) */ | |
58 | #else /* #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,0,0) */ | |
59 | 59 | |
60 | 60 | LTTNG_TRACEPOINT_EVENT_CLASS(compaction_isolate_template, |
61 | 61 | |
94 | 94 | TP_ARGS(nr_scanned, nr_taken) |
95 | 95 | ) |
96 | 96 | |
97 | #endif /* #else #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0) */ | |
97 | #endif /* #else #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,0,0) */ | |
98 | 98 | |
99 | 99 | #if LTTNG_KERNEL_RANGE(3,12,30, 3,13,0) || \ |
100 | 100 | LTTNG_KERNEL_RANGE(3,14,25, 3,15,0) || \ |
101 | (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) | |
101 | (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,16,0)) | |
102 | 102 | LTTNG_TRACEPOINT_EVENT_CODE_MAP(mm_compaction_migratepages, |
103 | 103 | |
104 | 104 | compaction_migratepages, |
134 | 134 | |
135 | 135 | TP_code_post() |
136 | 136 | ) |
137 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */ | |
137 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,16,0)) */ | |
138 | 138 | LTTNG_TRACEPOINT_EVENT_MAP(mm_compaction_migratepages, |
139 | 139 | |
140 | 140 | compaction_migratepages, |
149 | 149 | ctf_integer(unsigned long, nr_failed, nr_failed) |
150 | 150 | ) |
151 | 151 | ) |
152 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */ | |
152 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,16,0)) */ | |
153 | 153 | |
154 | 154 | #endif /* LTTNG_TRACE_COMPACTION_H */ |
155 | 155 |
5 | 5 | #define LTTNG_TRACE_EXT3_H |
6 | 6 | |
7 | 7 | #include <probes/lttng-tracepoint-event.h> |
8 | #include <linux/version.h> | |
8 | #include <lttng-kernel-version.h> | |
9 | 9 | |
10 | 10 | LTTNG_TRACEPOINT_EVENT(ext3_free_inode, |
11 | 11 | TP_PROTO(struct inode *inode), |
16 | 16 | ctf_integer(dev_t, dev, inode->i_sb->s_dev) |
17 | 17 | ctf_integer(ino_t, ino, inode->i_ino) |
18 | 18 | ctf_integer(umode_t, mode, inode->i_mode) |
19 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) | |
19 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,5,0)) | |
20 | 20 | ctf_integer(uid_t, uid, i_uid_read(inode)) |
21 | 21 | ctf_integer(gid_t, gid, i_gid_read(inode)) |
22 | 22 | #else |
189 | 189 | TP_ARGS(page) |
190 | 190 | ) |
191 | 191 | |
192 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) | |
192 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) | |
193 | 193 | |
194 | 194 | LTTNG_TRACEPOINT_EVENT(ext3_invalidatepage, |
195 | 195 | TP_PROTO(struct page *page, unsigned int offset, unsigned int length), |
6 | 6 | |
7 | 7 | #include <probes/lttng-tracepoint-event.h> |
8 | 8 | #include <linux/writeback.h> |
9 | #include <linux/version.h> | |
9 | #include <lttng-kernel-version.h> | |
10 | 10 | |
11 | 11 | #ifndef _TRACE_EXT4_DEF_ |
12 | 12 | #define _TRACE_EXT4_DEF_ |
16 | 16 | struct ext4_inode_info; |
17 | 17 | struct mpage_da_data; |
18 | 18 | struct ext4_map_blocks; |
19 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) | |
19 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,2,0)) | |
20 | 20 | struct ext4_extent; |
21 | 21 | #endif |
22 | 22 | #endif |
23 | 23 | |
24 | 24 | #define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode)) |
25 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) | |
25 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0)) | |
26 | 26 | #define TP_MODE_T __u16 |
27 | 27 | #else |
28 | 28 | #define TP_MODE_T umode_t |
36 | 36 | TP_FIELDS( |
37 | 37 | ctf_integer(dev_t, dev, inode->i_sb->s_dev) |
38 | 38 | ctf_integer(ino_t, ino, inode->i_ino) |
39 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) | |
39 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,5,0)) | |
40 | 40 | ctf_integer(uid_t, uid, i_uid_read(inode)) |
41 | 41 | ctf_integer(gid_t, gid, i_gid_read(inode)) |
42 | 42 | #else |
219 | 219 | ) |
220 | 220 | ) |
221 | 221 | |
222 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) | |
222 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) | |
223 | 223 | |
224 | 224 | LTTNG_TRACEPOINT_EVENT(ext4_da_write_pages, |
225 | 225 | TP_PROTO(struct inode *inode, pgoff_t first_page, |
258 | 258 | |
259 | 259 | #endif |
260 | 260 | |
261 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) | |
261 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) | |
262 | 262 | |
263 | 263 | LTTNG_TRACEPOINT_EVENT(ext4_da_write_pages_extent, |
264 | 264 | TP_PROTO(struct inode *inode, struct ext4_map_blocks *map), |
326 | 326 | TP_ARGS(page) |
327 | 327 | ) |
328 | 328 | |
329 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) | |
329 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) | |
330 | 330 | |
331 | 331 | LTTNG_TRACEPOINT_EVENT_CLASS(ext4_invalidatepage_op, |
332 | 332 | TP_PROTO(struct page *page, unsigned int offset, unsigned int length), |
431 | 431 | ) |
432 | 432 | ) |
433 | 433 | |
434 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
434 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
435 | 435 | LTTNG_TRACEPOINT_EVENT(ext4_mb_release_group_pa, |
436 | 436 | |
437 | 437 | TP_PROTO(struct super_block *sb, struct ext4_prealloc_space *pa), |
459 | 459 | ) |
460 | 460 | #endif |
461 | 461 | |
462 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0) || \ | |
462 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,9,0) || \ | |
463 | 463 | LTTNG_KERNEL_RANGE(5,8,6, 5,9,0)) |
464 | 464 | LTTNG_TRACEPOINT_EVENT(ext4_discard_preallocations, |
465 | 465 | TP_PROTO(struct inode *inode, unsigned int len, unsigned int needed), |
589 | 589 | ) |
590 | 590 | ) |
591 | 591 | |
592 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0)) | |
592 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,13,0)) | |
593 | 593 | LTTNG_TRACEPOINT_EVENT(ext4_alloc_da_blocks, |
594 | 594 | TP_PROTO(struct inode *inode), |
595 | 595 | |
718 | 718 | ) |
719 | 719 | ) |
720 | 720 | |
721 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0)) | |
721 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,13,0)) | |
722 | 722 | LTTNG_TRACEPOINT_EVENT(ext4_da_update_reserve_space, |
723 | 723 | TP_PROTO(struct inode *inode, int used_blocks, int quota_claim), |
724 | 724 | |
735 | 735 | ctf_integer(TP_MODE_T, mode, inode->i_mode) |
736 | 736 | ) |
737 | 737 | ) |
738 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) | |
738 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,2,0)) | |
739 | 739 | LTTNG_TRACEPOINT_EVENT(ext4_da_update_reserve_space, |
740 | 740 | TP_PROTO(struct inode *inode, int used_blocks, int quota_claim), |
741 | 741 | |
778 | 778 | ) |
779 | 779 | #endif |
780 | 780 | |
781 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0)) | |
781 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,13,0)) | |
782 | 782 | LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_space, |
783 | 783 | TP_PROTO(struct inode *inode), |
784 | 784 | |
793 | 793 | ctf_integer(TP_MODE_T, mode, inode->i_mode) |
794 | 794 | ) |
795 | 795 | ) |
796 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) | |
796 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,2,0)) | |
797 | 797 | LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_space, |
798 | 798 | TP_PROTO(struct inode *inode), |
799 | 799 | |
830 | 830 | ) |
831 | 831 | #endif |
832 | 832 | |
833 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0)) | |
833 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,13,0)) | |
834 | 834 | LTTNG_TRACEPOINT_EVENT(ext4_da_release_space, |
835 | 835 | TP_PROTO(struct inode *inode, int freed_blocks), |
836 | 836 | |
893 | 893 | TP_ARGS(sb, group) |
894 | 894 | ) |
895 | 895 | |
896 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0)) | |
896 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,9,0)) | |
897 | 897 | LTTNG_TRACEPOINT_EVENT(ext4_read_block_bitmap_load, |
898 | 898 | TP_PROTO(struct super_block *sb, unsigned long group, bool prefetch), |
899 | 899 | |
966 | 966 | ) |
967 | 967 | ) |
968 | 968 | |
969 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) | |
969 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,15,0)) | |
970 | 970 | |
971 | 971 | LTTNG_TRACEPOINT_EVENT_CLASS(ext4__fallocate_mode, |
972 | 972 | TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode), |
1003 | 1003 | TP_ARGS(inode, offset, len, mode) |
1004 | 1004 | ) |
1005 | 1005 | |
1006 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */ | |
1006 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,15,0)) */ | |
1007 | 1007 | |
1008 | 1008 | LTTNG_TRACEPOINT_EVENT(ext4_fallocate_enter, |
1009 | 1009 | TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode), |
1019 | 1019 | ) |
1020 | 1020 | ) |
1021 | 1021 | |
1022 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) | |
1022 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) | |
1023 | 1023 | |
1024 | 1024 | LTTNG_TRACEPOINT_EVENT(ext4_punch_hole, |
1025 | 1025 | TP_PROTO(struct inode *inode, loff_t offset, loff_t len), |
1034 | 1034 | ) |
1035 | 1035 | ) |
1036 | 1036 | |
1037 | #endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) */ | |
1038 | ||
1039 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */ | |
1037 | #endif /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) */ | |
1038 | ||
1039 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,15,0)) */ | |
1040 | 1040 | |
1041 | 1041 | LTTNG_TRACEPOINT_EVENT(ext4_unlink_enter, |
1042 | 1042 | TP_PROTO(struct inode *parent, struct dentry *dentry), |
1089 | 1089 | TP_ARGS(inode) |
1090 | 1090 | ) |
1091 | 1091 | |
1092 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) | |
1092 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,2,0)) | |
1093 | 1093 | /* 'ux' is the uninitialized extent. */ |
1094 | 1094 | LTTNG_TRACEPOINT_EVENT(ext4_ext_convert_to_initialized_enter, |
1095 | 1095 | TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, |
1162 | 1162 | TP_ARGS(inode, lblk, len, flags) |
1163 | 1163 | ) |
1164 | 1164 | |
1165 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) | |
1165 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) | |
1166 | 1166 | |
1167 | 1167 | LTTNG_TRACEPOINT_EVENT_CLASS(ext4__map_blocks_exit, |
1168 | 1168 | TP_PROTO(struct inode *inode, unsigned flags, struct ext4_map_blocks *map, |
1196 | 1196 | TP_ARGS(inode, flags, map, ret) |
1197 | 1197 | ) |
1198 | 1198 | |
1199 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
1199 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
1200 | 1200 | |
1201 | 1201 | LTTNG_TRACEPOINT_EVENT_CLASS(ext4__map_blocks_exit, |
1202 | 1202 | TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int ret), |
1226 | 1226 | TP_ARGS(inode, map, ret) |
1227 | 1227 | ) |
1228 | 1228 | |
1229 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */ | |
1229 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) */ | |
1230 | 1230 | |
1231 | 1231 | LTTNG_TRACEPOINT_EVENT_CLASS(ext4__map_blocks_exit, |
1232 | 1232 | TP_PROTO(struct inode *inode, ext4_lblk_t lblk, |
1258 | 1258 | TP_ARGS(inode, lblk, pblk, len, ret) |
1259 | 1259 | ) |
1260 | 1260 | |
1261 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */ | |
1261 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) */ | |
1262 | 1262 | |
1263 | 1263 | LTTNG_TRACEPOINT_EVENT(ext4_ext_load_extent, |
1264 | 1264 | TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk), |
1273 | 1273 | ) |
1274 | 1274 | ) |
1275 | 1275 | |
1276 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0)) | |
1276 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,10,0)) | |
1277 | 1277 | LTTNG_TRACEPOINT_EVENT(ext4_load_inode, |
1278 | 1278 | TP_PROTO(struct super_block *sb, unsigned long ino), |
1279 | 1279 | |
1297 | 1297 | ) |
1298 | 1298 | #endif |
1299 | 1299 | |
1300 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) | |
1300 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,5,0)) | |
1301 | 1301 | |
1302 | 1302 | LTTNG_TRACEPOINT_EVENT(ext4_journal_start, |
1303 | 1303 | TP_PROTO(struct super_block *sb, int blocks, int rsv_blocks, |
1326 | 1326 | ) |
1327 | 1327 | ) |
1328 | 1328 | |
1329 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) | |
1329 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) | |
1330 | 1330 | |
1331 | 1331 | LTTNG_TRACEPOINT_EVENT(ext4_journal_start, |
1332 | 1332 | TP_PROTO(struct super_block *sb, int blocks, int rsv_blocks, |
1354 | 1354 | ) |
1355 | 1355 | ) |
1356 | 1356 | |
1357 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) | |
1357 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0)) | |
1358 | 1358 | |
1359 | 1359 | LTTNG_TRACEPOINT_EVENT(ext4_journal_start, |
1360 | 1360 | TP_PROTO(struct super_block *sb, int nblocks, unsigned long IP), |
1406 | 1406 | ) |
1407 | 1407 | #endif |
1408 | 1408 | |
1409 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) | |
1409 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,2,0)) | |
1410 | 1410 | |
1411 | 1411 | LTTNG_TRACEPOINT_EVENT(ext4_ext_handle_uninitialized_extents, |
1412 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
1412 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
1413 | 1413 | TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int flags, |
1414 | 1414 | unsigned int allocated, ext4_fsblk_t newblock), |
1415 | 1415 | |
1416 | 1416 | TP_ARGS(inode, map, flags, allocated, newblock), |
1417 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */ | |
1417 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) */ | |
1418 | 1418 | TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, |
1419 | 1419 | unsigned int allocated, ext4_fsblk_t newblock), |
1420 | 1420 | |
1421 | 1421 | TP_ARGS(inode, map, allocated, newblock), |
1422 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */ | |
1423 | ||
1424 | TP_FIELDS( | |
1425 | ctf_integer(dev_t, dev, inode->i_sb->s_dev) | |
1426 | ctf_integer(ino_t, ino, inode->i_ino) | |
1427 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
1422 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) */ | |
1423 | ||
1424 | TP_FIELDS( | |
1425 | ctf_integer(dev_t, dev, inode->i_sb->s_dev) | |
1426 | ctf_integer(ino_t, ino, inode->i_ino) | |
1427 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
1428 | 1428 | ctf_integer(int, flags, flags) |
1429 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */ | |
1429 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) */ | |
1430 | 1430 | ctf_integer(int, flags, map->m_flags) |
1431 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */ | |
1431 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) */ | |
1432 | 1432 | ctf_integer(ext4_lblk_t, lblk, map->m_lblk) |
1433 | 1433 | ctf_integer(ext4_fsblk_t, pblk, map->m_pblk) |
1434 | 1434 | ctf_integer(unsigned int, len, map->m_len) |
1525 | 1525 | ) |
1526 | 1526 | ) |
1527 | 1527 | |
1528 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \ | |
1528 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,20,0) || \ | |
1529 | 1529 | LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0)) |
1530 | 1530 | |
1531 | 1531 | LTTNG_TRACEPOINT_EVENT(ext4_remove_blocks, |
1549 | 1549 | ) |
1550 | 1550 | ) |
1551 | 1551 | |
1552 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) | |
1552 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) | |
1553 | 1553 | |
1554 | 1554 | LTTNG_TRACEPOINT_EVENT(ext4_remove_blocks, |
1555 | 1555 | TP_PROTO(struct inode *inode, struct ext4_extent *ex, |
1593 | 1593 | |
1594 | 1594 | #endif |
1595 | 1595 | |
1596 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \ | |
1596 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,20,0) || \ | |
1597 | 1597 | LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0)) |
1598 | 1598 | |
1599 | 1599 | LTTNG_TRACEPOINT_EVENT(ext4_ext_rm_leaf, |
1616 | 1616 | ) |
1617 | 1617 | ) |
1618 | 1618 | |
1619 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) | |
1619 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) | |
1620 | 1620 | |
1621 | 1621 | LTTNG_TRACEPOINT_EVENT(ext4_ext_rm_leaf, |
1622 | 1622 | TP_PROTO(struct inode *inode, ext4_lblk_t start, |
1669 | 1669 | ) |
1670 | 1670 | ) |
1671 | 1671 | |
1672 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) | |
1672 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) | |
1673 | 1673 | |
1674 | 1674 | LTTNG_TRACEPOINT_EVENT(ext4_ext_remove_space, |
1675 | 1675 | TP_PROTO(struct inode *inode, ext4_lblk_t start, |
1703 | 1703 | |
1704 | 1704 | #endif |
1705 | 1705 | |
1706 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \ | |
1706 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,20,0) || \ | |
1707 | 1707 | LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0)) |
1708 | 1708 | |
1709 | 1709 | LTTNG_TRACEPOINT_EVENT(ext4_ext_remove_space_done, |
1725 | 1725 | ) |
1726 | 1726 | ) |
1727 | 1727 | |
1728 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) | |
1728 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) | |
1729 | 1729 | |
1730 | 1730 | LTTNG_TRACEPOINT_EVENT(ext4_ext_remove_space_done, |
1731 | 1731 | TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t end, |
1766 | 1766 | |
1767 | 1767 | #endif |
1768 | 1768 | |
1769 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
1769 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
1770 | 1770 | |
1771 | 1771 | LTTNG_TRACEPOINT_EVENT_CLASS(ext4__es_extent, |
1772 | 1772 | TP_PROTO(struct inode *inode, struct extent_status *es), |
1795 | 1795 | TP_ARGS(inode, es) |
1796 | 1796 | ) |
1797 | 1797 | |
1798 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) | |
1798 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) | |
1799 | 1799 | |
1800 | 1800 | LTTNG_TRACEPOINT_EVENT(ext4_es_insert_extent, |
1801 | 1801 | TP_PROTO(struct inode *inode, struct extent_status *es), |
1907 | 1907 | |
1908 | 1908 | #endif |
1909 | 1909 | |
1910 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0)) | |
1910 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,10,0)) | |
1911 | 1911 | LTTNG_TRACEPOINT_EVENT(ext4_fc_replay_scan, |
1912 | 1912 | TP_PROTO(struct super_block *sb, int error, int off), |
1913 | 1913 |
6 | 6 | |
7 | 7 | #include <probes/lttng-tracepoint-event.h> |
8 | 8 | #include <linux/jbd.h> |
9 | #include <linux/version.h> | |
9 | #include <lttng-kernel-version.h> | |
10 | 10 | |
11 | 11 | LTTNG_TRACEPOINT_EVENT(jbd_checkpoint, |
12 | 12 | |
28 | 28 | |
29 | 29 | TP_FIELDS( |
30 | 30 | ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) |
31 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
31 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0)) | |
32 | 32 | ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit) |
33 | 33 | #endif |
34 | 34 | ctf_integer(int, transaction, commit_transaction->t_tid) |
71 | 71 | |
72 | 72 | TP_FIELDS( |
73 | 73 | ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) |
74 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
74 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0)) | |
75 | 75 | ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit) |
76 | 76 | #endif |
77 | 77 | ctf_integer(int, transaction, commit_transaction->t_tid) |
85 | 85 | |
86 | 86 | TP_FIELDS( |
87 | 87 | ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) |
88 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
88 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0)) | |
89 | 89 | ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit) |
90 | 90 | #endif |
91 | 91 | ctf_integer(int, transaction, commit_transaction->t_tid) |
100 | 100 | |
101 | 101 | TP_FIELDS( |
102 | 102 | ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) |
103 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
103 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0)) | |
104 | 104 | ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit) |
105 | 105 | #endif |
106 | 106 | ctf_integer(int, transaction, commit_transaction->t_tid) |
123 | 123 | ) |
124 | 124 | ) |
125 | 125 | |
126 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) | |
126 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,5,0)) | |
127 | 127 | LTTNG_TRACEPOINT_EVENT_MAP(journal_write_superblock, |
128 | 128 | |
129 | 129 | jbd_journal_write_superblock, |
6 | 6 | |
7 | 7 | #include <probes/lttng-tracepoint-event.h> |
8 | 8 | #include <linux/jbd2.h> |
9 | #include <linux/version.h> | |
9 | #include <lttng-kernel-version.h> | |
10 | 10 | |
11 | 11 | #ifndef _TRACE_JBD2_DEF |
12 | 12 | #define _TRACE_JBD2_DEF |
67 | 67 | TP_ARGS(journal, commit_transaction) |
68 | 68 | ) |
69 | 69 | |
70 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
70 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,4,0)) | |
71 | 71 | LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_drop_transaction, |
72 | 72 | |
73 | 73 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
136 | 136 | ) |
137 | 137 | ) |
138 | 138 | |
139 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
139 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,4,0)) | |
140 | 140 | LTTNG_TRACEPOINT_EVENT(jbd2_update_log_tail, |
141 | 141 | #else |
142 | 142 | LTTNG_TRACEPOINT_EVENT(jbd2_cleanup_journal_tail, |
156 | 156 | ) |
157 | 157 | ) |
158 | 158 | |
159 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
159 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,4,0)) | |
160 | 160 | LTTNG_TRACEPOINT_EVENT(jbd2_write_superblock, |
161 | 161 | |
162 | 162 | TP_PROTO(journal_t *journal, int write_op), |
6 | 6 | |
7 | 7 | #include <probes/lttng-tracepoint-event.h> |
8 | 8 | #include <linux/types.h> |
9 | #include <linux/version.h> | |
9 | #include <lttng-kernel-version.h> | |
10 | 10 | |
11 | 11 | LTTNG_TRACEPOINT_EVENT_CLASS(kmem_alloc, |
12 | 12 | |
114 | 114 | TP_ARGS(call_site, ptr) |
115 | 115 | ) |
116 | 116 | |
117 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
117 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
118 | 118 | LTTNG_TRACEPOINT_EVENT_MAP(mm_page_free, kmem_mm_page_free, |
119 | 119 | #else |
120 | 120 | LTTNG_TRACEPOINT_EVENT_MAP(mm_page_free_direct, kmem_mm_page_free_direct, |
131 | 131 | ) |
132 | 132 | ) |
133 | 133 | |
134 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) | |
134 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0)) | |
135 | 135 | LTTNG_TRACEPOINT_EVENT_MAP(mm_page_free_batched, kmem_mm_page_free_batched, |
136 | 136 | |
137 | 137 | TP_PROTO(struct page *page), |
143 | 143 | ctf_integer(unsigned long, pfn, page_to_pfn(page)) |
144 | 144 | ) |
145 | 145 | ) |
146 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
146 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
147 | 147 | LTTNG_TRACEPOINT_EVENT_MAP(mm_page_free_batched, kmem_mm_page_free_batched, |
148 | 148 | |
149 | 149 | TP_PROTO(struct page *page, int cold), |
221 | 221 | TP_ARGS(page, order, migratetype) |
222 | 222 | ) |
223 | 223 | |
224 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,2) \ | |
224 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,2) \ | |
225 | 225 | || LTTNG_KERNEL_RANGE(3,14,36, 3,15,0) \ |
226 | 226 | || LTTNG_KERNEL_RANGE(3,16,35, 3,17,0) \ |
227 | 227 | || LTTNG_KERNEL_RANGE(3,18,10, 3,19,0) \ |
253 | 253 | ) |
254 | 254 | ) |
255 | 255 | |
256 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,30)) | |
256 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,30)) | |
257 | 257 | |
258 | 258 | LTTNG_TRACEPOINT_EVENT_MAP(mm_page_alloc_extfrag, |
259 | 259 | |
278 | 278 | ) |
279 | 279 | ) |
280 | 280 | |
281 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
281 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
282 | 282 | |
283 | 283 | LTTNG_TRACEPOINT_EVENT_MAP(mm_page_alloc_extfrag, |
284 | 284 | |
305 | 305 | ) |
306 | 306 | ) |
307 | 307 | |
308 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
308 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */ | |
309 | 309 | |
310 | 310 | LTTNG_TRACEPOINT_EVENT_MAP(mm_page_alloc_extfrag, |
311 | 311 | |
329 | 329 | ) |
330 | 330 | ) |
331 | 331 | |
332 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
332 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */ | |
333 | 333 | |
334 | 334 | #endif /* LTTNG_TRACE_KMEM_H */ |
335 | 335 |
2 | 2 | #define LTTNG_TRACE_KVM_MAIN_H |
3 | 3 | |
4 | 4 | #include <probes/lttng-tracepoint-event.h> |
5 | #include <linux/version.h> | |
5 | #include <lttng-kernel-version.h> | |
6 | 6 | |
7 | 7 | #undef TRACE_SYSTEM |
8 | 8 | #define TRACE_SYSTEM kvm |
17 | 17 | ) |
18 | 18 | ) |
19 | 19 | |
20 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)) | |
20 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,6,0)) | |
21 | 21 | #if defined(__KVM_HAVE_IOAPIC) |
22 | 22 | #undef __KVM_HAVE_IRQ_LINE |
23 | 23 | #define __KVM_HAVE_IRQ_LINE |
97 | 97 | ) |
98 | 98 | ) |
99 | 99 | |
100 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0) \ | |
100 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0) \ | |
101 | 101 | || LTTNG_KERNEL_RANGE(4,14,14, 4,15,0) \ |
102 | 102 | || LTTNG_DEBIAN_KERNEL_RANGE(4,14,13,0,1,0, 4,15,0,0,0,0) \ |
103 | 103 | || LTTNG_KERNEL_RANGE(4,9,77, 4,10,0) \ |
151 | 151 | ) |
152 | 152 | ) |
153 | 153 | |
154 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0) \ | |
154 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,18,0) \ | |
155 | 155 | || LTTNG_RHEL_KERNEL_RANGE(3,10,0,327,0,0, 3,11,0,0,0,0)) |
156 | 156 | |
157 | 157 | LTTNG_TRACEPOINT_EVENT(kvm_age_page, |
235 | 235 | TP_ARGS(token, gva) |
236 | 236 | ) |
237 | 237 | |
238 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) \ | |
238 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,13,0) \ | |
239 | 239 | || LTTNG_RHEL_KERNEL_RANGE(3,10,0,229,0,0, 3,11,0,0,0,0)) |
240 | 240 | |
241 | 241 | LTTNG_TRACEPOINT_EVENT( |
249 | 249 | ) |
250 | 250 | ) |
251 | 251 | |
252 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) */ | |
252 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,13,0)) */ | |
253 | 253 | |
254 | 254 | LTTNG_TRACEPOINT_EVENT( |
255 | 255 | kvm_async_pf_completed, |
263 | 263 | ) |
264 | 264 | ) |
265 | 265 | |
266 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) */ | |
266 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,13,0)) */ | |
267 | 267 | |
268 | 268 | #endif |
269 | 269 |
13 | 13 | #include <linux/user_namespace.h> |
14 | 14 | #include <linux/utsname.h> |
15 | 15 | #include <linux/types.h> |
16 | #include <linux/version.h> | |
16 | #include <lttng-kernel-version.h> | |
17 | 17 | #include <wrapper/namespace.h> |
18 | 18 | #include <wrapper/user_namespace.h> |
19 | 19 | |
64 | 64 | ) |
65 | 65 | ) |
66 | 66 | |
67 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)) | |
67 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,6,0)) | |
68 | 68 | LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_cgroup_ns, |
69 | 69 | TP_PROTO(struct lttng_session *session, |
70 | 70 | struct task_struct *p, |
84 | 84 | TP_ARGS(session, p, ipc_ns), |
85 | 85 | TP_FIELDS( |
86 | 86 | ctf_integer(pid_t, tid, p->pid) |
87 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
87 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
88 | 88 | ctf_integer(unsigned int, ns_inum, ipc_ns ? ipc_ns->lttng_ns_inum : 0) |
89 | 89 | #endif |
90 | 90 | ) |
98 | 98 | TP_ARGS(session, p, mnt_ns), |
99 | 99 | TP_FIELDS( |
100 | 100 | ctf_integer(pid_t, tid, p->pid) |
101 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
101 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
102 | 102 | ctf_integer(unsigned int, ns_inum, mnt_ns ? mnt_ns->lttng_ns_inum : 0) |
103 | 103 | #endif |
104 | 104 | ) |
112 | 112 | TP_ARGS(session, p, net_ns), |
113 | 113 | TP_FIELDS( |
114 | 114 | ctf_integer(pid_t, tid, p->pid) |
115 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
115 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
116 | 116 | ctf_integer(unsigned int, ns_inum, net_ns ? net_ns->lttng_ns_inum : 0) |
117 | 117 | #endif |
118 | 118 | ) |
141 | 141 | ret; |
142 | 142 | })) |
143 | 143 | ctf_integer(int, ns_level, pid_ns ? pid_ns->level : 0) |
144 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
144 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
145 | 145 | ctf_integer(unsigned int, ns_inum, pid_ns ? pid_ns->lttng_ns_inum : 0) |
146 | 146 | #endif |
147 | 147 | ) |
156 | 156 | ctf_integer(pid_t, tid, p->pid) |
157 | 157 | ctf_integer(uid_t, vuid, user_ns ? lttng_task_vuid(p, user_ns) : 0) |
158 | 158 | ctf_integer(gid_t, vgid, user_ns ? lttng_task_vgid(p, user_ns) : 0) |
159 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) | |
159 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) | |
160 | 160 | ctf_integer(int, ns_level, user_ns ? user_ns->level : 0) |
161 | 161 | #endif |
162 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
162 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
163 | 163 | ctf_integer(unsigned int, ns_inum, user_ns ? user_ns->lttng_ns_inum : 0) |
164 | 164 | #endif |
165 | 165 | ) |
172 | 172 | TP_ARGS(session, p, uts_ns), |
173 | 173 | TP_FIELDS( |
174 | 174 | ctf_integer(pid_t, tid, p->pid) |
175 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
175 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
176 | 176 | ctf_integer(unsigned int, ns_inum, uts_ns ? uts_ns->lttng_ns_inum : 0) |
177 | 177 | #endif |
178 | 178 | ) |
6 | 6 | |
7 | 7 | #include <probes/lttng-tracepoint-event.h> |
8 | 8 | #include <linux/types.h> |
9 | #include <linux/version.h> | |
9 | #include <lttng-kernel-version.h> | |
10 | 10 | |
11 | 11 | LTTNG_TRACEPOINT_ENUM( |
12 | 12 | lttng_test_filter_event_enum, |
8 | 8 | #include <linux/types.h> |
9 | 9 | #include <linux/mm.h> |
10 | 10 | #include <linux/memcontrol.h> |
11 | #include <linux/version.h> | |
11 | #include <lttng-kernel-version.h> | |
12 | 12 | |
13 | 13 | #ifndef _TRACE_VMSCAN_DEF |
14 | 14 | #define _TRACE_VMSCAN_DEF |
18 | 18 | #define RECLAIM_WB_SYNC 0x0004u /* Unused, all reclaim async */ |
19 | 19 | #define RECLAIM_WB_ASYNC 0x0008u |
20 | 20 | |
21 | #if ((LINUX_VERSION_CODE <= KERNEL_VERSION(3,0,38)) || \ | |
21 | #if ((LTTNG_LINUX_VERSION_CODE <= LTTNG_KERNEL_VERSION(3,0,38)) || \ | |
22 | 22 | LTTNG_KERNEL_RANGE(3,1,0, 3,2,0)) |
23 | 23 | typedef int isolate_mode_t; |
24 | 24 | #endif |
25 | 25 | |
26 | 26 | #endif |
27 | 27 | |
28 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)) | |
28 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,2,0)) | |
29 | 29 | |
30 | 30 | #include <linux/mm_inline.h> |
31 | 31 | |
34 | 34 | (RECLAIM_WB_ASYNC) \ |
35 | 35 | ) |
36 | 36 | |
37 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)) | |
37 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,5,0)) | |
38 | 38 | |
39 | 39 | #include <linux/mm_inline.h> |
40 | 40 | |
62 | 62 | ) |
63 | 63 | ) |
64 | 64 | |
65 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) | |
65 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,8,0)) | |
66 | 66 | |
67 | 67 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake, |
68 | 68 | |
93 | 93 | |
94 | 94 | #endif |
95 | 95 | |
96 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) | |
96 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,17,0)) | |
97 | 97 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd, |
98 | 98 | |
99 | 99 | TP_PROTO(int nid, int zid, int order, gfp_t gfp_flags), |
122 | 122 | ) |
123 | 123 | #endif |
124 | 124 | |
125 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)) | |
125 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,2,0)) | |
126 | 126 | |
127 | 127 | LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template, |
128 | 128 | |
157 | 157 | TP_ARGS(order, gfp_flags) |
158 | 158 | ) |
159 | 159 | |
160 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) | |
160 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,8,0)) | |
161 | 161 | |
162 | 162 | LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template, |
163 | 163 | |
264 | 264 | TP_ARGS(nr_reclaimed) |
265 | 265 | ) |
266 | 266 | |
267 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0)) | |
267 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,16,0)) | |
268 | 268 | LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start, |
269 | 269 | |
270 | 270 | mm_vmscan_shrink_slab_start, |
289 | 289 | ctf_integer(int, priority, priority) |
290 | 290 | ) |
291 | 291 | ) |
292 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) | |
292 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0)) | |
293 | 293 | LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start, |
294 | 294 | |
295 | 295 | mm_vmscan_shrink_slab_start, |
304 | 304 | |
305 | 305 | TP_FIELDS( |
306 | 306 | ctf_integer_hex(struct shrinker *, shr, shr) |
307 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
307 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
308 | 308 | ctf_integer_hex(void *, shrink, shr->scan_objects) |
309 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
309 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */ | |
310 | 310 | ctf_integer_hex(void *, shrink, shr->shrink) |
311 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
311 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */ | |
312 | 312 | ctf_integer(long, nr_objects_to_shrink, nr_objects_to_shrink) |
313 | 313 | ctf_integer(gfp_t, gfp_flags, sc->gfp_mask) |
314 | 314 | ctf_integer(unsigned long, pgs_scanned, pgs_scanned) |
320 | 320 | ) |
321 | 321 | #endif |
322 | 322 | |
323 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) | |
323 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,16,0)) | |
324 | 324 | LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end, |
325 | 325 | |
326 | 326 | mm_vmscan_shrink_slab_end, |
341 | 341 | ctf_integer(long, total_scan, total_scan) |
342 | 342 | ) |
343 | 343 | ) |
344 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) | |
344 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0)) | |
345 | 345 | LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end, |
346 | 346 | |
347 | 347 | mm_vmscan_shrink_slab_end, |
353 | 353 | |
354 | 354 | TP_FIELDS( |
355 | 355 | ctf_integer_hex(struct shrinker *, shr, shr) |
356 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
356 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
357 | 357 | ctf_integer_hex(void *, shrink, shr->scan_objects) |
358 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
358 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */ | |
359 | 359 | ctf_integer_hex(void *, shrink, shr->shrink) |
360 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
360 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */ | |
361 | 361 | ctf_integer(long, unused_scan, unused_scan_cnt) |
362 | 362 | ctf_integer(long, new_scan, new_scan_cnt) |
363 | 363 | ctf_integer(int, retval, shrinker_retval) |
366 | 366 | ) |
367 | 367 | #endif |
368 | 368 | |
369 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) | |
369 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) | |
370 | 370 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_isolate, |
371 | 371 | |
372 | 372 | TP_PROTO(int classzone_idx, |
394 | 394 | ctf_integer(int, lru, lru) |
395 | 395 | ) |
396 | 396 | ) |
397 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) | |
397 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,8,0)) | |
398 | 398 | LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template, |
399 | 399 | |
400 | 400 | TP_PROTO(int classzone_idx, |
461 | 461 | unsigned long nr_requested, |
462 | 462 | unsigned long nr_scanned, |
463 | 463 | unsigned long nr_taken, |
464 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
464 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0)) | |
465 | 465 | unsigned long nr_lumpy_taken, |
466 | 466 | unsigned long nr_lumpy_dirty, |
467 | 467 | unsigned long nr_lumpy_failed, |
468 | 468 | #endif |
469 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) | |
469 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,3,0)) | |
470 | 470 | isolate_mode_t isolate_mode |
471 | 471 | #else |
472 | 472 | isolate_mode_t isolate_mode, |
475 | 475 | ), |
476 | 476 | |
477 | 477 | TP_ARGS(order, nr_requested, nr_scanned, nr_taken, |
478 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
478 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0)) | |
479 | 479 | nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, |
480 | 480 | #endif |
481 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) | |
481 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,3,0)) | |
482 | 482 | isolate_mode |
483 | 483 | #else |
484 | 484 | isolate_mode, file |
491 | 491 | ctf_integer(unsigned long, nr_requested, nr_requested) |
492 | 492 | ctf_integer(unsigned long, nr_scanned, nr_scanned) |
493 | 493 | ctf_integer(unsigned long, nr_taken, nr_taken) |
494 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
494 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0)) | |
495 | 495 | ctf_integer(unsigned long, nr_lumpy_taken, nr_lumpy_taken) |
496 | 496 | ctf_integer(unsigned long, nr_lumpy_dirty, nr_lumpy_dirty) |
497 | 497 | ctf_integer(unsigned long, nr_lumpy_failed, nr_lumpy_failed) |
498 | 498 | #endif |
499 | 499 | ctf_integer(isolate_mode_t, isolate_mode, isolate_mode) |
500 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
500 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
501 | 501 | ctf_integer(int, file, file) |
502 | 502 | #endif |
503 | 503 | ) |
509 | 509 | unsigned long nr_requested, |
510 | 510 | unsigned long nr_scanned, |
511 | 511 | unsigned long nr_taken, |
512 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
512 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0)) | |
513 | 513 | unsigned long nr_lumpy_taken, |
514 | 514 | unsigned long nr_lumpy_dirty, |
515 | 515 | unsigned long nr_lumpy_failed, |
516 | 516 | #endif |
517 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) | |
517 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,3,0)) | |
518 | 518 | isolate_mode_t isolate_mode |
519 | 519 | #else |
520 | 520 | isolate_mode_t isolate_mode, |
523 | 523 | ), |
524 | 524 | |
525 | 525 | TP_ARGS(order, nr_requested, nr_scanned, nr_taken, |
526 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
526 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0)) | |
527 | 527 | nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, |
528 | 528 | #endif |
529 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) | |
529 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,3,0)) | |
530 | 530 | isolate_mode |
531 | 531 | #else |
532 | 532 | isolate_mode, file |
541 | 541 | unsigned long nr_requested, |
542 | 542 | unsigned long nr_scanned, |
543 | 543 | unsigned long nr_taken, |
544 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
544 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0)) | |
545 | 545 | unsigned long nr_lumpy_taken, |
546 | 546 | unsigned long nr_lumpy_dirty, |
547 | 547 | unsigned long nr_lumpy_failed, |
548 | 548 | #endif |
549 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) | |
549 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,3,0)) | |
550 | 550 | isolate_mode_t isolate_mode |
551 | 551 | #else |
552 | 552 | isolate_mode_t isolate_mode, |
555 | 555 | ), |
556 | 556 | |
557 | 557 | TP_ARGS(order, nr_requested, nr_scanned, nr_taken, |
558 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
558 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0)) | |
559 | 559 | nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, |
560 | 560 | #endif |
561 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) | |
561 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,3,0)) | |
562 | 562 | isolate_mode |
563 | 563 | #else |
564 | 564 | isolate_mode, file |
567 | 567 | ) |
568 | 568 | #endif |
569 | 569 | |
570 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) | |
570 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,7,0)) | |
571 | 571 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage, |
572 | 572 | |
573 | 573 | TP_PROTO(struct page *page), |
580 | 580 | page_is_file_lru(page))) |
581 | 581 | ) |
582 | 582 | ) |
583 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)) | |
583 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,2,0)) | |
584 | 584 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage, |
585 | 585 | |
586 | 586 | TP_PROTO(struct page *page), |
593 | 593 | page_is_file_cache(page))) |
594 | 594 | ) |
595 | 595 | ) |
596 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)) | |
596 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,5,0)) | |
597 | 597 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage, |
598 | 598 | |
599 | 599 | TP_PROTO(struct page *page), |
620 | 620 | ) |
621 | 621 | #endif |
622 | 622 | |
623 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)) | |
623 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,2,0)) | |
624 | 624 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, |
625 | 625 | |
626 | 626 | TP_PROTO(int nid, |
645 | 645 | ctf_integer(int, reclaim_flags, trace_reclaim_flags(file)) |
646 | 646 | ) |
647 | 647 | ) |
648 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) | |
648 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,17,0)) | |
649 | 649 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, |
650 | 650 | |
651 | 651 | TP_PROTO(int nid, |
669 | 669 | ctf_integer(int, reclaim_flags, trace_shrink_flags(file)) |
670 | 670 | ) |
671 | 671 | ) |
672 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) | |
672 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) | |
673 | 673 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, |
674 | 674 | |
675 | 675 | TP_PROTO(int nid, |
699 | 699 | ctf_integer(int, reclaim_flags, trace_shrink_flags(file)) |
700 | 700 | ) |
701 | 701 | ) |
702 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) | |
702 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,8,0)) | |
703 | 703 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, |
704 | 704 | |
705 | 705 | TP_PROTO(int nid, |
716 | 716 | ctf_integer(int, reclaim_flags, trace_shrink_flags(file)) |
717 | 717 | ) |
718 | 718 | ) |
719 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)) | |
719 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,5,0)) | |
720 | 720 | LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, |
721 | 721 | |
722 | 722 | TP_PROTO(struct zone *zone, |
754 | 754 | ) |
755 | 755 | #endif |
756 | 756 | |
757 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
757 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0)) | |
758 | 758 | LTTNG_TRACEPOINT_EVENT_MAP(replace_swap_token, |
759 | 759 | |
760 | 760 | mm_vmscan_replace_swap_token, |
15 | 15 | #define LTTNG_TRACE_MODULE_H |
16 | 16 | |
17 | 17 | #include <probes/lttng-tracepoint-event.h> |
18 | #include <linux/version.h> | |
18 | #include <lttng-kernel-version.h> | |
19 | 19 | |
20 | 20 | #ifdef CONFIG_MODULES |
21 | 21 | |
59 | 59 | |
60 | 60 | TP_FIELDS( |
61 | 61 | ctf_integer(unsigned long, ip, ip) |
62 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)) | |
62 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0)) | |
63 | 63 | ctf_integer(int, refcnt, atomic_read(&mod->refcnt)) |
64 | 64 | #else |
65 | 65 | ctf_integer(int, refcnt, __this_cpu_read(mod->refptr->incs) + __this_cpu_read(mod->refptr->decs)) |
10 | 10 | |
11 | 11 | #define NO_DEV "(no_device)" |
12 | 12 | |
13 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) | |
13 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,8,0)) | |
14 | 14 | |
15 | 15 | LTTNG_TRACEPOINT_EVENT(napi_poll, |
16 | 16 |
10 | 10 | #include <linux/ip.h> |
11 | 11 | #include <linux/ipv6.h> |
12 | 12 | #include <linux/tcp.h> |
13 | #include <linux/version.h> | |
13 | #include <lttng-kernel-version.h> | |
14 | 14 | #include <lttng-endian.h> |
15 | 15 | #include <net/sock.h> |
16 | 16 | |
553 | 553 | TP_ARGS(skb) |
554 | 554 | ) |
555 | 555 | |
556 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) | |
556 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0)) | |
557 | 557 | |
558 | 558 | /* Trace events for the receive entry points */ |
559 | 559 | LTTNG_TRACEPOINT_EVENT_CLASS(net_dev_receive_entry_template, |
624 | 624 | |
625 | 625 | #endif /* kernel > 3.14 */ |
626 | 626 | |
627 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)) | |
627 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,19,0)) | |
628 | 628 | |
629 | 629 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_entry_template, |
630 | 630 | |
639 | 639 | |
640 | 640 | #endif /* kernel > 4.19 */ |
641 | 641 | |
642 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)) | |
642 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,0,0)) | |
643 | 643 | |
644 | 644 | /* Trace events for the receive exit points */ |
645 | 645 | LTTNG_TRACEPOINT_EVENT_CLASS(net_dev_receive_exit_template, |
6 | 6 | |
7 | 7 | #include <probes/lttng-tracepoint-event.h> |
8 | 8 | #include <linux/ktime.h> |
9 | #include <linux/version.h> | |
9 | #include <lttng-kernel-version.h> | |
10 | 10 | |
11 | 11 | LTTNG_TRACEPOINT_EVENT_CLASS(power_cpu, |
12 | 12 | |
58 | 58 | ) |
59 | 59 | ) |
60 | 60 | |
61 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) | |
61 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,5,0)) | |
62 | 62 | LTTNG_TRACEPOINT_EVENT_CLASS(power_wakeup_source, |
63 | 63 | |
64 | 64 | TP_PROTO(const char *name, unsigned int state), |
159 | 159 | events get removed */ |
160 | 160 | static inline void trace_power_start(u64 type, u64 state, u64 cpuid) {}; |
161 | 161 | static inline void trace_power_end(u64 cpuid) {}; |
162 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
162 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,4,0)) | |
163 | 163 | static inline void trace_power_start_rcuidle(u64 type, u64 state, u64 cpuid) {}; |
164 | 164 | static inline void trace_power_end_rcuidle(u64 cpuid) {}; |
165 | 165 | #endif |
34 | 34 | */ |
35 | 35 | #if defined(CONFIG_TRACE_IRQFLAGS) |
36 | 36 | #define LTTNG_TRACE_IRQ |
37 | #elif (LINUX_VERSION_CODE < KERNEL_VERSION(4,19,0) && \ | |
37 | #elif (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(4,19,0) && \ | |
38 | 38 | !defined(CONFIG_PROVE_LOCKING)) |
39 | 39 | #define LTTNG_TRACE_IRQ |
40 | 40 | #endif |
66 | 66 | */ |
67 | 67 | #if defined(CONFIG_TRACE_PREEMPT_TOGGLE) |
68 | 68 | #define LTTNG_TRACE_PREEMPT |
69 | #elif (LINUX_VERSION_CODE < KERNEL_VERSION(4,19,0) && \ | |
69 | #elif (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(4,19,0) && \ | |
70 | 70 | defined(CONFIG_DEBUG_PREEMPT)) |
71 | 71 | #define LTTNG_TRACE_PREEMPT |
72 | 72 | #endif |
5 | 5 | #define LTTNG_TRACE_PRINTK_H |
6 | 6 | |
7 | 7 | #include <probes/lttng-tracepoint-event.h> |
8 | #include <linux/version.h> | |
8 | #include <lttng-kernel-version.h> | |
9 | 9 | |
10 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)) | |
10 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,10,0)) | |
11 | 11 | |
12 | 12 | LTTNG_TRACEPOINT_EVENT_MAP(console, |
13 | 13 | |
22 | 22 | ) |
23 | 23 | ) |
24 | 24 | |
25 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) | |
25 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,5,0)) | |
26 | 26 | |
27 | 27 | LTTNG_TRACEPOINT_EVENT_MAP(console, |
28 | 28 | |
39 | 39 | ) |
40 | 40 | ) |
41 | 41 | |
42 | #else /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) */ | |
42 | #else /* (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0)) */ | |
43 | 43 | |
44 | 44 | LTTNG_TRACEPOINT_EVENT_MAP(console, |
45 | 45 |
37 | 37 | TP_ARGS(pool_name, bytes, IP) |
38 | 38 | ) |
39 | 39 | |
40 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)) | |
40 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,2,0)) | |
41 | 41 | LTTNG_TRACEPOINT_EVENT_MAP(credit_entropy_bits, |
42 | 42 | |
43 | 43 | random_credit_entropy_bits, |
5 | 5 | #define LTTNG_TRACE_RCU_H |
6 | 6 | |
7 | 7 | #include <probes/lttng-tracepoint-event.h> |
8 | #include <linux/version.h> | |
8 | #include <lttng-kernel-version.h> | |
9 | 9 | |
10 | 10 | /* |
11 | 11 | * Tracepoint for start/end markers used for utilization calculations. |
20 | 20 | */ |
21 | 21 | LTTNG_TRACEPOINT_EVENT(rcu_utilization, |
22 | 22 | |
23 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
23 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
24 | 24 | TP_PROTO(const char *s), |
25 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
25 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */ | |
26 | 26 | TP_PROTO(char *s), |
27 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
27 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */ | |
28 | 28 | |
29 | 29 | TP_ARGS(s), |
30 | 30 | |
36 | 36 | #ifdef CONFIG_RCU_TRACE |
37 | 37 | |
38 | 38 | #if defined(CONFIG_TREE_RCU) \ |
39 | || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) \ | |
39 | || (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0) \ | |
40 | 40 | && defined(CONFIG_PREEMPT_RCU)) \ |
41 | 41 | || defined(CONFIG_TREE_PREEMPT_RCU) |
42 | 42 | |
49 | 49 | * and "cpuofl", respectively), and a CPU being kicked for being too |
50 | 50 | * long in dyntick-idle mode ("kick"). |
51 | 51 | */ |
52 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \ | |
52 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,19,0) || \ | |
53 | 53 | LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0)) |
54 | 54 | LTTNG_TRACEPOINT_EVENT(rcu_grace_period, |
55 | 55 | |
63 | 63 | ctf_string(gpevent, gpevent) |
64 | 64 | ) |
65 | 65 | ) |
66 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
66 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
67 | 67 | LTTNG_TRACEPOINT_EVENT(rcu_grace_period, |
68 | 68 | |
69 | 69 | TP_PROTO(const char *rcuname, unsigned long gpnum, const char *gpevent), |
98 | 98 | * rcu_node structure, and the mask of CPUs that will be waited for. |
99 | 99 | * All but the type of RCU are extracted from the rcu_node structure. |
100 | 100 | */ |
101 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \ | |
101 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,19,0) || \ | |
102 | 102 | LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0)) |
103 | 103 | LTTNG_TRACEPOINT_EVENT(rcu_grace_period_init, |
104 | 104 | |
116 | 116 | ctf_integer(unsigned long, qsmask, qsmask) |
117 | 117 | ) |
118 | 118 | ) |
119 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
119 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
120 | 120 | LTTNG_TRACEPOINT_EVENT(rcu_grace_period_init, |
121 | 121 | |
122 | 122 | TP_PROTO(const char *rcuname, unsigned long gpnum, u8 level, |
158 | 158 | * include SRCU), the grace-period number that the task is blocking |
159 | 159 | * (the current or the next), and the task's PID. |
160 | 160 | */ |
161 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \ | |
161 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,19,0) || \ | |
162 | 162 | LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0)) |
163 | 163 | LTTNG_TRACEPOINT_EVENT(rcu_preempt_task, |
164 | 164 | |
172 | 172 | ctf_integer(int, pid, pid) |
173 | 173 | ) |
174 | 174 | ) |
175 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
175 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
176 | 176 | LTTNG_TRACEPOINT_EVENT(rcu_preempt_task, |
177 | 177 | |
178 | 178 | TP_PROTO(const char *rcuname, int pid, unsigned long gpnum), |
205 | 205 | * read-side critical section exiting that critical section. Track the |
206 | 206 | * type of RCU (which one day might include SRCU) and the task's PID. |
207 | 207 | */ |
208 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \ | |
208 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,19,0) || \ | |
209 | 209 | LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0)) |
210 | 210 | LTTNG_TRACEPOINT_EVENT(rcu_unlock_preempted_task, |
211 | 211 | |
219 | 219 | ctf_integer(int, pid, pid) |
220 | 220 | ) |
221 | 221 | ) |
222 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
222 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
223 | 223 | LTTNG_TRACEPOINT_EVENT(rcu_unlock_preempted_task, |
224 | 224 | |
225 | 225 | TP_PROTO(const char *rcuname, unsigned long gpnum, int pid), |
255 | 255 | * whether there are any blocked tasks blocking the current grace period. |
256 | 256 | * All but the type of RCU are extracted from the rcu_node structure. |
257 | 257 | */ |
258 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \ | |
258 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,19,0) || \ | |
259 | 259 | LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0)) |
260 | 260 | LTTNG_TRACEPOINT_EVENT(rcu_quiescent_state_report, |
261 | 261 | |
276 | 276 | ctf_integer(u8, gp_tasks, gp_tasks) |
277 | 277 | ) |
278 | 278 | ) |
279 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
279 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
280 | 280 | LTTNG_TRACEPOINT_EVENT(rcu_quiescent_state_report, |
281 | 281 | |
282 | 282 | TP_PROTO(const char *rcuname, unsigned long gpnum, |
326 | 326 | * or "kick" when kicking a CPU that has been in dyntick-idle mode for |
327 | 327 | * too long. |
328 | 328 | */ |
329 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \ | |
329 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,19,0) || \ | |
330 | 330 | LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0)) |
331 | 331 | LTTNG_TRACEPOINT_EVENT(rcu_fqs, |
332 | 332 | |
341 | 341 | ctf_string(qsevent, qsevent) |
342 | 342 | ) |
343 | 343 | ) |
344 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
344 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
345 | 345 | LTTNG_TRACEPOINT_EVENT(rcu_fqs, |
346 | 346 | |
347 | 347 | TP_PROTO(const char *rcuname, unsigned long gpnum, int cpu, const char *qsevent), |
373 | 373 | |
374 | 374 | #endif /* |
375 | 375 | * #if defined(CONFIG_TREE_RCU) |
376 | * || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) | |
376 | * || (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0) | |
377 | 377 | * && defined(CONFIG_PREEMPT_RCU)) |
378 | 378 | * || defined(CONFIG_TREE_PREEMPT_RCU) |
379 | 379 | */ |
391 | 391 | * events use the upper bits of each number, while interrupt-related |
392 | 392 | * events use the lower bits. |
393 | 393 | */ |
394 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) \ | |
394 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0)) \ | |
395 | 395 | || LTTNG_KERNEL_RANGE(5,5,6, 5,6,0) \ |
396 | 396 | || LTTNG_KERNEL_RANGE(5,4,22, 5,5,0) \ |
397 | 397 | || LTTNG_UBUNTU_KERNEL_RANGE(5,0,21,46, 5,1,0,0) |
409 | 409 | ) |
410 | 410 | ) |
411 | 411 | |
412 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0)) | |
412 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,16,0)) | |
413 | 413 | LTTNG_TRACEPOINT_EVENT(rcu_dyntick, |
414 | 414 | |
415 | 415 | TP_PROTO(const char *polarity, long oldnesting, long newnesting, atomic_t dynticks), |
424 | 424 | ) |
425 | 425 | ) |
426 | 426 | |
427 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
427 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
428 | 428 | LTTNG_TRACEPOINT_EVENT(rcu_dyntick, |
429 | 429 | |
430 | 430 | TP_PROTO(const char *polarity, long long oldnesting, long long newnesting), |
437 | 437 | ctf_integer(long long, newnesting, newnesting) |
438 | 438 | ) |
439 | 439 | ) |
440 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
440 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
441 | 441 | LTTNG_TRACEPOINT_EVENT(rcu_dyntick, |
442 | 442 | |
443 | 443 | TP_PROTO(char *polarity, long long oldnesting, long long newnesting), |
464 | 464 | #endif |
465 | 465 | |
466 | 466 | |
467 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
467 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
468 | 468 | /* |
469 | 469 | * Tracepoint for RCU preparation for idle, the goal being to get RCU |
470 | 470 | * processing done so that the current CPU can shut off its scheduling |
489 | 489 | */ |
490 | 490 | LTTNG_TRACEPOINT_EVENT(rcu_prep_idle, |
491 | 491 | |
492 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
492 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
493 | 493 | TP_PROTO(const char *reason), |
494 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
494 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */ | |
495 | 495 | TP_PROTO(char *reason), |
496 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
496 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */ | |
497 | 497 | |
498 | 498 | TP_ARGS(reason), |
499 | 499 | |
510 | 510 | * number of lazy callbacks queued, and the fourth element is the |
511 | 511 | * total number of callbacks queued. |
512 | 512 | */ |
513 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) | |
513 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0)) | |
514 | 514 | LTTNG_TRACEPOINT_EVENT(rcu_callback, |
515 | 515 | |
516 | 516 | TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen), |
524 | 524 | ctf_integer(long, qlen, qlen) |
525 | 525 | ) |
526 | 526 | ) |
527 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
527 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
528 | 528 | LTTNG_TRACEPOINT_EVENT(rcu_callback, |
529 | 529 | |
530 | 530 | TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen_lazy, |
540 | 540 | ctf_integer(long, qlen, qlen) |
541 | 541 | ) |
542 | 542 | ) |
543 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
543 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,4,0)) | |
544 | 544 | LTTNG_TRACEPOINT_EVENT(rcu_callback, |
545 | 545 | |
546 | 546 | TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen_lazy, |
581 | 581 | * the fourth argument is the number of lazy callbacks queued, and the |
582 | 582 | * fifth argument is the total number of callbacks queued. |
583 | 583 | */ |
584 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) | |
584 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0)) | |
585 | 585 | LTTNG_TRACEPOINT_EVENT(rcu_kfree_callback, |
586 | 586 | |
587 | 587 | TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset, |
596 | 596 | ctf_integer(long, qlen, qlen) |
597 | 597 | ) |
598 | 598 | ) |
599 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
599 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
600 | 600 | LTTNG_TRACEPOINT_EVENT(rcu_kfree_callback, |
601 | 601 | |
602 | 602 | TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset, |
612 | 612 | ctf_integer(long, qlen, qlen) |
613 | 613 | ) |
614 | 614 | ) |
615 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
615 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,4,0)) | |
616 | 616 | LTTNG_TRACEPOINT_EVENT(rcu_kfree_callback, |
617 | 617 | |
618 | 618 | TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset, |
652 | 652 | * the total number of callbacks queued, and the fourth argument is |
653 | 653 | * the current RCU-callback batch limit. |
654 | 654 | */ |
655 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) | |
655 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0)) | |
656 | 656 | LTTNG_TRACEPOINT_EVENT(rcu_batch_start, |
657 | 657 | |
658 | 658 | TP_PROTO(const char *rcuname, long qlen, long blimit), |
665 | 665 | ctf_integer(long, blimit, blimit) |
666 | 666 | ) |
667 | 667 | ) |
668 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
668 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
669 | 669 | LTTNG_TRACEPOINT_EVENT(rcu_batch_start, |
670 | 670 | |
671 | 671 | TP_PROTO(const char *rcuname, long qlen_lazy, long qlen, long blimit), |
679 | 679 | ctf_integer(long, blimit, blimit) |
680 | 680 | ) |
681 | 681 | ) |
682 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) | |
682 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) | |
683 | 683 | LTTNG_TRACEPOINT_EVENT(rcu_batch_start, |
684 | 684 | |
685 | 685 | TP_PROTO(char *rcuname, long qlen_lazy, long qlen, long blimit), |
693 | 693 | ctf_integer(long, blimit, blimit) |
694 | 694 | ) |
695 | 695 | ) |
696 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
696 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,4,0)) | |
697 | 697 | LTTNG_TRACEPOINT_EVENT(rcu_batch_start, |
698 | 698 | |
699 | 699 | TP_PROTO(char *rcuname, long qlen_lazy, long qlen, int blimit), |
729 | 729 | */ |
730 | 730 | LTTNG_TRACEPOINT_EVENT(rcu_invoke_callback, |
731 | 731 | |
732 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
732 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
733 | 733 | TP_PROTO(const char *rcuname, struct rcu_head *rhp), |
734 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
734 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */ | |
735 | 735 | TP_PROTO(char *rcuname, struct rcu_head *rhp), |
736 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
736 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */ | |
737 | 737 | |
738 | 738 | TP_ARGS(rcuname, rhp), |
739 | 739 | |
753 | 753 | */ |
754 | 754 | LTTNG_TRACEPOINT_EVENT(rcu_invoke_kfree_callback, |
755 | 755 | |
756 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
756 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
757 | 757 | TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset), |
758 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
758 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */ | |
759 | 759 | TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset), |
760 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
760 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */ | |
761 | 761 | |
762 | 762 | TP_ARGS(rcuname, rhp, offset), |
763 | 763 | |
781 | 781 | */ |
782 | 782 | LTTNG_TRACEPOINT_EVENT(rcu_batch_end, |
783 | 783 | |
784 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) | |
784 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,13,0)) | |
785 | 785 | TP_PROTO(const char *rcuname, int callbacks_invoked, |
786 | 786 | char cb, char nr, char iit, char risk), |
787 | 787 | |
788 | 788 | TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk), |
789 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
789 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
790 | 790 | TP_PROTO(const char *rcuname, int callbacks_invoked, |
791 | 791 | bool cb, bool nr, bool iit, bool risk), |
792 | 792 | |
793 | 793 | TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk), |
794 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
794 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
795 | 795 | TP_PROTO(char *rcuname, int callbacks_invoked, |
796 | 796 | bool cb, bool nr, bool iit, bool risk), |
797 | 797 | |
805 | 805 | TP_FIELDS( |
806 | 806 | ctf_string(rcuname, rcuname) |
807 | 807 | ctf_integer(int, callbacks_invoked, callbacks_invoked) |
808 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) | |
808 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,13,0)) | |
809 | 809 | ctf_integer(char, cb, cb) |
810 | 810 | ctf_integer(char, nr, nr) |
811 | 811 | ctf_integer(char, iit, iit) |
812 | 812 | ctf_integer(char, risk, risk) |
813 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
813 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
814 | 814 | ctf_integer(bool, cb, cb) |
815 | 815 | ctf_integer(bool, nr, nr) |
816 | 816 | ctf_integer(bool, iit, iit) |
819 | 819 | ) |
820 | 820 | ) |
821 | 821 | |
822 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
822 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
823 | 823 | /* |
824 | 824 | * Tracepoint for rcutorture readers. The first argument is the name |
825 | 825 | * of the RCU flavor from rcutorture's viewpoint and the second argument |
827 | 827 | */ |
828 | 828 | LTTNG_TRACEPOINT_EVENT(rcu_torture_read, |
829 | 829 | |
830 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
830 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
831 | 831 | TP_PROTO(const char *rcutorturename, struct rcu_head *rhp, |
832 | 832 | unsigned long secs, unsigned long c_old, unsigned long c), |
833 | 833 | |
834 | 834 | TP_ARGS(rcutorturename, rhp, secs, c_old, c), |
835 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) | |
835 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) | |
836 | 836 | TP_PROTO(char *rcutorturename, struct rcu_head *rhp, |
837 | 837 | unsigned long secs, unsigned long c_old, unsigned long c), |
838 | 838 | |
846 | 846 | TP_FIELDS( |
847 | 847 | ctf_string(rcutorturename, rcutorturename) |
848 | 848 | ctf_integer_hex(struct rcu_head *, rhp, rhp) |
849 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) | |
849 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) | |
850 | 850 | ctf_integer(unsigned long, secs, secs) |
851 | 851 | ctf_integer(unsigned long, c_old, c_old) |
852 | 852 | ctf_integer(unsigned long, c, c) |
855 | 855 | ) |
856 | 856 | #endif |
857 | 857 | |
858 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) | |
858 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,6,0)) | |
859 | 859 | /* |
860 | 860 | * Tracepoint for _rcu_barrier() execution. The string "s" describes |
861 | 861 | * the _rcu_barrier phase: |
875 | 875 | */ |
876 | 876 | LTTNG_TRACEPOINT_EVENT(rcu_barrier, |
877 | 877 | |
878 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
878 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
879 | 879 | TP_PROTO(const char *rcuname, const char *s, int cpu, int cnt, unsigned long done), |
880 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
880 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */ | |
881 | 881 | TP_PROTO(char *rcuname, char *s, int cpu, int cnt, unsigned long done), |
882 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
882 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */ | |
883 | 883 | |
884 | 884 | TP_ARGS(rcuname, s, cpu, cnt, done), |
885 | 885 | |
895 | 895 | |
896 | 896 | #else /* #ifdef CONFIG_RCU_TRACE */ |
897 | 897 | |
898 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \ | |
898 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,19,0) || \ | |
899 | 899 | LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0)) |
900 | 900 | #define trace_rcu_grace_period(rcuname, gp_seq, gpevent) do { } while (0) |
901 | 901 | #define trace_rcu_grace_period_init(rcuname, gp_seq, level, grplo, grphi, \ |
918 | 918 | #define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0) |
919 | 919 | #endif |
920 | 920 | |
921 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0)) | |
921 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,16,0)) | |
922 | 922 | #define trace_rcu_dyntick(polarity, oldnesting, newnesting, dyntick) do { } while (0) |
923 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
923 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
924 | 924 | #define trace_rcu_dyntick(polarity, oldnesting, newnesting) do { } while (0) |
925 | 925 | #else |
926 | 926 | #define trace_rcu_dyntick(polarity) do { } while (0) |
927 | 927 | #endif |
928 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
928 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
929 | 929 | #define trace_rcu_prep_idle(reason) do { } while (0) |
930 | 930 | #endif |
931 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
931 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,4,0)) | |
932 | 932 | #define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0) |
933 | 933 | #define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \ |
934 | 934 | do { } while (0) |
941 | 941 | #endif |
942 | 942 | #define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0) |
943 | 943 | #define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0) |
944 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
944 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
945 | 945 | #define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \ |
946 | 946 | do { } while (0) |
947 | 947 | #else |
948 | 948 | #define trace_rcu_batch_end(rcuname, callbacks_invoked) do { } while (0) |
949 | 949 | #endif |
950 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) | |
950 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) | |
951 | 951 | #define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \ |
952 | 952 | do { } while (0) |
953 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
953 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
954 | 954 | #define trace_rcu_torture_read(rcutorturename, rhp) do { } while (0) |
955 | 955 | #endif |
956 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) | |
956 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,6,0)) | |
957 | 957 | #define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0) |
958 | 958 | #endif |
959 | 959 | #endif /* #else #ifdef CONFIG_RCU_TRACE */ |
6 | 6 | |
7 | 7 | #include <probes/lttng-tracepoint-event.h> |
8 | 8 | #include <linux/ktime.h> |
9 | #include <linux/version.h> | |
9 | #include <lttng-kernel-version.h> | |
10 | 10 | |
11 | 11 | #ifndef _TRACE_REGMAP_DEF_ |
12 | 12 | #define _TRACE_REGMAP_DEF_ |
11 | 11 | #ifndef ONCE_LTTNG_RPC_H |
12 | 12 | #define ONCE_LTTNG_RPC_H |
13 | 13 | |
14 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
14 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
15 | 15 | static inline |
16 | 16 | int lttng_get_clid(const struct rpc_task *task) |
17 | 17 | { |
27 | 27 | */ |
28 | 28 | return (int) tk_client->cl_clid; |
29 | 29 | } |
30 | #endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ | |
30 | #endif /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */ | |
31 | 31 | |
32 | 32 | #endif /* ONCE_LTTNG_RPC_H */ |
33 | 33 | |
34 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)) | |
34 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,0,0)) | |
35 | 35 | LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, |
36 | 36 | |
37 | 37 | TP_PROTO(const struct rpc_task *task), |
56 | 56 | |
57 | 57 | TP_ARGS(task) |
58 | 58 | ) |
59 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
59 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
60 | 60 | LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, |
61 | 61 | |
62 | 62 | TP_PROTO(struct rpc_task *task), |
108 | 108 | ) |
109 | 109 | #endif |
110 | 110 | |
111 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)) | |
111 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,0,0)) | |
112 | 112 | LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_connect_status, |
113 | 113 | TP_PROTO(const struct rpc_task *task), |
114 | 114 | |
115 | 115 | TP_ARGS(task) |
116 | 116 | ) |
117 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) | |
117 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,17,0)) | |
118 | 118 | LTTNG_TRACEPOINT_EVENT(rpc_connect_status, |
119 | 119 | TP_PROTO(const struct rpc_task *task), |
120 | 120 | |
126 | 126 | ctf_integer(int, status, task->tk_status) |
127 | 127 | ) |
128 | 128 | ) |
129 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
129 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
130 | 130 | LTTNG_TRACEPOINT_EVENT(rpc_connect_status, |
131 | 131 | TP_PROTO(struct rpc_task *task, int status), |
132 | 132 | |
152 | 152 | ) |
153 | 153 | #endif |
154 | 154 | |
155 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) | |
155 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,17,0)) | |
156 | 156 | LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running, |
157 | 157 | |
158 | 158 | TP_PROTO(const struct rpc_task *task, const void *action), |
221 | 221 | TP_ARGS(task, q) |
222 | 222 | ) |
223 | 223 | |
224 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) | |
224 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) | |
225 | 225 | LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running, |
226 | 226 | |
227 | 227 | TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), |
8 | 8 | #include <linux/sched.h> |
9 | 9 | #include <linux/pid_namespace.h> |
10 | 10 | #include <linux/binfmts.h> |
11 | #include <linux/version.h> | |
12 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) | |
11 | #include <lttng-kernel-version.h> | |
12 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) | |
13 | 13 | #include <linux/sched/rt.h> |
14 | 14 | #endif |
15 | 15 | #include <wrapper/namespace.h> |
19 | 19 | #ifndef _TRACE_SCHED_DEF_ |
20 | 20 | #define _TRACE_SCHED_DEF_ |
21 | 21 | |
22 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) | |
22 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0)) | |
23 | 23 | |
24 | 24 | static inline long __trace_sched_switch_state(bool preempt, struct task_struct *p) |
25 | 25 | { |
47 | 47 | return state ? (1 << (state - 1)) : state; |
48 | 48 | } |
49 | 49 | |
50 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) | |
50 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0)) | |
51 | 51 | |
52 | 52 | static inline long __trace_sched_switch_state(bool preempt, struct task_struct *p) |
53 | 53 | { |
75 | 75 | return state ? (1 << (state - 1)) : state; |
76 | 76 | } |
77 | 77 | |
78 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)) | |
78 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,4,0)) | |
79 | 79 | |
80 | 80 | static inline long __trace_sched_switch_state(bool preempt, struct task_struct *p) |
81 | 81 | { |
89 | 89 | return preempt ? TASK_RUNNING | TASK_STATE_MAX : p->state; |
90 | 90 | } |
91 | 91 | |
92 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)) | |
92 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0)) | |
93 | 93 | |
94 | 94 | static inline long __trace_sched_switch_state(struct task_struct *p) |
95 | 95 | { |
109 | 109 | return state; |
110 | 110 | } |
111 | 111 | |
112 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) | |
112 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,13,0)) | |
113 | 113 | |
114 | 114 | static inline long __trace_sched_switch_state(struct task_struct *p) |
115 | 115 | { |
126 | 126 | return state; |
127 | 127 | } |
128 | 128 | |
129 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) | |
129 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,2,0)) | |
130 | 130 | |
131 | 131 | static inline long __trace_sched_switch_state(struct task_struct *p) |
132 | 132 | { |
178 | 178 | ctf_enum_value("EXIT_DEAD", EXIT_DEAD) |
179 | 179 | ctf_enum_value("EXIT_ZOMBIE", EXIT_ZOMBIE) |
180 | 180 | |
181 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) | |
181 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) | |
182 | 182 | ctf_enum_value("TASK_PARKED", TASK_PARKED) |
183 | #endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) */ | |
183 | #endif /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) */ | |
184 | 184 | |
185 | 185 | ctf_enum_value("TASK_DEAD", TASK_DEAD) |
186 | 186 | ctf_enum_value("TASK_WAKEKILL", TASK_WAKEKILL) |
187 | 187 | ctf_enum_value("TASK_WAKING", TASK_WAKING) |
188 | 188 | |
189 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) | |
189 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,2,0)) | |
190 | 190 | ctf_enum_value("TASK_NOLOAD", TASK_NOLOAD) |
191 | #endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ | |
192 | ||
193 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) | |
191 | #endif /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,2,0)) */ | |
192 | ||
193 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,8,0)) | |
194 | 194 | ctf_enum_value("TASK_NEW", TASK_NEW) |
195 | #endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) */ | |
195 | #endif /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,8,0)) */ | |
196 | 196 | |
197 | 197 | ctf_enum_value("TASK_STATE_MAX", TASK_STATE_MAX) |
198 | 198 | ) |
230 | 230 | /* |
231 | 231 | * Tracepoint for waking up a task: |
232 | 232 | */ |
233 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0) || \ | |
233 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0) || \ | |
234 | 234 | LTTNG_RT_KERNEL_RANGE(4,1,10,11, 4,2,0,0) || \ |
235 | 235 | LTTNG_RT_KERNEL_RANGE(3,18,27,26, 3,19,0,0) || \ |
236 | 236 | LTTNG_RT_KERNEL_RANGE(3,14,61,63, 3,15,0,0) || \ |
251 | 251 | ctf_integer(int, target_cpu, task_cpu(p)) |
252 | 252 | ) |
253 | 253 | ) |
254 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ | |
254 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) */ | |
255 | 255 | LTTNG_TRACEPOINT_EVENT_CLASS(sched_wakeup_template, |
256 | 256 | |
257 | 257 | TP_PROTO(struct task_struct *p, int success), |
266 | 266 | ctf_integer(int, target_cpu, task_cpu(p)) |
267 | 267 | ) |
268 | 268 | ) |
269 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ | |
270 | ||
271 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0) || \ | |
269 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) */ | |
270 | ||
271 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0) || \ | |
272 | 272 | LTTNG_RT_KERNEL_RANGE(4,1,10,11, 4,2,0,0) || \ |
273 | 273 | LTTNG_RT_KERNEL_RANGE(3,18,27,26, 3,19,0,0) || \ |
274 | 274 | LTTNG_RT_KERNEL_RANGE(3,14,61,63, 3,15,0,0) || \ |
313 | 313 | TP_PROTO(struct task_struct *p, int success), |
314 | 314 | TP_ARGS(p, success)) |
315 | 315 | |
316 | #endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ | |
316 | #endif /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) */ | |
317 | 317 | |
318 | 318 | /* |
319 | 319 | * Tracepoint for task switches, performed by the scheduler: |
320 | 320 | */ |
321 | 321 | LTTNG_TRACEPOINT_EVENT(sched_switch, |
322 | 322 | |
323 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)) | |
323 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,4,0)) | |
324 | 324 | TP_PROTO(bool preempt, |
325 | 325 | struct task_struct *prev, |
326 | 326 | struct task_struct *next), |
331 | 331 | struct task_struct *next), |
332 | 332 | |
333 | 333 | TP_ARGS(prev, next), |
334 | #endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)) */ | |
334 | #endif /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,4,0)) */ | |
335 | 335 | |
336 | 336 | TP_FIELDS( |
337 | 337 | ctf_array_text(char, prev_comm, prev->comm, TASK_COMM_LEN) |
338 | 338 | ctf_integer(pid_t, prev_tid, prev->pid) |
339 | 339 | ctf_integer(int, prev_prio, prev->prio - MAX_RT_PRIO) |
340 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)) | |
340 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,4,0)) | |
341 | 341 | ctf_enum(task_state, long, prev_state, __trace_sched_switch_state(preempt, prev)) |
342 | 342 | #else |
343 | 343 | ctf_enum(task_state, long, prev_state, __trace_sched_switch_state(prev)) |
454 | 454 | ctf_array_text(char, parent_comm, parent->comm, TASK_COMM_LEN) |
455 | 455 | ctf_integer(pid_t, parent_tid, parent->pid) |
456 | 456 | ctf_integer(pid_t, parent_pid, parent->tgid) |
457 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
457 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
458 | 458 | ctf_integer(unsigned int, parent_ns_inum, |
459 | 459 | ({ |
460 | 460 | unsigned int parent_ns_inum = 0; |
474 | 474 | ctf_integer(pid_t, child_tid, child->pid) |
475 | 475 | ctf_sequence(pid_t, vtids, tp_locvar->vtids, u8, tp_locvar->ns_level) |
476 | 476 | ctf_integer(pid_t, child_pid, child->tgid) |
477 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
477 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
478 | 478 | ctf_integer(unsigned int, child_ns_inum, |
479 | 479 | ({ |
480 | 480 | unsigned int child_ns_inum = 0; |
495 | 495 | TP_code_post() |
496 | 496 | ) |
497 | 497 | |
498 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
498 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,4,0)) | |
499 | 499 | /* |
500 | 500 | * Tracepoint for exec: |
501 | 501 | */ |
556 | 556 | TP_PROTO(struct task_struct *tsk, u64 delay), |
557 | 557 | TP_ARGS(tsk, delay)) |
558 | 558 | |
559 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
559 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
560 | 560 | /* |
561 | 561 | * Tracepoint for accounting blocked time (time the task is in uninterruptible). |
562 | 562 | */ |
583 | 583 | ) |
584 | 584 | ) |
585 | 585 | |
586 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0) || \ | |
586 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,12,0) || \ | |
587 | 587 | LTTNG_RT_KERNEL_RANGE(4,9,27,18, 4,10,0,0) || \ |
588 | 588 | LTTNG_RT_KERNEL_RANGE(4,11,5,1, 4,12,0,0)) |
589 | 589 | /* |
8 | 8 | #include <scsi/scsi_cmnd.h> |
9 | 9 | #include <scsi/scsi_host.h> |
10 | 10 | #include <linux/trace_seq.h> |
11 | #include <linux/version.h> | |
11 | #include <lttng-kernel-version.h> | |
12 | 12 | |
13 | 13 | #ifndef _TRACE_SCSI_DEF |
14 | 14 | #define _TRACE_SCSI_DEF |
15 | 15 | |
16 | 16 | #define scsi_opcode_name(opcode) { opcode, #opcode } |
17 | 17 | |
18 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) \ | |
18 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,7,0) \ | |
19 | 19 | || LTTNG_SLE_KERNEL_RANGE(4,4,9,36,0,0, 4,5,0,0,0,0)) |
20 | 20 | |
21 | 21 | #define show_opcode_name(val) \ |
111 | 111 | scsi_opcode_name(ATA_16), \ |
112 | 112 | scsi_opcode_name(ATA_12)) |
113 | 113 | |
114 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) \ | |
114 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0) \ | |
115 | 115 | || LTTNG_RHEL_KERNEL_RANGE(3,10,0,327,0,0, 3,11,0,0,0,0)) |
116 | 116 | |
117 | 117 | #define show_opcode_name(val) \ |
209 | 209 | scsi_opcode_name(ATA_16), \ |
210 | 210 | scsi_opcode_name(ATA_12)) |
211 | 211 | |
212 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)) */ | |
212 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0)) */ | |
213 | 213 | |
214 | 214 | #define show_opcode_name(val) \ |
215 | 215 | __print_symbolic(val, \ |
306 | 306 | scsi_opcode_name(ATA_16), \ |
307 | 307 | scsi_opcode_name(ATA_12)) |
308 | 308 | |
309 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)) */ | |
309 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0)) */ | |
310 | 310 | |
311 | 311 | #define scsi_hostbyte_name(result) { result, #result } |
312 | 312 | #define show_hostbyte_name(val) \ |
5 | 5 | #define LTTNG_TRACE_SIGNAL_H |
6 | 6 | |
7 | 7 | #include <probes/lttng-tracepoint-event.h> |
8 | #include <linux/version.h> | |
8 | #include <lttng-kernel-version.h> | |
9 | 9 | |
10 | 10 | #ifndef _TRACE_SIGNAL_DEF |
11 | 11 | #define _TRACE_SIGNAL_DEF |
12 | 12 | #include <linux/signal.h> |
13 | 13 | #include <linux/sched.h> |
14 | 14 | #undef LTTNG_FIELDS_SIGINFO |
15 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \ | |
15 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,20,0) || \ | |
16 | 16 | LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0)) |
17 | 17 | #define LTTNG_FIELDS_SIGINFO(info) \ |
18 | 18 | ctf_integer(int, errno, \ |
23 | 23 | (info == SEND_SIG_NOINFO) ? \ |
24 | 24 | SI_USER : \ |
25 | 25 | ((info == SEND_SIG_PRIV) ? SI_KERNEL : info->si_code)) |
26 | #else /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) */ | |
26 | #else /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,20,0) */ | |
27 | 27 | #define LTTNG_FIELDS_SIGINFO(info) \ |
28 | 28 | ctf_integer(int, errno, \ |
29 | 29 | (info == SEND_SIG_NOINFO || info == SEND_SIG_FORCED || info == SEND_SIG_PRIV) ? \ |
33 | 33 | (info == SEND_SIG_NOINFO || info == SEND_SIG_FORCED) ? \ |
34 | 34 | SI_USER : \ |
35 | 35 | ((info == SEND_SIG_PRIV) ? SI_KERNEL : info->si_code)) |
36 | #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) */ | |
36 | #endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,20,0) */ | |
37 | 37 | #endif /* _TRACE_SIGNAL_DEF */ |
38 | 38 | |
39 | 39 | /** |
48 | 48 | * SEND_SIG_NOINFO means that si_code is SI_USER, and SEND_SIG_PRIV |
49 | 49 | * means that si_code is SI_KERNEL. |
50 | 50 | */ |
51 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \ | |
51 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,20,0) || \ | |
52 | 52 | LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0)) |
53 | 53 | LTTNG_TRACEPOINT_EVENT(signal_generate, |
54 | 54 | |
66 | 66 | ctf_integer(int, result, result) |
67 | 67 | ) |
68 | 68 | ) |
69 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
69 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,4,0)) | |
70 | 70 | LTTNG_TRACEPOINT_EVENT(signal_generate, |
71 | 71 | |
72 | 72 | TP_PROTO(int sig, struct siginfo *info, struct task_struct *task, |
113 | 113 | * This means, this can show which signals are actually delivered, but |
114 | 114 | * matching generated signals and delivered signals may not be correct. |
115 | 115 | */ |
116 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \ | |
116 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,20,0) || \ | |
117 | 117 | LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0)) |
118 | 118 | LTTNG_TRACEPOINT_EVENT(signal_deliver, |
119 | 119 | |
144 | 144 | ) |
145 | 145 | #endif |
146 | 146 | |
147 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) | |
147 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,4,0)) | |
148 | 148 | LTTNG_TRACEPOINT_EVENT_CLASS(signal_queue_overflow, |
149 | 149 | |
150 | 150 | TP_PROTO(int sig, int group, struct siginfo *info), |
7 | 7 | #include <probes/lttng-tracepoint-event.h> |
8 | 8 | #include <linux/skbuff.h> |
9 | 9 | #include <linux/netdevice.h> |
10 | #include <linux/version.h> | |
10 | #include <lttng-kernel-version.h> | |
11 | 11 | |
12 | 12 | /* |
13 | 13 | * Tracepoint for free an sk_buff: |
5 | 5 | #define LTTNG_TRACE_SOCK_H |
6 | 6 | |
7 | 7 | #include <probes/lttng-tracepoint-event.h> |
8 | #include <linux/version.h> | |
8 | #include <lttng-kernel-version.h> | |
9 | 9 | #include <net/sock.h> |
10 | 10 | |
11 | 11 | LTTNG_TRACEPOINT_EVENT(sock_rcvqueue_full, |
21 | 21 | ) |
22 | 22 | ) |
23 | 23 | |
24 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)) | |
24 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,19,0)) | |
25 | 25 | |
26 | 26 | LTTNG_TRACEPOINT_EVENT(sock_exceed_buf_limit, |
27 | 27 | |
42 | 42 | ) |
43 | 43 | ) |
44 | 44 | |
45 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) | |
45 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0)) | |
46 | 46 | |
47 | 47 | LTTNG_TRACEPOINT_EVENT(sock_exceed_buf_limit, |
48 | 48 | |
59 | 59 | ) |
60 | 60 | ) |
61 | 61 | |
62 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) */ | |
62 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0)) */ | |
63 | 63 | |
64 | 64 | LTTNG_TRACEPOINT_EVENT(sock_exceed_buf_limit, |
65 | 65 | |
76 | 76 | ) |
77 | 77 | ) |
78 | 78 | |
79 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) */ | |
79 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0)) */ | |
80 | 80 | |
81 | 81 | #endif /* LTTNG_TRACE_SOCK_H */ |
82 | 82 |
10 | 10 | #define _TRACE_TIMER_DEF_ |
11 | 11 | #include <linux/hrtimer.h> |
12 | 12 | #include <linux/timer.h> |
13 | #include <linux/version.h> | |
13 | #include <lttng-kernel-version.h> | |
14 | 14 | |
15 | 15 | struct timer_list; |
16 | 16 | |
17 | 17 | #endif /* _TRACE_TIMER_DEF_ */ |
18 | 18 | |
19 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
19 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
20 | 20 | #define lttng_ktime_get_tv64(kt) (kt) |
21 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
21 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
22 | 22 | #define lttng_ktime_get_tv64(kt) ((kt).tv64) |
23 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
23 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
24 | 24 | |
25 | 25 | LTTNG_TRACEPOINT_EVENT_CLASS(timer_class, |
26 | 26 | |
44 | 44 | TP_ARGS(timer) |
45 | 45 | ) |
46 | 46 | |
47 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) || \ | |
47 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,2,0) || \ | |
48 | 48 | LTTNG_RHEL_KERNEL_RANGE(3,10,0,957,0,0, 3,11,0,0,0,0)) |
49 | 49 | /** |
50 | 50 | * timer_start - called when the timer is started |
67 | 67 | ctf_integer(unsigned int, flags, flags) |
68 | 68 | ) |
69 | 69 | ) |
70 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ | |
70 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,2,0)) */ | |
71 | 71 | /** |
72 | 72 | * timer_start - called when the timer is started |
73 | 73 | * @timer: pointer to struct timer_list |
86 | 86 | ctf_integer(unsigned long, now, jiffies) |
87 | 87 | ) |
88 | 88 | ) |
89 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ | |
90 | ||
91 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)) | |
89 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,2,0)) */ | |
90 | ||
91 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,2,0)) | |
92 | 92 | /** |
93 | 93 | * timer_expire_entry - called immediately before the timer callback |
94 | 94 | * @timer: pointer to struct timer_list |
183 | 183 | * hrtimer_start - called when the hrtimer is started |
184 | 184 | * @timer: pointer to struct hrtimer |
185 | 185 | */ |
186 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0) || \ | |
186 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,16,0) || \ | |
187 | 187 | LTTNG_RT_KERNEL_RANGE(4,14,0,0, 4,15,0,0)) |
188 | 188 | LTTNG_TRACEPOINT_EVENT_MAP(hrtimer_start, |
189 | 189 | |
293 | 293 | * zero, otherwise it is started |
294 | 294 | * @expires: the itimers expiry time |
295 | 295 | */ |
296 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) | |
296 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,5,0)) | |
297 | 297 | LTTNG_TRACEPOINT_EVENT_MAP(itimer_state, |
298 | 298 | |
299 | 299 | timer_itimer_state, |
312 | 312 | ctf_integer(long, interval_nsec, value->it_interval.tv_nsec) |
313 | 313 | ) |
314 | 314 | ) |
315 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) | |
315 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) | |
316 | 316 | LTTNG_TRACEPOINT_EVENT_MAP(itimer_state, |
317 | 317 | |
318 | 318 | timer_itimer_state, |
331 | 331 | ctf_integer(long, interval_usec, value->it_interval.tv_usec) |
332 | 332 | ) |
333 | 333 | ) |
334 | #else /* if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ | |
334 | #else /* if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) */ | |
335 | 335 | LTTNG_TRACEPOINT_EVENT_MAP(itimer_state, |
336 | 336 | |
337 | 337 | timer_itimer_state, |
350 | 350 | ctf_integer(long, interval_usec, value->it_interval.tv_usec) |
351 | 351 | ) |
352 | 352 | ) |
353 | #endif /* #else (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ | |
353 | #endif /* #else (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) */ | |
354 | 354 | |
355 | 355 | /** |
356 | 356 | * itimer_expire - called when itimer expires |
358 | 358 | * @pid: pid of the process which owns the timer |
359 | 359 | * @now: current time, used to calculate the latency of itimer |
360 | 360 | */ |
361 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) | |
361 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) | |
362 | 362 | LTTNG_TRACEPOINT_EVENT_MAP(itimer_expire, |
363 | 363 | |
364 | 364 | timer_itimer_expire, |
373 | 373 | ctf_integer(unsigned long long, now, now) |
374 | 374 | ) |
375 | 375 | ) |
376 | #else /* if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ | |
376 | #else /* if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) */ | |
377 | 377 | LTTNG_TRACEPOINT_EVENT_MAP(itimer_expire, |
378 | 378 | |
379 | 379 | timer_itimer_expire, |
388 | 388 | ctf_integer(cputime_t, now, now) |
389 | 389 | ) |
390 | 390 | ) |
391 | #endif /* #else (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ | |
391 | #endif /* #else (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) */ | |
392 | 392 | |
393 | 393 | #endif /* LTTNG_TRACE_TIMER_H */ |
394 | 394 |
6 | 6 | |
7 | 7 | #include <probes/lttng-tracepoint-event.h> |
8 | 8 | |
9 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) | |
9 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0)) | |
10 | 10 | LTTNG_TRACEPOINT_EVENT_CLASS(v4l2_class, |
11 | 11 | |
12 | 12 | TP_PROTO(int minor, struct v4l2_buffer *buf), |
6 | 6 | |
7 | 7 | #include <probes/lttng-tracepoint-event.h> |
8 | 8 | #include <linux/workqueue.h> |
9 | #include <linux/version.h> | |
9 | #include <lttng-kernel-version.h> | |
10 | 10 | |
11 | 11 | #ifndef _TRACE_WORKQUEUE_DEF_ |
12 | 12 | #define _TRACE_WORKQUEUE_DEF_ |
39 | 39 | */ |
40 | 40 | LTTNG_TRACEPOINT_EVENT(workqueue_queue_work, |
41 | 41 | |
42 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) | |
42 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) | |
43 | 43 | TP_PROTO(unsigned int req_cpu, struct pool_workqueue *pwq, |
44 | 44 | struct work_struct *work), |
45 | 45 | |
91 | 91 | ) |
92 | 92 | ) |
93 | 93 | |
94 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) | |
94 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0)) | |
95 | 95 | /** |
96 | 96 | * workqueue_execute_end - called immediately after the workqueue callback |
97 | 97 | * @work: pointer to struct work_struct |
8 | 8 | #include <linux/tracepoint.h> |
9 | 9 | #include <linux/backing-dev.h> |
10 | 10 | #include <linux/writeback.h> |
11 | #include <linux/version.h> | |
11 | #include <lttng-kernel-version.h> | |
12 | 12 | |
13 | 13 | #ifndef _TRACE_WRITEBACK_DEF_ |
14 | 14 | #define _TRACE_WRITEBACK_DEF_ |
15 | ||
16 | /* | |
17 | * Use the GPL-exported bdi_dev_name introduced in kernel 5.7. Do not use | |
18 | * static inline bdi_dev_name in prior kernels because it uses the bdi_unknown_name | |
19 | * symbol which is not exported to GPL modules. | |
20 | */ | |
21 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,7,0)) | |
22 | static inline const char *lttng_bdi_dev_name(struct backing_dev_info *bdi) | |
23 | { | |
24 | return bdi_dev_name(bdi); | |
25 | } | |
26 | #else | |
27 | static inline const char *lttng_bdi_dev_name(struct backing_dev_info *bdi) | |
28 | { | |
29 | if (!bdi || !bdi->dev) | |
30 | return "(unknown)"; | |
31 | return dev_name(bdi->dev); | |
32 | } | |
33 | #endif | |
15 | 34 | |
16 | 35 | /* |
17 | 36 | * Vanilla kernels before 4.0 do not implement inode_to_bdi |
21 | 40 | * commit a212b105b07d75b48b1a166378282e8a77fbf53d which inlines |
22 | 41 | * inode_to_bdi but not sb_is_blkdev_sb making it unusable by modules. |
23 | 42 | */ |
24 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)) | |
43 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(4,0,0)) | |
25 | 44 | static inline struct backing_dev_info *lttng_inode_to_bdi(struct inode *inode) |
26 | 45 | { |
27 | 46 | struct super_block *sb; |
41 | 60 | { |
42 | 61 | return inode_to_bdi(inode); |
43 | 62 | } |
44 | #endif /* #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)) */ | |
45 | ||
46 | #endif | |
47 | ||
48 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0)) | |
63 | #endif /* #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(4,0,0)) */ | |
64 | ||
65 | #endif | |
66 | ||
67 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,9,0)) | |
49 | 68 | #define show_inode_state(state) \ |
50 | 69 | __print_flags(state, "|", \ |
51 | 70 | {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \ |
59 | 78 | {I_DIRTY_TIME, "I_DIRTY_TIME"}, \ |
60 | 79 | {I_REFERENCED, "I_REFERENCED"} \ |
61 | 80 | ) |
62 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) | |
81 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,0,0)) | |
63 | 82 | #define show_inode_state(state) \ |
64 | 83 | __print_flags(state, "|", \ |
65 | 84 | {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \ |
74 | 93 | {I_DIRTY_TIME_EXPIRED, "I_DIRTY_TIME_EXPIRED"}, \ |
75 | 94 | {I_REFERENCED, "I_REFERENCED"} \ |
76 | 95 | ) |
77 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */ | |
96 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,0,0)) */ | |
78 | 97 | #define show_inode_state(state) \ |
79 | 98 | __print_flags(state, "|", \ |
80 | 99 | {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \ |
87 | 106 | {I_SYNC, "I_SYNC"}, \ |
88 | 107 | {I_REFERENCED, "I_REFERENCED"} \ |
89 | 108 | ) |
90 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */ | |
91 | ||
92 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) | |
109 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,0,0)) */ | |
110 | ||
111 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,0,0)) | |
93 | 112 | |
94 | 113 | LTTNG_TRACEPOINT_EVENT(writeback_dirty_page, |
95 | 114 | TP_PROTO(struct page *page, struct address_space *mapping), |
96 | 115 | TP_ARGS(page, mapping), |
97 | 116 | TP_FIELDS( |
98 | ctf_array_text(char, name, | |
99 | mapping ? dev_name(lttng_inode_to_bdi(mapping->host)->dev) : "(unknown)", 32) | |
117 | ctf_string(name, lttng_bdi_dev_name(mapping ? lttng_inode_to_bdi(mapping->host) : NULL)) | |
100 | 118 | ctf_integer(unsigned long, ino, mapping ? mapping->host->i_ino : 0) |
101 | 119 | ctf_integer(pgoff_t, index, page->index) |
102 | 120 | ) |
107 | 125 | TP_ARGS(inode, flags), |
108 | 126 | TP_FIELDS( |
109 | 127 | /* may be called for files on pseudo FSes w/ unregistered bdi */ |
110 | ctf_array_text(char, name, | |
111 | lttng_inode_to_bdi(inode)->dev ? | |
112 | dev_name(lttng_inode_to_bdi(inode)->dev) : "(unknown)", 32) | |
128 | ctf_string(name, lttng_bdi_dev_name(lttng_inode_to_bdi(inode))) | |
113 | 129 | ctf_integer(unsigned long, ino, inode->i_ino) |
114 | 130 | ctf_integer(unsigned long, state, inode->i_state) |
115 | 131 | ctf_integer(unsigned long, flags, flags) |
127 | 143 | TP_PROTO(struct inode *inode, struct writeback_control *wbc), |
128 | 144 | TP_ARGS(inode, wbc), |
129 | 145 | TP_FIELDS( |
130 | ctf_array_text(char, name, | |
131 | dev_name(lttng_inode_to_bdi(inode)->dev), 32) | |
146 | ctf_string(name, lttng_bdi_dev_name(lttng_inode_to_bdi(inode))) | |
132 | 147 | ctf_integer(unsigned long, ino, inode->i_ino) |
133 | 148 | ctf_integer(int, sync_mode, wbc->sync_mode) |
134 | 149 | ) |
141 | 156 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode_start) |
142 | 157 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode) |
143 | 158 | |
144 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) | |
159 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) | |
145 | 160 | |
146 | 161 | LTTNG_TRACEPOINT_EVENT(writeback_dirty_page, |
147 | 162 | TP_PROTO(struct page *page, struct address_space *mapping), |
148 | 163 | TP_ARGS(page, mapping), |
149 | 164 | TP_FIELDS( |
150 | ctf_array_text(char, name, | |
151 | mapping ? dev_name(mapping->backing_dev_info->dev) : "(unknown)", 32) | |
165 | ctf_string(name, lttng_bdi_dev_name(mapping ? mapping->backing_dev_info : NULL)) | |
152 | 166 | ctf_integer(unsigned long, ino, mapping ? mapping->host->i_ino : 0) |
153 | 167 | ctf_integer(pgoff_t, index, page->index) |
154 | 168 | ) |
159 | 173 | TP_ARGS(inode, flags), |
160 | 174 | TP_FIELDS( |
161 | 175 | /* may be called for files on pseudo FSes w/ unregistered bdi */ |
162 | ctf_array_text(char, name, | |
163 | inode->i_mapping->backing_dev_info->dev ? | |
164 | dev_name(inode->i_mapping->backing_dev_info->dev) | |
165 | : "(unknown)", 32) | |
176 | ctf_string(name, lttng_bdi_dev_name(inode->i_mapping->backing_dev_info)) | |
166 | 177 | ctf_integer(unsigned long, ino, inode->i_ino) |
167 | 178 | ctf_integer(unsigned long, flags, flags) |
168 | 179 | ) |
178 | 189 | TP_PROTO(struct inode *inode, struct writeback_control *wbc), |
179 | 190 | TP_ARGS(inode, wbc), |
180 | 191 | TP_FIELDS( |
181 | ctf_array_text(char, name, | |
182 | dev_name(inode->i_mapping->backing_dev_info->dev), 32) | |
192 | ctf_string(name, lttng_bdi_dev_name(inode->i_mapping->backing_dev_info)) | |
183 | 193 | ctf_integer(unsigned long, ino, inode->i_ino) |
184 | 194 | ctf_integer(int, sync_mode, wbc->sync_mode) |
185 | 195 | ) |
192 | 202 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode_start) |
193 | 203 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode) |
194 | 204 | |
195 | #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) */ | |
196 | ||
197 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) | |
205 | #endif /* (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) */ | |
206 | ||
207 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) | |
198 | 208 | |
199 | 209 | LTTNG_TRACEPOINT_EVENT_CLASS(writeback_work_class, |
200 | 210 | TP_PROTO(struct bdi_writeback *wb, struct wb_writeback_work *work), |
201 | 211 | TP_ARGS(wb, work), |
202 | 212 | TP_FIELDS( |
203 | ctf_array_text(char, name, wb->bdi->dev ? dev_name(wb->bdi->dev) : | |
204 | "(unknown)", 32) | |
205 | ) | |
206 | ) | |
207 | ||
208 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) | |
213 | ctf_string(name, lttng_bdi_dev_name(wb->bdi)) | |
214 | ) | |
215 | ) | |
216 | ||
217 | #else | |
209 | 218 | |
210 | 219 | LTTNG_TRACEPOINT_EVENT_CLASS(writeback_work_class, |
211 | 220 | TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work), |
212 | 221 | TP_ARGS(bdi, work), |
213 | 222 | TP_FIELDS( |
214 | ctf_array_text(char, name, bdi->dev ? dev_name(bdi->dev) : | |
215 | "(unknown)", 32) | |
216 | ) | |
217 | ) | |
218 | ||
219 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */ | |
220 | ||
221 | LTTNG_TRACEPOINT_EVENT_CLASS(writeback_work_class, | |
222 | TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work), | |
223 | TP_ARGS(bdi, work), | |
224 | TP_FIELDS( | |
225 | ctf_array_text(char, name, | |
226 | dev_name(bdi->dev ? bdi->dev : | |
227 | default_backing_dev_info.dev), 32) | |
228 | ) | |
229 | ) | |
230 | ||
231 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */ | |
232 | ||
233 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) | |
223 | ctf_string(name, lttng_bdi_dev_name(bdi)) | |
224 | ) | |
225 | ) | |
226 | ||
227 | #endif /* #else if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) */ | |
228 | ||
229 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) | |
234 | 230 | |
235 | 231 | #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(name) \ |
236 | 232 | LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_work_class, name, \ |
237 | 233 | TP_PROTO(struct bdi_writeback *wb, struct wb_writeback_work *work), \ |
238 | 234 | TP_ARGS(wb, work)) |
239 | 235 | |
240 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ | |
236 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) */ | |
241 | 237 | |
242 | 238 | #define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(name) \ |
243 | 239 | LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_work_class, name, \ |
244 | 240 | TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work), \ |
245 | 241 | TP_ARGS(bdi, work)) |
246 | 242 | |
247 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ | |
243 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) */ | |
248 | 244 | |
249 | 245 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_nothread) |
250 | 246 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_queue) |
251 | 247 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_exec) |
252 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) | |
248 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0)) | |
253 | 249 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_start) |
254 | 250 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_written) |
255 | 251 | LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_wait) |
263 | 259 | ) |
264 | 260 | ) |
265 | 261 | |
266 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) | |
262 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) | |
267 | 263 | |
268 | 264 | LTTNG_TRACEPOINT_EVENT_CLASS(writeback_class, |
269 | 265 | TP_PROTO(struct bdi_writeback *wb), |
270 | 266 | TP_ARGS(wb), |
271 | 267 | TP_FIELDS( |
272 | ctf_array_text(char, name, | |
273 | dev_name(wb->bdi->dev), 32) | |
268 | ctf_string(name, lttng_bdi_dev_name(wb->bdi)) | |
274 | 269 | ) |
275 | 270 | ) |
276 | 271 | |
289 | 284 | TP_PROTO(struct backing_dev_info *bdi), |
290 | 285 | TP_ARGS(bdi), |
291 | 286 | TP_FIELDS( |
292 | ctf_array_text(char, name, | |
293 | dev_name(bdi->dev), 32) | |
294 | ) | |
295 | ) | |
296 | ||
297 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ | |
287 | ctf_string(name, lttng_bdi_dev_name(bdi)) | |
288 | ) | |
289 | ) | |
290 | ||
291 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) */ | |
298 | 292 | |
299 | 293 | LTTNG_TRACEPOINT_EVENT_CLASS(writeback_class, |
300 | 294 | TP_PROTO(struct backing_dev_info *bdi), |
301 | 295 | TP_ARGS(bdi), |
302 | 296 | TP_FIELDS( |
303 | ctf_array_text(char, name, | |
304 | dev_name(bdi->dev), 32) | |
297 | ctf_string(name, lttng_bdi_dev_name(bdi)) | |
305 | 298 | ) |
306 | 299 | ) |
307 | 300 | |
318 | 311 | |
319 | 312 | DEFINE_WRITEBACK_EVENT(writeback_bdi_register) |
320 | 313 | |
321 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ | |
314 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) */ | |
322 | 315 | |
323 | 316 | DEFINE_WRITEBACK_EVENT(writeback_nowork) |
324 | 317 | DEFINE_WRITEBACK_EVENT(writeback_wake_background) |
340 | 333 | TP_ARGS(bdi, written), |
341 | 334 | |
342 | 335 | TP_FIELDS( |
343 | ctf_array_text(char, name, dev_name(bdi->dev), 32) | |
336 | ctf_string(name, lttng_bdi_dev_name(bdi)) | |
344 | 337 | ctf_integer(int, written, written) |
345 | 338 | ) |
346 | 339 | ) |
350 | 343 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), |
351 | 344 | TP_ARGS(wbc, bdi), |
352 | 345 | TP_FIELDS( |
353 | ctf_array_text(char, name, dev_name(bdi->dev), 32) | |
346 | ctf_string(name, lttng_bdi_dev_name(bdi)) | |
354 | 347 | ctf_integer(long, nr_to_write, wbc->nr_to_write) |
355 | 348 | ctf_integer(long, pages_skipped, wbc->pages_skipped) |
356 | 349 | ctf_integer(int, sync_mode, wbc->sync_mode) |
358 | 351 | ctf_integer(int, for_background, wbc->for_background) |
359 | 352 | ctf_integer(int, for_reclaim, wbc->for_reclaim) |
360 | 353 | ctf_integer(int, range_cyclic, wbc->range_cyclic) |
361 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)) | |
354 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,1,0)) | |
362 | 355 | ctf_integer(int, more_io, wbc->more_io) |
363 | 356 | ctf_integer(unsigned long, older_than_this, |
364 | 357 | wbc->older_than_this ? *wbc->older_than_this : 0) |
373 | 366 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(writeback_wbc_class, name, map, \ |
374 | 367 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \ |
375 | 368 | TP_ARGS(wbc, bdi)) |
376 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)) | |
369 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,1,0)) | |
377 | 370 | LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writeback_start, writeback_wbc_writeback_start) |
378 | 371 | LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writeback_written, writeback_wbc_writeback_written) |
379 | 372 | LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writeback_wait, writeback_wbc_writeback_wait) |
383 | 376 | #endif |
384 | 377 | LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writepage, writeback_wbc_writepage) |
385 | 378 | |
386 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0) || \ | |
379 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,9,0) || \ | |
387 | 380 | LTTNG_KERNEL_RANGE(5,8,6, 5,9,0) || \ |
388 | 381 | LTTNG_KERNEL_RANGE(5,4,62, 5,5,0) || \ |
389 | 382 | LTTNG_KERNEL_RANGE(4,19,143, 4,20,0) || \ |
398 | 391 | int moved), |
399 | 392 | TP_ARGS(wb, work, dirtied_before, moved), |
400 | 393 | TP_FIELDS( |
401 | ctf_array_text(char, name, dev_name(wb->bdi->dev), 32) | |
394 | ctf_string(name, lttng_bdi_dev_name(wb->bdi)) | |
402 | 395 | ctf_integer(unsigned long, older, dirtied_before) |
403 | 396 | ctf_integer(int, moved, moved) |
404 | 397 | ) |
405 | 398 | ) |
406 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) | |
399 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,2,0)) | |
407 | 400 | LTTNG_TRACEPOINT_EVENT(writeback_queue_io, |
408 | 401 | TP_PROTO(struct bdi_writeback *wb, |
409 | 402 | struct wb_writeback_work *work, |
410 | 403 | int moved), |
411 | 404 | TP_ARGS(wb, work, moved), |
412 | 405 | TP_FIELDS( |
413 | ctf_array_text(char, name, dev_name(wb->bdi->dev), 32) | |
406 | ctf_string(name, lttng_bdi_dev_name(wb->bdi)) | |
414 | 407 | ctf_integer(int, moved, moved) |
415 | 408 | ) |
416 | 409 | ) |
417 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) | |
410 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0)) | |
418 | 411 | LTTNG_TRACEPOINT_EVENT(writeback_queue_io, |
419 | 412 | TP_PROTO(struct bdi_writeback *wb, |
420 | 413 | unsigned long *older_than_this, |
421 | 414 | int moved), |
422 | 415 | TP_ARGS(wb, older_than_this, moved), |
423 | 416 | TP_FIELDS( |
424 | ctf_array_text(char, name, dev_name(wb->bdi->dev), 32) | |
417 | ctf_string(name, lttng_bdi_dev_name(wb->bdi)) | |
425 | 418 | ctf_integer(unsigned long, older, |
426 | 419 | older_than_this ? *older_than_this : 0) |
427 | 420 | ctf_integer(long, age, |
433 | 426 | ) |
434 | 427 | #endif |
435 | 428 | |
436 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0)) | |
429 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,8,0)) | |
437 | 430 | LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_state, |
438 | 431 | |
439 | 432 | writeback_global_dirty_state, |
456 | 449 | ctf_integer(unsigned long, dirty_limit, global_dirty_limit) |
457 | 450 | ) |
458 | 451 | ) |
459 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) | |
452 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0)) | |
460 | 453 | LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_state, |
461 | 454 | |
462 | 455 | writeback_global_dirty_state, |
480 | 473 | ctf_integer(unsigned long, dirty_limit, global_dirty_limit) |
481 | 474 | ) |
482 | 475 | ) |
483 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) | |
476 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0)) | |
484 | 477 | LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_state, |
485 | 478 | |
486 | 479 | writeback_global_dirty_state, |
506 | 499 | ) |
507 | 500 | #endif |
508 | 501 | |
509 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) | |
502 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,2,0)) | |
510 | 503 | |
511 | 504 | #define KBps(x) ((x) << (PAGE_SHIFT - 10)) |
512 | 505 | |
513 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) | |
506 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) | |
514 | 507 | |
515 | 508 | LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit, |
516 | 509 | |
523 | 516 | TP_ARGS(wb, dirty_rate, task_ratelimit), |
524 | 517 | |
525 | 518 | TP_FIELDS( |
526 | ctf_array_text(char, bdi, dev_name(wb->bdi->dev), 32) | |
519 | ctf_string(bdi, lttng_bdi_dev_name(wb->bdi)) | |
527 | 520 | ctf_integer(unsigned long, write_bw, KBps(wb->bdi->wb.write_bandwidth)) |
528 | 521 | ctf_integer(unsigned long, avg_write_bw, KBps(wb->bdi->wb.avg_write_bandwidth)) |
529 | 522 | ctf_integer(unsigned long, dirty_rate, KBps(dirty_rate)) |
534 | 527 | ) |
535 | 528 | ) |
536 | 529 | |
537 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) | |
530 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,2,0)) | |
538 | 531 | |
539 | 532 | LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit, |
540 | 533 | |
547 | 540 | TP_ARGS(bdi, dirty_rate, task_ratelimit), |
548 | 541 | |
549 | 542 | TP_FIELDS( |
550 | ctf_array_text(char, bdi, dev_name(bdi->dev), 32) | |
543 | ctf_string(bdi, lttng_bdi_dev_name(bdi)) | |
551 | 544 | ctf_integer(unsigned long, write_bw, KBps(bdi->wb.write_bandwidth)) |
552 | 545 | ctf_integer(unsigned long, avg_write_bw, KBps(bdi->wb.avg_write_bandwidth)) |
553 | 546 | ctf_integer(unsigned long, dirty_rate, KBps(dirty_rate)) |
558 | 551 | ) |
559 | 552 | ) |
560 | 553 | |
561 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ | |
554 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,2,0)) */ | |
562 | 555 | |
563 | 556 | LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit, |
564 | 557 | |
571 | 564 | TP_ARGS(bdi, dirty_rate, task_ratelimit), |
572 | 565 | |
573 | 566 | TP_FIELDS( |
574 | ctf_array_text(char, bdi, dev_name(bdi->dev), 32) | |
567 | ctf_string(bdi, lttng_bdi_dev_name(bdi)) | |
575 | 568 | ctf_integer(unsigned long, write_bw, KBps(bdi->write_bandwidth)) |
576 | 569 | ctf_integer(unsigned long, avg_write_bw, KBps(bdi->avg_write_bandwidth)) |
577 | 570 | ctf_integer(unsigned long, dirty_rate, KBps(dirty_rate)) |
582 | 575 | ) |
583 | 576 | ) |
584 | 577 | |
585 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ | |
586 | ||
587 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) | |
578 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,2,0)) */ | |
579 | ||
580 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) | |
588 | 581 | |
589 | 582 | LTTNG_TRACEPOINT_EVENT_MAP(balance_dirty_pages, |
590 | 583 | |
609 | 602 | ), |
610 | 603 | |
611 | 604 | TP_FIELDS( |
612 | ctf_array_text(char, bdi, dev_name(wb->bdi->dev), 32) | |
605 | ctf_string(bdi, lttng_bdi_dev_name(wb->bdi)) | |
613 | 606 | ctf_integer(unsigned long, limit, global_dirty_limit) |
614 | 607 | ctf_integer(unsigned long, setpoint, |
615 | 608 | (global_dirty_limit + (thresh + bg_thresh) / 2) / 2) |
636 | 629 | ) |
637 | 630 | ) |
638 | 631 | |
639 | #else /* #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ | |
632 | #else /* #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) */ | |
640 | 633 | |
641 | 634 | LTTNG_TRACEPOINT_EVENT_MAP(balance_dirty_pages, |
642 | 635 | |
651 | 644 | unsigned long dirty_ratelimit, |
652 | 645 | unsigned long task_ratelimit, |
653 | 646 | unsigned long dirtied, |
654 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
647 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
655 | 648 | unsigned long period, |
656 | 649 | #endif |
657 | 650 | long pause, |
659 | 652 | |
660 | 653 | TP_ARGS(bdi, thresh, bg_thresh, dirty, bdi_thresh, bdi_dirty, |
661 | 654 | dirty_ratelimit, task_ratelimit, |
662 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
655 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
663 | 656 | dirtied, period, pause, start_time |
664 | 657 | #else |
665 | 658 | dirtied, pause, start_time |
667 | 660 | ), |
668 | 661 | |
669 | 662 | TP_FIELDS( |
670 | ctf_array_text(char, bdi, dev_name(bdi->dev), 32) | |
663 | ctf_string(bdi, lttng_bdi_dev_name(bdi)) | |
671 | 664 | ctf_integer(unsigned long, limit, global_dirty_limit) |
672 | 665 | ctf_integer(unsigned long, setpoint, |
673 | 666 | (global_dirty_limit + (thresh + bg_thresh) / 2) / 2) |
686 | 679 | ctf_integer(unsigned long, paused, |
687 | 680 | (jiffies - start_time) * 1000 / HZ) |
688 | 681 | ctf_integer(long, pause, pause * 1000 / HZ) |
689 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) | |
682 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) | |
690 | 683 | ctf_integer(unsigned long, period, |
691 | 684 | period * 1000 / HZ) |
692 | 685 | ctf_integer(long, think, |
695 | 688 | #endif |
696 | 689 | ) |
697 | 690 | ) |
698 | #endif /* #else #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ | |
699 | ||
700 | #endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) */ | |
701 | ||
702 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) | |
691 | #endif /* #else #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) */ | |
692 | ||
693 | #endif /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,2,0)) */ | |
694 | ||
695 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,5,0)) | |
703 | 696 | LTTNG_TRACEPOINT_EVENT(writeback_sb_inodes_requeue, |
704 | 697 | |
705 | 698 | TP_PROTO(struct inode *inode), |
706 | 699 | TP_ARGS(inode), |
707 | 700 | |
708 | 701 | TP_FIELDS( |
709 | ctf_array_text(char, name, | |
710 | dev_name(lttng_inode_to_bdi(inode)->dev), 32) | |
702 | ctf_string(name, lttng_bdi_dev_name(lttng_inode_to_bdi(inode))) | |
711 | 703 | ctf_integer(unsigned long, ino, inode->i_ino) |
712 | 704 | ctf_integer(unsigned long, state, inode->i_state) |
713 | 705 | ctf_integer(unsigned long, dirtied_when, inode->dirtied_when) |
741 | 733 | TP_ARGS(usec_timeout, usec_delayed) |
742 | 734 | ) |
743 | 735 | |
744 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) | |
736 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0)) | |
745 | 737 | LTTNG_TRACEPOINT_EVENT_CLASS(writeback_single_inode_template, |
746 | 738 | |
747 | 739 | TP_PROTO(struct inode *inode, |
752 | 744 | TP_ARGS(inode, wbc, nr_to_write), |
753 | 745 | |
754 | 746 | TP_FIELDS( |
755 | ctf_array_text(char, name, | |
756 | dev_name(lttng_inode_to_bdi(inode)->dev), 32) | |
747 | ctf_string(name, lttng_bdi_dev_name(lttng_inode_to_bdi(inode))) | |
757 | 748 | ctf_integer(unsigned long, ino, inode->i_ino) |
758 | 749 | ctf_integer(unsigned long, state, inode->i_state) |
759 | 750 | ctf_integer(unsigned long, dirtied_when, inode->dirtied_when) |
765 | 756 | ) |
766 | 757 | ) |
767 | 758 | |
768 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) | |
759 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0)) | |
769 | 760 | LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_single_inode_template, writeback_single_inode_requeue, |
770 | 761 | TP_PROTO(struct inode *inode, |
771 | 762 | struct writeback_control *wbc, |
85 | 85 | void *priv; /* Client-specific information */ |
86 | 86 | void *priv_ops; /* Client-specific ops pointer */ |
87 | 87 | void (*release_priv_ops)(void *priv_ops); |
88 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
88 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
89 | 89 | struct lttng_cpuhp_node cpuhp_prepare; /* CPU hotplug prepare */ |
90 | 90 | #else |
91 | 91 | struct notifier_block cpu_hp_notifier; /* CPU hotplug notifier */ |
52 | 52 | |
53 | 53 | unsigned long switch_timer_interval; /* Buffer flush (jiffies) */ |
54 | 54 | unsigned long read_timer_interval; /* Reader wakeup (jiffies) */ |
55 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
55 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
56 | 56 | struct lttng_cpuhp_node cpuhp_prepare; |
57 | 57 | struct lttng_cpuhp_node cpuhp_online; |
58 | 58 | struct lttng_cpuhp_node cpuhp_iter_online; |
258 | 258 | chanb->start_tsc = config->cb.ring_buffer_clock_read(chan); |
259 | 259 | } |
260 | 260 | |
261 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
261 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
262 | 262 | |
263 | 263 | /* |
264 | 264 | * No need to implement a "dead" callback to do a buffer switch here, |
290 | 290 | } |
291 | 291 | EXPORT_SYMBOL_GPL(lttng_cpuhp_rb_backend_prepare); |
292 | 292 | |
293 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
293 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
294 | 294 | |
295 | 295 | #ifdef CONFIG_HOTPLUG_CPU |
296 | 296 | |
340 | 340 | |
341 | 341 | #endif |
342 | 342 | |
343 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
343 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
344 | 344 | |
345 | 345 | /** |
346 | 346 | * channel_backend_init - initialize a channel backend |
418 | 418 | if (!chanb->buf) |
419 | 419 | goto free_cpumask; |
420 | 420 | |
421 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
421 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
422 | 422 | chanb->cpuhp_prepare.component = LTTNG_RING_BUFFER_BACKEND; |
423 | 423 | ret = cpuhp_state_add_instance(lttng_rb_hp_prepare, |
424 | 424 | &chanb->cpuhp_prepare.node); |
425 | 425 | if (ret) |
426 | 426 | goto free_bufs; |
427 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
427 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
428 | 428 | |
429 | 429 | { |
430 | 430 | /* |
461 | 461 | } |
462 | 462 | #endif |
463 | 463 | } |
464 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
464 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
465 | 465 | } else { |
466 | 466 | chanb->buf = kzalloc(sizeof(struct lib_ring_buffer), GFP_KERNEL); |
467 | 467 | if (!chanb->buf) |
476 | 476 | |
477 | 477 | free_bufs: |
478 | 478 | if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) { |
479 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
479 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
480 | 480 | /* |
481 | 481 | * Teardown of lttng_rb_hp_prepare instance |
482 | 482 | * on "add" error is handled within cpu hotplug, |
483 | 483 | * no teardown to do from the caller. |
484 | 484 | */ |
485 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
485 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
486 | 486 | #ifdef CONFIG_HOTPLUG_CPU |
487 | 487 | put_online_cpus(); |
488 | 488 | unregister_hotcpu_notifier(&chanb->cpu_hp_notifier); |
489 | 489 | #endif |
490 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
490 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
491 | 491 | for_each_possible_cpu(i) { |
492 | 492 | struct lib_ring_buffer *buf = |
493 | 493 | per_cpu_ptr(chanb->buf, i); |
516 | 516 | const struct lib_ring_buffer_config *config = &chanb->config; |
517 | 517 | |
518 | 518 | if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) { |
519 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
519 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
520 | 520 | int ret; |
521 | 521 | |
522 | 522 | ret = cpuhp_state_remove_instance(lttng_rb_hp_prepare, |
523 | 523 | &chanb->cpuhp_prepare.node); |
524 | 524 | WARN_ON(ret); |
525 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
525 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
526 | 526 | unregister_hotcpu_notifier(&chanb->cpu_hp_notifier); |
527 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
527 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
528 | 528 | } |
529 | 529 | } |
530 | 530 |
452 | 452 | buf->read_timer_enabled = 0; |
453 | 453 | } |
454 | 454 | |
455 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
455 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
456 | 456 | |
457 | 457 | enum cpuhp_state lttng_rb_hp_prepare; |
458 | 458 | enum cpuhp_state lttng_rb_hp_online; |
523 | 523 | } |
524 | 524 | EXPORT_SYMBOL_GPL(lttng_cpuhp_rb_frontend_offline); |
525 | 525 | |
526 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
526 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
527 | 527 | |
528 | 528 | #ifdef CONFIG_HOTPLUG_CPU |
529 | 529 | |
585 | 585 | |
586 | 586 | #endif |
587 | 587 | |
588 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
588 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
589 | 589 | |
590 | 590 | #if defined(CONFIG_NO_HZ) && defined(CONFIG_LIB_RING_BUFFER) |
591 | 591 | /* |
691 | 691 | * concurrency. |
692 | 692 | */ |
693 | 693 | #endif /* CONFIG_NO_HZ */ |
694 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
694 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
695 | 695 | { |
696 | 696 | int ret; |
697 | 697 | |
702 | 702 | &chan->cpuhp_prepare.node); |
703 | 703 | WARN_ON(ret); |
704 | 704 | } |
705 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
705 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
706 | 706 | { |
707 | 707 | int cpu; |
708 | 708 | |
726 | 726 | } |
727 | 727 | #endif |
728 | 728 | } |
729 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
729 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
730 | 730 | } else { |
731 | 731 | struct lib_ring_buffer *buf = chan->backend.buf; |
732 | 732 | |
855 | 855 | init_waitqueue_head(&chan->hp_wait); |
856 | 856 | |
857 | 857 | if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) { |
858 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
858 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
859 | 859 | chan->cpuhp_prepare.component = LTTNG_RING_BUFFER_FRONTEND; |
860 | 860 | ret = cpuhp_state_add_instance_nocalls(lttng_rb_hp_prepare, |
861 | 861 | &chan->cpuhp_prepare.node); |
867 | 867 | &chan->cpuhp_online.node); |
868 | 868 | if (ret) |
869 | 869 | goto cpuhp_online_error; |
870 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
870 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
871 | 871 | { |
872 | 872 | int cpu; |
873 | 873 | /* |
903 | 903 | } |
904 | 904 | #endif |
905 | 905 | } |
906 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
906 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
907 | 907 | |
908 | 908 | #if defined(CONFIG_NO_HZ) && defined(CONFIG_LIB_RING_BUFFER) |
909 | 909 | /* Only benefit from NO_HZ idle with per-cpu buffers for now. */ |
923 | 923 | |
924 | 924 | return chan; |
925 | 925 | |
926 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
926 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
927 | 927 | cpuhp_online_error: |
928 | 928 | ret = cpuhp_state_remove_instance_nocalls(lttng_rb_hp_prepare, |
929 | 929 | &chan->cpuhp_prepare.node); |
930 | 930 | WARN_ON(ret); |
931 | 931 | cpuhp_prepare_error: |
932 | #endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
932 | #endif /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
933 | 933 | error_free_backend: |
934 | 934 | channel_backend_free(&chan->backend); |
935 | 935 | error: |
334 | 334 | list_add(&buf->iter.empty_node, &chan->iter.empty_head); |
335 | 335 | } |
336 | 336 | |
337 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
337 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
338 | 338 | |
339 | 339 | int lttng_cpuhp_rb_iter_online(unsigned int cpu, |
340 | 340 | struct lttng_cpuhp_node *node) |
351 | 351 | } |
352 | 352 | EXPORT_SYMBOL_GPL(lttng_cpuhp_rb_iter_online); |
353 | 353 | |
354 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
354 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
355 | 355 | |
356 | 356 | #ifdef CONFIG_HOTPLUG_CPU |
357 | 357 | static |
383 | 383 | } |
384 | 384 | #endif |
385 | 385 | |
386 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
386 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
387 | 387 | |
388 | 388 | int channel_iterator_init(struct channel *chan) |
389 | 389 | { |
400 | 400 | if (ret) |
401 | 401 | return ret; |
402 | 402 | |
403 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
403 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
404 | 404 | chan->cpuhp_iter_online.component = LTTNG_RING_BUFFER_ITER; |
405 | 405 | ret = cpuhp_state_add_instance(lttng_rb_hp_online, |
406 | 406 | &chan->cpuhp_iter_online.node); |
407 | 407 | if (ret) |
408 | 408 | return ret; |
409 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
409 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
410 | 410 | { |
411 | 411 | int cpu; |
412 | 412 | |
435 | 435 | } |
436 | 436 | #endif |
437 | 437 | } |
438 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
438 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
439 | 439 | } else { |
440 | 440 | buf = channel_get_ring_buffer(config, chan, 0); |
441 | 441 | lib_ring_buffer_iterator_init(chan, buf); |
448 | 448 | const struct lib_ring_buffer_config *config = &chan->backend.config; |
449 | 449 | |
450 | 450 | if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) { |
451 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
451 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
452 | 452 | { |
453 | 453 | int ret; |
454 | 454 | |
456 | 456 | &chan->cpuhp_iter_online.node); |
457 | 457 | WARN_ON(ret); |
458 | 458 | } |
459 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
459 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
460 | 460 | chan->hp_iter_enable = 0; |
461 | 461 | unregister_cpu_notifier(&chan->hp_iter_notifier); |
462 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
462 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
463 | 463 | } |
464 | 464 | } |
465 | 465 |
19 | 19 | /* |
20 | 20 | * fault() vm_op implementation for ring buffer file mapping. |
21 | 21 | */ |
22 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0)) | |
22 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,1,0)) | |
23 | 23 | static vm_fault_t lib_ring_buffer_fault_compat(struct vm_area_struct *vma, struct vm_fault *vmf) |
24 | 24 | #else |
25 | 25 | static int lib_ring_buffer_fault_compat(struct vm_area_struct *vma, struct vm_fault *vmf) |
56 | 56 | return 0; |
57 | 57 | } |
58 | 58 | |
59 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0)) | |
59 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,1,0)) | |
60 | 60 | static vm_fault_t lib_ring_buffer_fault(struct vm_fault *vmf) |
61 | 61 | { |
62 | 62 | struct vm_area_struct *vma = vmf->vma; |
63 | 63 | return lib_ring_buffer_fault_compat(vma, vmf); |
64 | 64 | } |
65 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) | |
65 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) | |
66 | 66 | static int lib_ring_buffer_fault(struct vm_fault *vmf) |
67 | 67 | { |
68 | 68 | struct vm_area_struct *vma = vmf->vma; |
69 | 69 | return lib_ring_buffer_fault_compat(vma, vmf); |
70 | 70 | } |
71 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ | |
71 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) */ | |
72 | 72 | static int lib_ring_buffer_fault(struct vm_area_struct *vma, struct vm_fault *vmf) |
73 | 73 | { |
74 | 74 | return lib_ring_buffer_fault_compat(vma, vmf); |
75 | 75 | } |
76 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ | |
76 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) */ | |
77 | 77 | |
78 | 78 | /* |
79 | 79 | * vm_ops for ring buffer file mappings. |
11 | 11 | |
12 | 12 | #include <linux/module.h> |
13 | 13 | #include <linux/fs.h> |
14 | #include <linux/version.h> | |
14 | #include <lttng-kernel-version.h> | |
15 | 15 | |
16 | 16 | #include <wrapper/splice.h> |
17 | 17 | #include <wrapper/ringbuffer/backend.h> |
41 | 41 | __free_page(pbuf->page); |
42 | 42 | } |
43 | 43 | |
44 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0)) | |
44 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,8,0)) | |
45 | 45 | static const struct pipe_buf_operations ring_buffer_pipe_buf_ops = { |
46 | 46 | .release = lib_ring_buffer_pipe_buf_release, |
47 | 47 | .try_steal = generic_pipe_buf_try_steal, |
48 | 48 | .get = generic_pipe_buf_get |
49 | 49 | }; |
50 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0)) | |
50 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,1,0)) | |
51 | 51 | static const struct pipe_buf_operations ring_buffer_pipe_buf_ops = { |
52 | 52 | .confirm = generic_pipe_buf_confirm, |
53 | 53 | .release = lib_ring_buffer_pipe_buf_release, |
54 | 54 | .steal = generic_pipe_buf_steal, |
55 | 55 | .get = generic_pipe_buf_get |
56 | 56 | }; |
57 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) | |
57 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,15,0)) | |
58 | 58 | static const struct pipe_buf_operations ring_buffer_pipe_buf_ops = { |
59 | 59 | .can_merge = 0, |
60 | 60 | .confirm = generic_pipe_buf_confirm, |
102 | 102 | .pages = pages, |
103 | 103 | .nr_pages = 0, |
104 | 104 | .partial = partial, |
105 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0)) | |
105 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(4,12,0)) | |
106 | 106 | .flags = flags, |
107 | 107 | #endif |
108 | 108 | .ops = &ring_buffer_pipe_buf_ops, |
51 | 51 | |
52 | 52 | static struct proc_dir_entry *lttng_proc_dentry; |
53 | 53 | |
54 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) | |
54 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0)) | |
55 | 55 | static const struct proc_ops lttng_proc_ops; |
56 | 56 | #else |
57 | 57 | static const struct file_operations lttng_proc_ops; |
397 | 397 | } |
398 | 398 | } |
399 | 399 | |
400 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) | |
400 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0)) | |
401 | 401 | static const struct proc_ops lttng_proc_ops = { |
402 | 402 | .proc_ioctl = lttng_ioctl, |
403 | 403 | #ifdef CONFIG_COMPAT |
19 | 19 | #include <lttng-tracer.h> |
20 | 20 | |
21 | 21 | #if defined(CONFIG_CGROUPS) && \ |
22 | ((LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)) || \ | |
22 | ((LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,6,0)) || \ | |
23 | 23 | LTTNG_UBUNTU_KERNEL_RANGE(4,4,0,0, 4,5,0,0)) |
24 | 24 | |
25 | 25 | static |
19 | 19 | #include <lttng-tracer.h> |
20 | 20 | |
21 | 21 | #if defined(CONFIG_IPC_NS) && \ |
22 | (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
22 | (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
23 | 23 | |
24 | 24 | static |
25 | 25 | size_t ipc_ns_get_size(size_t offset) |
19 | 19 | #include <lttng-tracer.h> |
20 | 20 | |
21 | 21 | #if !defined(LTTNG_MNT_NS_MISSING_HEADER) && \ |
22 | (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
22 | (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
23 | 23 | |
24 | 24 | #include <../fs/mount.h> |
25 | 25 |
20 | 20 | #include <lttng-tracer.h> |
21 | 21 | |
22 | 22 | #if defined(CONFIG_NET_NS) && \ |
23 | (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
23 | (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
24 | 24 | |
25 | 25 | static |
26 | 26 | size_t net_ns_get_size(size_t offset) |
58 | 58 | chan->ops->event_write(ctx, &value, sizeof(value)); |
59 | 59 | } |
60 | 60 | |
61 | #if defined(CONFIG_PERF_EVENTS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) | |
61 | #if defined(CONFIG_PERF_EVENTS) && (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0)) | |
62 | 62 | static |
63 | 63 | void overflow_callback(struct perf_event *event, |
64 | 64 | struct perf_sample_data *data, |
79 | 79 | { |
80 | 80 | struct perf_event **events = field->u.perf_counter->e; |
81 | 81 | |
82 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
82 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
83 | 83 | { |
84 | 84 | int ret; |
85 | 85 | |
90 | 90 | &field->u.perf_counter->cpuhp_prepare.node); |
91 | 91 | WARN_ON(ret); |
92 | 92 | } |
93 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
93 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
94 | 94 | { |
95 | 95 | int cpu; |
96 | 96 | |
102 | 102 | unregister_cpu_notifier(&field->u.perf_counter->nb); |
103 | 103 | #endif |
104 | 104 | } |
105 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
105 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
106 | 106 | kfree(field->event_field.name); |
107 | 107 | kfree(field->u.perf_counter->attr); |
108 | 108 | lttng_kvfree(events); |
109 | 109 | kfree(field->u.perf_counter); |
110 | 110 | } |
111 | 111 | |
112 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
112 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
113 | 113 | |
114 | 114 | int lttng_cpuhp_perf_counter_online(unsigned int cpu, |
115 | 115 | struct lttng_cpuhp_node *node) |
150 | 150 | return 0; |
151 | 151 | } |
152 | 152 | |
153 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
153 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
154 | 154 | |
155 | 155 | #ifdef CONFIG_HOTPLUG_CPU |
156 | 156 | |
209 | 209 | |
210 | 210 | #endif |
211 | 211 | |
212 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
212 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
213 | 213 | |
214 | 214 | int lttng_add_perf_counter_to_ctx(uint32_t type, |
215 | 215 | uint64_t config, |
263 | 263 | goto find_error; |
264 | 264 | } |
265 | 265 | |
266 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
266 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
267 | 267 | |
268 | 268 | perf_field->cpuhp_prepare.component = LTTNG_CONTEXT_PERF_COUNTERS; |
269 | 269 | ret = cpuhp_state_add_instance(lttng_hp_prepare, |
277 | 277 | if (ret) |
278 | 278 | goto cpuhp_online_error; |
279 | 279 | |
280 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
280 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
281 | 281 | { |
282 | 282 | int cpu; |
283 | 283 | |
303 | 303 | put_online_cpus(); |
304 | 304 | perf_field->hp_enable = 1; |
305 | 305 | } |
306 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
306 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
307 | 307 | |
308 | 308 | field->destroy = lttng_destroy_perf_counter_field; |
309 | 309 | |
323 | 323 | wrapper_vmalloc_sync_mappings(); |
324 | 324 | return 0; |
325 | 325 | |
326 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
326 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
327 | 327 | cpuhp_online_error: |
328 | 328 | { |
329 | 329 | int remove_ret; |
333 | 333 | WARN_ON(remove_ret); |
334 | 334 | } |
335 | 335 | cpuhp_prepare_error: |
336 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
336 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
337 | 337 | counter_busy: |
338 | 338 | counter_error: |
339 | 339 | { |
348 | 348 | unregister_cpu_notifier(&perf_field->nb); |
349 | 349 | #endif |
350 | 350 | } |
351 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
351 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
352 | 352 | find_error: |
353 | 353 | lttng_remove_context_field(ctx, field); |
354 | 354 | append_context_error: |
19 | 19 | #include <lttng-tracer.h> |
20 | 20 | |
21 | 21 | #if defined(CONFIG_PID_NS) && \ |
22 | (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
22 | (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
23 | 23 | |
24 | 24 | static |
25 | 25 | size_t pid_ns_get_size(size_t offset) |
19 | 19 | #include <lttng-tracer.h> |
20 | 20 | |
21 | 21 | #if defined(CONFIG_USER_NS) && \ |
22 | (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
22 | (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
23 | 23 | |
24 | 24 | static |
25 | 25 | size_t user_ns_get_size(size_t offset) |
19 | 19 | #include <lttng-tracer.h> |
20 | 20 | |
21 | 21 | #if defined(CONFIG_UTS_NS) && \ |
22 | (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
22 | (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
23 | 23 | |
24 | 24 | static |
25 | 25 | size_t uts_ns_get_size(size_t offset) |
9 | 9 | |
10 | 10 | struct lttng_cpuhp_node; |
11 | 11 | |
12 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
12 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
13 | 13 | |
14 | 14 | #include <linux/cpuhotplug.h> |
15 | 15 |
76 | 76 | |
77 | 77 | void synchronize_trace(void) |
78 | 78 | { |
79 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0)) | |
79 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,1,0)) | |
80 | 80 | synchronize_rcu(); |
81 | 81 | #else |
82 | 82 | synchronize_sched(); |
83 | 83 | #endif |
84 | 84 | |
85 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
85 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,4,0)) | |
86 | 86 | #ifdef CONFIG_PREEMPT_RT_FULL |
87 | 87 | synchronize_rcu(); |
88 | 88 | #endif |
89 | #else /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) */ | |
89 | #else /* (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,4,0)) */ | |
90 | 90 | #ifdef CONFIG_PREEMPT_RT |
91 | 91 | synchronize_rcu(); |
92 | 92 | #endif |
93 | #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) */ | |
93 | #endif /* (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,4,0)) */ | |
94 | 94 | } |
95 | 95 | |
96 | 96 | void lttng_lock_sessions(void) |
2907 | 2907 | } |
2908 | 2908 | EXPORT_SYMBOL_GPL(lttng_transport_unregister); |
2909 | 2909 | |
2910 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
2910 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
2911 | 2911 | |
2912 | 2912 | enum cpuhp_state lttng_hp_prepare; |
2913 | 2913 | enum cpuhp_state lttng_hp_online; |
3023 | 3023 | cpuhp_remove_multi_state(lttng_hp_prepare); |
3024 | 3024 | } |
3025 | 3025 | |
3026 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
3026 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
3027 | 3027 | static int lttng_init_cpu_hotplug(void) |
3028 | 3028 | { |
3029 | 3029 | return 0; |
3031 | 3031 | static void lttng_exit_cpu_hotplug(void) |
3032 | 3032 | { |
3033 | 3033 | } |
3034 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ | |
3034 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ | |
3035 | 3035 | |
3036 | 3036 | |
3037 | 3037 | static int __init lttng_events_init(void) |
9 | 9 | #ifndef _LTTNG_EVENTS_H |
10 | 10 | #define _LTTNG_EVENTS_H |
11 | 11 | |
12 | #include <linux/version.h> | |
12 | #include <lttng-kernel-version.h> | |
13 | 13 | #include <linux/list.h> |
14 | 14 | #include <linux/kprobes.h> |
15 | 15 | #include <linux/kref.h> |
175 | 175 | * lttng_ctx_field because cpu hotplug needs fixed-location addresses. |
176 | 176 | */ |
177 | 177 | struct lttng_perf_counter_field { |
178 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | |
178 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) | |
179 | 179 | struct lttng_cpuhp_node cpuhp_prepare; |
180 | 180 | struct lttng_cpuhp_node cpuhp_online; |
181 | 181 | #else |
764 | 764 | int lttng_add_callstack_to_ctx(struct lttng_ctx **ctx, int type); |
765 | 765 | |
766 | 766 | #if defined(CONFIG_CGROUPS) && \ |
767 | ((LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)) || \ | |
767 | ((LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,6,0)) || \ | |
768 | 768 | LTTNG_UBUNTU_KERNEL_RANGE(4,4,0,0, 4,5,0,0)) |
769 | 769 | int lttng_add_cgroup_ns_to_ctx(struct lttng_ctx **ctx); |
770 | 770 | #else |
776 | 776 | #endif |
777 | 777 | |
778 | 778 | #if defined(CONFIG_IPC_NS) && \ |
779 | (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
779 | (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
780 | 780 | int lttng_add_ipc_ns_to_ctx(struct lttng_ctx **ctx); |
781 | 781 | #else |
782 | 782 | static inline |
787 | 787 | #endif |
788 | 788 | |
789 | 789 | #if !defined(LTTNG_MNT_NS_MISSING_HEADER) && \ |
790 | (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
790 | (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
791 | 791 | int lttng_add_mnt_ns_to_ctx(struct lttng_ctx **ctx); |
792 | 792 | #else |
793 | 793 | static inline |
798 | 798 | #endif |
799 | 799 | |
800 | 800 | #if defined(CONFIG_NET_NS) && \ |
801 | (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
801 | (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
802 | 802 | int lttng_add_net_ns_to_ctx(struct lttng_ctx **ctx); |
803 | 803 | #else |
804 | 804 | static inline |
809 | 809 | #endif |
810 | 810 | |
811 | 811 | #if defined(CONFIG_PID_NS) && \ |
812 | (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
812 | (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
813 | 813 | int lttng_add_pid_ns_to_ctx(struct lttng_ctx **ctx); |
814 | 814 | #else |
815 | 815 | static inline |
820 | 820 | #endif |
821 | 821 | |
822 | 822 | #if defined(CONFIG_USER_NS) && \ |
823 | (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
823 | (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
824 | 824 | int lttng_add_user_ns_to_ctx(struct lttng_ctx **ctx); |
825 | 825 | #else |
826 | 826 | static inline |
831 | 831 | #endif |
832 | 832 | |
833 | 833 | #if defined(CONFIG_UTS_NS) && \ |
834 | (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
834 | (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
835 | 835 | int lttng_add_uts_ns_to_ctx(struct lttng_ctx **ctx); |
836 | 836 | #else |
837 | 837 | static inline |
1 | 1 | * |
2 | 2 | * lttng-kernel-version.h |
3 | 3 | * |
4 | * Contains helpers to check more complex kernel version conditions. | |
4 | * Contains helpers to check kernel version conditions. | |
5 | 5 | * |
6 | 6 | * Copyright (C) 2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
7 | 7 | */ |
13 | 13 | #include <generated/utsrelease.h> |
14 | 14 | |
15 | 15 | /* |
16 | * The following defines are extracted from the toplevel Linux Makefile and | |
17 | * passed on the command line -with '-D'. | |
18 | */ | |
19 | ||
20 | #ifndef LTTNG_LINUX_MAJOR | |
21 | #define LTTNG_LINUX_MAJOR 0 | |
22 | #endif | |
23 | ||
24 | #ifndef LTTNG_LINUX_MINOR | |
25 | #define LTTNG_LINUX_MINOR 0 | |
26 | #endif | |
27 | ||
28 | #ifndef LTTNG_LINUX_PATCH | |
29 | #define LTTNG_LINUX_PATCH 0 | |
30 | #endif | |
31 | ||
32 | /* | |
33 | * Some stable releases have overflowed the 8bits allocated to the sublevel in | |
34 | * the version code. To determine if the current kernel is affected, use the | |
35 | * sublevel version from the Makefile. This is currently true for the 4.4.256 | |
36 | * and 4.9.256 stable releases. | |
37 | * | |
38 | * When the sublevel has overflowed, use the values from the Makefile instead | |
39 | * of LINUX_VERSION_CODE from the kernel headers and allocate 16bits. | |
40 | * Otherwise, keep using the version code from the headers to minimise the | |
41 | * behavior change and avoid regressions. | |
42 | * | |
43 | * Cast the result to uint64_t to prevent overflowing when we append distro | |
44 | * specific version information. | |
45 | */ | |
46 | #if (LTTNG_LINUX_PATCH >= 256) | |
47 | ||
48 | #define LTTNG_KERNEL_VERSION(a, b, c) \ | |
49 | ((((a) << 24) + ((b) << 16) + (c)) * 1ULL) | |
50 | ||
51 | #define LTTNG_LINUX_VERSION_CODE \ | |
52 | LTTNG_KERNEL_VERSION(LTTNG_LINUX_MAJOR, LTTNG_LINUX_MINOR, LTTNG_LINUX_PATCH) | |
53 | ||
54 | #else | |
55 | ||
56 | #define LTTNG_KERNEL_VERSION(a, b, c) (KERNEL_VERSION(a, b, c) * 1ULL) | |
57 | #define LTTNG_LINUX_VERSION_CODE (LINUX_VERSION_CODE * 1ULL) | |
58 | ||
59 | #endif | |
60 | ||
61 | /* | |
16 | 62 | * This macro checks if the kernel version is between the two specified |
17 | 63 | * versions (lower limit inclusive, upper limit exclusive). |
18 | 64 | */ |
19 | 65 | #define LTTNG_KERNEL_RANGE(a_low, b_low, c_low, a_high, b_high, c_high) \ |
20 | (LINUX_VERSION_CODE >= KERNEL_VERSION(a_low, b_low, c_low) && \ | |
21 | LINUX_VERSION_CODE < KERNEL_VERSION(a_high, b_high, c_high)) | |
66 | (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(a_low, b_low, c_low) && \ | |
67 | LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(a_high, b_high, c_high)) | |
22 | 68 | |
23 | 69 | /* Ubuntu */ |
24 | 70 | |
25 | 71 | #define LTTNG_UBUNTU_KERNEL_VERSION(a, b, c, d) \ |
26 | (((a) << 24) + ((b) << 16) + ((c) << 8) + (d)) | |
72 | (((LTTNG_KERNEL_VERSION(a, b, c)) << 16) + (d)) | |
27 | 73 | |
28 | 74 | #ifdef UTS_UBUNTU_RELEASE_ABI |
29 | 75 | #define LTTNG_UBUNTU_VERSION_CODE \ |
30 | ((LINUX_VERSION_CODE << 8) + UTS_UBUNTU_RELEASE_ABI) | |
76 | ((LTTNG_LINUX_VERSION_CODE << 16) + UTS_UBUNTU_RELEASE_ABI) | |
31 | 77 | #else |
32 | 78 | #define LTTNG_UBUNTU_VERSION_CODE 0 |
33 | 79 | #endif |
42 | 88 | /* Debian */ |
43 | 89 | |
44 | 90 | #define LTTNG_DEBIAN_KERNEL_VERSION(a, b, c, d, e, f) \ |
45 | (((((a) << 16) + ((b) << 8) + (c)) * 1000000ULL) + ((d) * 10000) + ((e) * 100) + (f)) | |
91 | (((LTTNG_KERNEL_VERSION(a, b, c)) * 1000000ULL) + ((d) * 10000) + ((e) * 100) + (f)) | |
46 | 92 | |
47 | 93 | #ifdef DEBIAN_API_VERSION |
48 | 94 | #define LTTNG_DEBIAN_VERSION_CODE \ |
49 | ((LINUX_VERSION_CODE * 1000000ULL) + DEBIAN_API_VERSION) | |
95 | ((LTTNG_LINUX_VERSION_CODE * 1000000ULL) + DEBIAN_API_VERSION) | |
50 | 96 | #else |
51 | 97 | #define LTTNG_DEBIAN_VERSION_CODE 0 |
52 | 98 | #endif |
59 | 105 | LTTNG_DEBIAN_KERNEL_VERSION(a_high, b_high, c_high, d_high, e_high, f_high)) |
60 | 106 | |
61 | 107 | #define LTTNG_RHEL_KERNEL_VERSION(a, b, c, d, e, f) \ |
62 | (((((a) << 16) + ((b) << 8) + (c)) * 10000000ULL) + ((d) * 10000) + ((e) * 100) + (f)) | |
108 | (((LTTNG_KERNEL_VERSION(a, b, c)) * 100000000ULL) + ((d) * 10000) + ((e) * 100) + (f)) | |
63 | 109 | |
64 | 110 | /* RHEL */ |
65 | 111 | |
66 | 112 | #ifdef RHEL_API_VERSION |
67 | 113 | #define LTTNG_RHEL_VERSION_CODE \ |
68 | ((LINUX_VERSION_CODE * 10000000ULL) + RHEL_API_VERSION) | |
114 | ((LTTNG_LINUX_VERSION_CODE * 100000000ULL) + RHEL_API_VERSION) | |
69 | 115 | #else |
70 | 116 | #define LTTNG_RHEL_VERSION_CODE 0 |
71 | 117 | #endif |
80 | 126 | /* SUSE Linux enterprise */ |
81 | 127 | |
82 | 128 | #define LTTNG_SLE_KERNEL_VERSION(a, b, c, d, e, f) \ |
83 | (((((a) << 16) + ((b) << 8) + (c)) * 10000000ULL) + ((d) * 10000) + ((e) * 100) + (f)) | |
129 | (((LTTNG_KERNEL_VERSION(a, b, c)) * 100000000ULL) + ((d) * 100000) + ((e) * 100) + (f)) | |
84 | 130 | |
85 | 131 | #ifdef SLE_API_VERSION |
86 | 132 | #define LTTNG_SLE_VERSION_CODE \ |
87 | ((LINUX_VERSION_CODE * 10000000ULL) + SLE_API_VERSION) | |
133 | ((LTTNG_LINUX_VERSION_CODE * 100000000ULL) + SLE_API_VERSION) | |
88 | 134 | #else |
89 | 135 | #define LTTNG_SLE_VERSION_CODE 0 |
90 | 136 | #endif |
99 | 145 | /* Fedora */ |
100 | 146 | |
101 | 147 | #define LTTNG_FEDORA_KERNEL_VERSION(a, b, c, d) \ |
102 | (((((a) << 16) + ((b) << 8) + (c)) * 10000ULL) + (d)) | |
148 | (((LTTNG_KERNEL_VERSION(a, b, c)) * 10000ULL) + (d)) | |
103 | 149 | |
104 | 150 | #ifdef FEDORA_REVISION_VERSION |
105 | 151 | #define LTTNG_FEDORA_VERSION_CODE \ |
106 | ((LINUX_VERSION_CODE * 10000ULL) + FEDORA_REVISION_VERSION) | |
152 | ((LTTNG_LINUX_VERSION_CODE * 10000ULL) + FEDORA_REVISION_VERSION) | |
107 | 153 | #else |
108 | 154 | #define LTTNG_FEDORA_VERSION_CODE 0 |
109 | 155 | #endif |
118 | 164 | /* RT patch */ |
119 | 165 | |
120 | 166 | #define LTTNG_RT_KERNEL_VERSION(a, b, c, d) \ |
121 | (((a) << 24) + ((b) << 16) + ((c) << 8) + (d)) | |
167 | (((LTTNG_KERNEL_VERSION(a, b, c)) << 16) + (d)) | |
122 | 168 | |
123 | 169 | #ifdef RT_PATCH_VERSION |
124 | 170 | #define LTTNG_RT_VERSION_CODE \ |
125 | ((LINUX_VERSION_CODE << 8) + RT_PATCH_VERSION) | |
171 | ((LTTNG_LINUX_VERSION_CODE << 16) + RT_PATCH_VERSION) | |
126 | 172 | #else |
127 | 173 | #define LTTNG_RT_VERSION_CODE 0 |
128 | 174 | #endif |
93 | 93 | struct pid_namespace *pid_ns), |
94 | 94 | TP_ARGS(session, p, pid_ns)); |
95 | 95 | |
96 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)) | |
96 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,6,0)) | |
97 | 97 | LTTNG_DEFINE_TRACE(lttng_statedump_process_cgroup_ns, |
98 | 98 | TP_PROTO(struct lttng_session *session, |
99 | 99 | struct task_struct *p, |
187 | 187 | LTTNG_DEAD = 7, |
188 | 188 | }; |
189 | 189 | |
190 | ||
191 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) | |
192 | ||
193 | #define LTTNG_PART_STRUCT_TYPE struct block_device | |
194 | ||
195 | static | |
196 | int lttng_get_part_name(struct gendisk *disk, struct block_device *part, char *name_buf) | |
197 | { | |
198 | const char *p; | |
199 | ||
200 | p = bdevname(part, name_buf); | |
201 | if (!p) | |
202 | return -ENOSYS; | |
203 | ||
204 | return 0; | |
205 | } | |
206 | ||
207 | static | |
208 | dev_t lttng_get_part_devt(struct block_device *part) | |
209 | { | |
210 | return part->bd_dev; | |
211 | } | |
212 | ||
213 | #else | |
214 | ||
215 | #define LTTNG_PART_STRUCT_TYPE struct hd_struct | |
216 | ||
217 | static | |
218 | int lttng_get_part_name(struct gendisk *disk, struct hd_struct *part, char *name_buf) | |
219 | { | |
220 | const char *p; | |
221 | struct block_device bdev; | |
222 | ||
223 | /* | |
224 | * Create a partial 'struct blockdevice' to use | |
225 | * 'bdevname()' which is a simple wrapper over | |
226 | * 'disk_name()' but has the honor to be EXPORT_SYMBOL. | |
227 | */ | |
228 | bdev.bd_disk = disk; | |
229 | bdev.bd_part = part; | |
230 | ||
231 | p = bdevname(&bdev, name_buf); | |
232 | if (!p) | |
233 | return -ENOSYS; | |
234 | ||
235 | return 0; | |
236 | } | |
237 | ||
238 | static | |
239 | dev_t lttng_get_part_devt(struct hd_struct *part) | |
240 | { | |
241 | return part_devt(part); | |
242 | } | |
243 | #endif | |
244 | ||
190 | 245 | static |
191 | 246 | int lttng_enumerate_block_devices(struct lttng_session *session) |
192 | 247 | { |
206 | 261 | while ((dev = class_dev_iter_next(&iter))) { |
207 | 262 | struct disk_part_iter piter; |
208 | 263 | struct gendisk *disk = dev_to_disk(dev); |
209 | struct hd_struct *part; | |
264 | LTTNG_PART_STRUCT_TYPE *part; | |
210 | 265 | |
211 | 266 | /* |
212 | 267 | * Don't show empty devices or things that have been |
218 | 273 | |
219 | 274 | disk_part_iter_init(&piter, disk, DISK_PITER_INCL_PART0); |
220 | 275 | while ((part = disk_part_iter_next(&piter))) { |
221 | struct block_device bdev; | |
222 | 276 | char name_buf[BDEVNAME_SIZE]; |
223 | const char *p; | |
224 | ||
225 | /* | |
226 | * Create a partial 'struct blockdevice' to use | |
227 | * 'bdevname()' which is a simple wrapper over | |
228 | * 'disk_name()' but has the honor to be EXPORT_SYMBOL. | |
229 | */ | |
230 | bdev.bd_disk = disk; | |
231 | bdev.bd_part = part; | |
232 | ||
233 | p = bdevname(&bdev, name_buf); | |
234 | if (!p) { | |
277 | ||
278 | if (lttng_get_part_name(disk, part, name_buf) == -ENOSYS) { | |
235 | 279 | disk_part_iter_exit(&piter); |
236 | 280 | class_dev_iter_exit(&iter); |
237 | 281 | return -ENOSYS; |
238 | 282 | } |
239 | 283 | trace_lttng_statedump_block_device(session, |
240 | part_devt(part), name_buf); | |
284 | lttng_get_part_devt(part), name_buf); | |
241 | 285 | } |
242 | 286 | disk_part_iter_exit(&piter); |
243 | 287 | } |
501 | 545 | * "namespaces: Use task_lock and not rcu to protect nsproxy" |
502 | 546 | * for details. |
503 | 547 | */ |
504 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) || \ | |
548 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,17,0) || \ | |
505 | 549 | LTTNG_UBUNTU_KERNEL_RANGE(3,13,11,36, 3,14,0,0) || \ |
506 | 550 | LTTNG_UBUNTU_KERNEL_RANGE(3,16,1,11, 3,17,0,0) || \ |
507 | 551 | LTTNG_RHEL_KERNEL_RANGE(3,10,0,229,13,0, 3,11,0,0,0,0)) |
511 | 555 | proxy = task_nsproxy(p); |
512 | 556 | #endif |
513 | 557 | if (proxy) { |
514 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)) | |
558 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,6,0)) | |
515 | 559 | trace_lttng_statedump_process_cgroup_ns(session, p, proxy->cgroup_ns); |
516 | 560 | #endif |
517 | 561 | trace_lttng_statedump_process_ipc_ns(session, p, proxy->ipc_ns); |
521 | 565 | trace_lttng_statedump_process_net_ns(session, p, proxy->net_ns); |
522 | 566 | trace_lttng_statedump_process_uts_ns(session, p, proxy->uts_ns); |
523 | 567 | } |
524 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) || \ | |
568 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,17,0) || \ | |
525 | 569 | LTTNG_UBUNTU_KERNEL_RANGE(3,13,11,36, 3,14,0,0) || \ |
526 | 570 | LTTNG_UBUNTU_KERNEL_RANGE(3,16,1,11, 3,17,0,0) || \ |
527 | 571 | LTTNG_RHEL_KERNEL_RANGE(3,10,0,229,13,0, 3,11,0,0,0,0)) |
80 | 80 | struct itimerval; |
81 | 81 | struct itimerspec; |
82 | 82 | |
83 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) | |
83 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0)) | |
84 | 84 | typedef __kernel_old_time_t time_t; |
85 | 85 | #endif |
86 | 86 |
28 | 28 | |
29 | 29 | #define LTTNG_MODULES_MAJOR_VERSION 2 |
30 | 30 | #define LTTNG_MODULES_MINOR_VERSION 12 |
31 | #define LTTNG_MODULES_PATCHLEVEL_VERSION 4 | |
31 | #define LTTNG_MODULES_PATCHLEVEL_VERSION 5 | |
32 | 32 | #define LTTNG_MODULES_EXTRAVERSION "" |
33 | 33 | |
34 | 34 | #define LTTNG_VERSION_NAME "(Ta) Meilleure" |
7 | 7 | */ |
8 | 8 | |
9 | 9 | #include <linux/module.h> |
10 | #include <linux/kprobes.h> | |
10 | #include <wrapper/kprobes.h> | |
11 | 11 | #include <linux/slab.h> |
12 | 12 | #include <linux/kref.h> |
13 | 13 | #include <lttng-events.h> |
35 | 35 | enum lttng_kretprobe_type type) |
36 | 36 | { |
37 | 37 | struct lttng_krp *lttng_krp = |
38 | container_of(krpi->rp, struct lttng_krp, krp); | |
38 | container_of(lttng_get_kretprobe(krpi), struct lttng_krp, krp); | |
39 | 39 | struct lttng_event *event = |
40 | 40 | lttng_krp->event[type]; |
41 | 41 | struct lttng_probe_ctx lttng_probe_ctx = { |
57 | 57 | if (unlikely(!LTTNG_READ_ONCE(event->enabled))) |
58 | 58 | return 0; |
59 | 59 | |
60 | payload.ip = (unsigned long) krpi->rp->kp.addr; | |
60 | payload.ip = (unsigned long) lttng_get_kretprobe(krpi)->kp.addr; | |
61 | 61 | payload.parent_ip = (unsigned long) krpi->ret_addr; |
62 | 62 | |
63 | 63 | lib_ring_buffer_ctx_init(&ctx, chan->chan, <tng_probe_ctx, sizeof(payload), |
9 | 9 | |
10 | 10 | #include <linux/module.h> |
11 | 11 | #include <linux/fs.h> |
12 | #include <linux/version.h> | |
12 | #include <lttng-kernel-version.h> | |
13 | 13 | #include <../fs/btrfs/ctree.h> |
14 | 14 | #include <../fs/btrfs/transaction.h> |
15 | 15 | #include <../fs/btrfs/volumes.h> |
16 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,4,0)) | |
16 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,4,0)) | |
17 | 17 | #include <../fs/btrfs/block-group.h> |
18 | 18 | #endif |
19 | 19 | #include <linux/dcache.h> |
10 | 10 | #include <linux/module.h> |
11 | 11 | #include <linux/fs.h> |
12 | 12 | #include <linux/dcache.h> |
13 | #include <linux/version.h> | |
13 | #include <lttng-kernel-version.h> | |
14 | 14 | #include <lttng-tracer.h> |
15 | 15 | |
16 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
16 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,4,0)) | |
17 | 17 | #include <../fs/ext3/ext3.h> |
18 | 18 | #else |
19 | 19 | #include <linux/ext3_fs_i.h> |
11 | 11 | #include <lttng-tracer.h> |
12 | 12 | #include <lttng-kernel-version.h> |
13 | 13 | |
14 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)) | |
14 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,1,0)) | |
15 | 15 | #include <kvm/iodev.h> |
16 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)) */ | |
16 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,1,0)) */ | |
17 | 17 | #include <../../virt/kvm/iodev.h> |
18 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)) */ | |
18 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,1,0)) */ | |
19 | 19 | |
20 | 20 | /* |
21 | 21 | * Create the tracepoint static inlines from the kernel to validate that our |
23 | 23 | */ |
24 | 24 | #include <wrapper/tracepoint.h> |
25 | 25 | |
26 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0)) | |
26 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,9,0)) | |
27 | 27 | #include <../../arch/x86/kvm/mmu/mmu_internal.h> |
28 | 28 | #include <../../arch/x86/kvm/mmu/mmutrace.h> |
29 | 29 | #else |
30 | 30 | #include <../../arch/x86/kvm/mmutrace.h> |
31 | 31 | #endif |
32 | 32 | |
33 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0)) | |
33 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,10,0)) | |
34 | 34 | #include <../arch/x86/kvm/mmu.h> |
35 | 35 | #include <../arch/x86/kvm/mmu/spte.h> |
36 | 36 | #endif |
11 | 11 | #include <lttng-tracer.h> |
12 | 12 | #include <lttng-kernel-version.h> |
13 | 13 | |
14 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) | |
14 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,7,0)) | |
15 | 15 | #include <kvm_emulate.h> |
16 | 16 | #endif |
17 | 17 | |
18 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)) | |
18 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,1,0)) | |
19 | 19 | #include <kvm/iodev.h> |
20 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)) */ | |
20 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,1,0)) */ | |
21 | 21 | #include <../../virt/kvm/iodev.h> |
22 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)) */ | |
22 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,1,0)) */ | |
23 | 23 | |
24 | 24 | /* |
25 | 25 | * Create the tracepoint static inlines from the kernel to validate that our |
8 | 8 | */ |
9 | 9 | |
10 | 10 | #include <linux/module.h> |
11 | #include <linux/version.h> | |
11 | #include <lttng-kernel-version.h> | |
12 | 12 | #include <lttng-tracer.h> |
13 | 13 | |
14 | 14 | /* |
8 | 8 | * |
9 | 9 | */ |
10 | 10 | |
11 | #include <linux/fdtable.h> | |
11 | #include <wrapper/fdtable.h> | |
12 | 12 | #include <linux/list.h> |
13 | 13 | #include <linux/module.h> |
14 | 14 | #include <linux/namei.h> |
125 | 125 | * Returns the file backing the given fd. Needs to be done inside an RCU |
126 | 126 | * critical section. |
127 | 127 | */ |
128 | file = fcheck(fd); | |
128 | file = lttng_lookup_fd_rcu(fd); | |
129 | 129 | if (file == NULL) { |
130 | 130 | printk(KERN_WARNING "Cannot access file backing the fd(%d)\n", fd); |
131 | 131 | inode = NULL; |
99 | 99 | * Linux 5.6 introduced a separate proc_ops struct for /proc operations |
100 | 100 | * to decouple it from the vfs. |
101 | 101 | */ |
102 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) | |
102 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0)) | |
103 | 103 | static const struct proc_ops lttng_logger_proc_ops = { |
104 | 104 | .proc_write = lttng_logger_write, |
105 | 105 | }; |
37 | 37 | fi |
38 | 38 | |
39 | 39 | # Combine all update numbers into one |
40 | SLE_API_VERSION="$((SLE_RELEASE_MAJOR * 10000 + SLE_RELEASE_MINOR * 100 + SLE_RELEASE_PATCH))" | |
40 | SLE_API_VERSION="$((SLE_RELEASE_MAJOR * 100000 + SLE_RELEASE_MINOR * 100 + SLE_RELEASE_PATCH))" | |
41 | 41 | |
42 | 42 | echo ${SLE_API_VERSION} |
85 | 85 | return written; |
86 | 86 | } |
87 | 87 | |
88 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) | |
88 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0)) | |
89 | 89 | static const struct proc_ops lttng_test_filter_event_proc_ops = { |
90 | 90 | .proc_write = lttng_test_filter_event_write, |
91 | 91 | }; |
9 | 9 | #ifndef _LTTNG_WRAPPER_ATOMIC_H |
10 | 10 | #define _LTTNG_WRAPPER_ATOMIC_H |
11 | 11 | |
12 | #include <linux/version.h> | |
12 | #include <lttng-kernel-version.h> | |
13 | 13 | #include <linux/atomic.h> |
14 | 14 | |
15 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) | |
15 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,16,0)) | |
16 | 16 | static inline void lttng_smp_mb__before_atomic(void) |
17 | 17 | { |
18 | 18 | smp_mb__before_atomic(); |
22 | 22 | { |
23 | 23 | smp_mb__after_atomic(); |
24 | 24 | } |
25 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */ | |
25 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,16,0)) */ | |
26 | 26 | static inline void lttng_smp_mb__before_atomic(void) |
27 | 27 | { |
28 | 28 | smp_mb__before_atomic_inc(); |
32 | 32 | { |
33 | 33 | smp_mb__after_atomic_inc(); |
34 | 34 | } |
35 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */ | |
35 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,16,0)) */ | |
36 | 36 | |
37 | 37 | #endif /* _LTTNG_WRAPPER_ATOMIC_H */ |
8 | 8 | #define _LTTNG_WRAPPER_COMPILER_H |
9 | 9 | |
10 | 10 | #include <linux/compiler.h> |
11 | #include <linux/version.h> | |
11 | #include <lttng-kernel-version.h> | |
12 | 12 | |
13 | 13 | /* |
14 | 14 | * Don't allow compiling with buggy compiler. |
24 | 24 | # error Your gcc version produces clobbered frame accesses |
25 | 25 | # endif |
26 | 26 | # endif |
27 | ||
28 | /* | |
29 | * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63293 | |
30 | */ | |
31 | # ifdef __aarch64__ | |
32 | # if GCC_VERSION < 50100 | |
33 | # error Your gcc version performs unsafe access to deallocated stack | |
34 | # endif | |
35 | # endif | |
36 | ||
27 | 37 | #endif |
28 | 38 | |
29 | 39 | /* |
45 | 55 | * and remove calls to smp_read_barrier_depends which was dropped |
46 | 56 | * in v5.9. |
47 | 57 | */ |
48 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) | |
58 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0)) | |
49 | 59 | #define LTTNG_READ_ONCE(x) READ_ONCE(x) |
50 | 60 | #else |
51 | 61 | #define LTTNG_READ_ONCE(x) \ |
3 | 3 | * Copyright (C) 2013 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
4 | 4 | */ |
5 | 5 | |
6 | #include <linux/version.h> | |
6 | #include <lttng-kernel-version.h> | |
7 | 7 | #include <linux/spinlock.h> |
8 | 8 | #include <wrapper/fdtable.h> |
9 | 9 | |
10 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)) | |
10 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,7,0)) | |
11 | 11 | |
12 | 12 | /* |
13 | 13 | * Reimplementation of iterate_fd() for kernels between 2.6.32 and 3.6 |
7 | 7 | #ifndef _LTTNG_WRAPPER_FDTABLE_H |
8 | 8 | #define _LTTNG_WRAPPER_FDTABLE_H |
9 | 9 | |
10 | #include <linux/version.h> | |
10 | #include <lttng-kernel-version.h> | |
11 | 11 | #include <linux/fdtable.h> |
12 | #include <linux/sched.h> | |
12 | 13 | |
13 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)) | |
14 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) | |
15 | static inline | |
16 | struct file *lttng_lookup_fd_rcu(unsigned int fd) | |
17 | { | |
18 | return lookup_fd_rcu(fd); | |
19 | } | |
20 | #else | |
21 | static inline | |
22 | struct file *lttng_lookup_fd_rcu(unsigned int fd) | |
23 | { | |
24 | return fcheck(fd); | |
25 | } | |
26 | #endif | |
27 | ||
28 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,7,0)) | |
14 | 29 | |
15 | 30 | int lttng_iterate_fd(struct files_struct *files, |
16 | 31 | unsigned int first, |
28 | 43 | |
29 | 44 | #endif |
30 | 45 | |
31 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) | |
46 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,4,0)) | |
32 | 47 | |
33 | 48 | static inline bool lttng_close_on_exec(int fd, const struct fdtable *fdt) |
34 | 49 | { |
9 | 9 | #ifndef _LTTNG_WRAPPER_FILE_H |
10 | 10 | #define _LTTNG_WRAPPER_FILE_H |
11 | 11 | |
12 | #include <linux/version.h> | |
12 | #include <lttng-kernel-version.h> | |
13 | 13 | #include <linux/file.h> |
14 | 14 | |
15 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) | |
15 | #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0) | |
16 | 16 | |
17 | 17 | static |
18 | 18 | inline int lttng_get_unused_fd(void) |
22 | 22 | |
23 | 23 | #define lttng_f_dentry f_path.dentry |
24 | 24 | |
25 | #else /* #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) */ | |
25 | #else /* #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0) */ | |
26 | 26 | |
27 | 27 | static |
28 | 28 | inline int lttng_get_unused_fd(void) |
32 | 32 | |
33 | 33 | #define lttng_f_dentry f_dentry |
34 | 34 | |
35 | #endif /* #else #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) */ | |
35 | #endif /* #else #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0) */ | |
36 | 36 | |
37 | 37 | #endif /* _LTTNG_WRAPPER_FILE_H */ |
10 | 10 | #include <linux/fs.h> |
11 | 11 | #include <lttng-kernel-version.h> |
12 | 12 | |
13 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) | |
13 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0)) | |
14 | 14 | |
15 | 15 | static inline |
16 | 16 | ssize_t lttng_kernel_read(struct file *file, void *buf, size_t count, loff_t *pos) |
18 | 18 | return kernel_read(file, buf, count, pos); |
19 | 19 | } |
20 | 20 | |
21 | #else /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) */ | |
21 | #else /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0) */ | |
22 | 22 | |
23 | 23 | static inline |
24 | 24 | ssize_t lttng_kernel_read(struct file *file, void *buf, size_t count, loff_t *pos) |
37 | 37 | return len; |
38 | 38 | } |
39 | 39 | |
40 | #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) */ | |
40 | #endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0) */ | |
41 | 41 | |
42 | 42 | #endif /* _LTTNG_WRAPPER_FS_H */ |
9 | 9 | #ifndef _LTTNG_WRAPPER_IRQ_H |
10 | 10 | #define _LTTNG_WRAPPER_IRQ_H |
11 | 11 | |
12 | #include <linux/version.h> | |
12 | #include <lttng-kernel-version.h> | |
13 | 13 | |
14 | 14 | /* |
15 | 15 | * Starting from the 3.12 Linux kernel, all architectures use the |
16 | 16 | * generic hard irqs system. More details can be seen at commit |
17 | 17 | * 0244ad004a54e39308d495fee0a2e637f8b5c317 in the Linux kernel GIT. |
18 | 18 | */ |
19 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0) \ | |
19 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0) \ | |
20 | 20 | || defined(CONFIG_GENERIC_HARDIRQS)) |
21 | 21 | # define CONFIG_LTTNG_HAS_LIST_IRQ |
22 | 22 | #endif |
3 | 3 | * |
4 | 4 | * wrapper around irq_to_desc. Using KALLSYMS to get its address when |
5 | 5 | * available, else we need to have a kernel that exports this function to GPL |
6 | * modules. This export was added to the 3.4 kernels. | |
6 | * modules. This export was added to the 3.4 kernels and removed in 5.11. | |
7 | 7 | * |
8 | 8 | * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
9 | 9 | */ |
11 | 11 | #include <lttng-kernel-version.h> |
12 | 12 | #include <linux/module.h> |
13 | 13 | |
14 | #if (defined(CONFIG_KALLSYMS) \ | |
15 | && (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))) | |
14 | #if (defined(CONFIG_KALLSYMS) && \ | |
15 | ((LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) || \ | |
16 | (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,4,0)))) | |
16 | 17 | |
17 | 18 | #include <linux/kallsyms.h> |
18 | 19 | #include <linux/interrupt.h> |
9 | 9 | #ifndef _LTTNG_WRAPPER_IRQFLAGS_H |
10 | 10 | #define _LTTNG_WRAPPER_IRQFLAGS_H |
11 | 11 | |
12 | #include <linux/version.h> | |
12 | #include <lttng-kernel-version.h> | |
13 | 13 | #include <linux/irqflags.h> |
14 | 14 | |
15 | 15 | #ifdef CONFIG_X86 |
13 | 13 | #include <linux/module.h> |
14 | 14 | #include <wrapper/kallsyms.h> |
15 | 15 | |
16 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) | |
16 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,7,0)) | |
17 | 17 | |
18 | 18 | #ifndef CONFIG_KPROBES |
19 | 19 | # error "LTTng-modules requires CONFIG_KPROBES on kernels >= 5.7.0" |
13 | 13 | #define _LTTNG_WRAPPER_KALLSYMS_H |
14 | 14 | |
15 | 15 | #include <linux/kallsyms.h> |
16 | #include <linux/version.h> | |
16 | #include <lttng-kernel-version.h> | |
17 | 17 | |
18 | 18 | /* |
19 | 19 | * PowerPC ABIv1 needs KALLSYMS_ALL to get the function descriptor, |
25 | 25 | # endif |
26 | 26 | #endif |
27 | 27 | |
28 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) | |
28 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,7,0)) | |
29 | 29 | |
30 | 30 | unsigned long wrapper_kallsyms_lookup_name(const char *name); |
31 | 31 | |
32 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */ | |
32 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,7,0)) */ | |
33 | 33 | |
34 | 34 | static inline |
35 | 35 | unsigned long wrapper_kallsyms_lookup_name(const char *name) |
37 | 37 | return kallsyms_lookup_name(name); |
38 | 38 | } |
39 | 39 | |
40 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */ | |
40 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,7,0)) */ | |
41 | 41 | |
42 | 42 | static inline |
43 | 43 | unsigned long kallsyms_lookup_funcptr(const char *name) |
0 | /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) | |
1 | * | |
2 | * src/wrapper/kprobes.h | |
3 | * | |
4 | * Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com> | |
5 | */ | |
6 | ||
7 | #ifndef _LTTNG_WRAPPER_KPROBES_H | |
8 | #define _LTTNG_WRAPPER_KPROBES_H | |
9 | ||
10 | #include <linux/kprobes.h> | |
11 | #include <lttng-kernel-version.h> | |
12 | ||
13 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0)) | |
14 | ||
15 | static inline | |
16 | struct kretprobe *lttng_get_kretprobe(struct kretprobe_instance *ri) | |
17 | { | |
18 | return get_kretprobe(ri); | |
19 | } | |
20 | ||
21 | #else /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0) */ | |
22 | ||
23 | static inline | |
24 | struct kretprobe *lttng_get_kretprobe(struct kretprobe_instance *ri) | |
25 | { | |
26 | return ri->rp; | |
27 | } | |
28 | ||
29 | #endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0) */ | |
30 | ||
31 | #endif /* _LTTNG_WRAPPER_KPROBES_H */ |
15 | 15 | |
16 | 16 | #include <linux/kref.h> |
17 | 17 | #include <linux/rculist.h> |
18 | #include <linux/version.h> | |
18 | #include <lttng-kernel-version.h> | |
19 | 19 | |
20 | 20 | /* |
21 | 21 | * lttng_kref_get: get reference count, checking for overflow. |
22 | 22 | * |
23 | 23 | * Return 1 if reference is taken, 0 otherwise (overflow). |
24 | 24 | */ |
25 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) | |
25 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) | |
26 | 26 | static inline int lttng_kref_get(struct kref *kref) |
27 | 27 | { |
28 | 28 | kref_get(kref); |
29 | 29 | return 1; |
30 | 30 | } |
31 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ | |
31 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) */ | |
32 | 32 | static inline int lttng_kref_get(struct kref *kref) |
33 | 33 | { |
34 | 34 | return atomic_add_unless(&kref->refcount, 1, INT_MAX); |
35 | 35 | } |
36 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ | |
36 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) */ | |
37 | 37 | |
38 | 38 | #endif /* _LTTNG_WRAPPER_KREF_H */ |
12 | 12 | |
13 | 13 | #include <lttng-kernel-version.h> |
14 | 14 | |
15 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0) \ | |
15 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,6,0) \ | |
16 | 16 | || LTTNG_UBUNTU_KERNEL_RANGE(4,4,25,44, 4,5,0,0)) |
17 | 17 | |
18 | 18 | /* |
39 | 39 | } |
40 | 40 | #endif |
41 | 41 | |
42 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) | |
42 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) | |
43 | 43 | static inline |
44 | 44 | void wrapper_set_current_oom_origin(void) |
45 | 45 | { |
52 | 52 | return clear_current_oom_origin(); |
53 | 53 | } |
54 | 54 | |
55 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */ | |
55 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) */ | |
56 | 56 | |
57 | 57 | static inline |
58 | 58 | void wrapper_set_current_oom_origin(void) |
65 | 65 | { |
66 | 66 | return; |
67 | 67 | } |
68 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */ | |
68 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0)) */ | |
69 | 69 | #endif /* _LTTNG_WRAPPER_MM_H */ |
9 | 9 | #ifndef _LTTNG_WRAPPER_NAMESPACE_H |
10 | 10 | #define _LTTNG_WRAPPER_NAMESPACE_H |
11 | 11 | |
12 | #include <linux/version.h> | |
12 | #include <lttng-kernel-version.h> | |
13 | 13 | |
14 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)) | |
14 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0)) | |
15 | 15 | #define lttng_ns_inum ns.inum |
16 | 16 | #else |
17 | 17 | #define lttng_ns_inum proc_inum |
18 | 18 | #endif |
19 | 19 | |
20 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) | |
20 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,5,0)) | |
21 | 21 | #define lttng_user_ns_parent parent |
22 | 22 | #else |
23 | 23 | #define lttng_user_ns_parent creator->user_ns |
7 | 7 | #ifndef _LTTNG_WRAPPER_OBJTOOL_H |
8 | 8 | #define _LTTNG_WRAPPER_OBJTOOL_H |
9 | 9 | |
10 | #include <linux/version.h> | |
10 | #include <lttng-kernel-version.h> | |
11 | 11 | |
12 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0)) | |
12 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,10,0)) | |
13 | 13 | #include <linux/objtool.h> |
14 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)) | |
14 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,6,0)) | |
15 | 15 | #include <linux/frame.h> |
16 | 16 | #endif |
17 | 17 | |
18 | 18 | |
19 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)) | |
19 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,6,0)) | |
20 | 20 | |
21 | 21 | #define LTTNG_STACK_FRAME_NON_STANDARD(func) \ |
22 | 22 | STACK_FRAME_NON_STANDARD(func) |
11 | 11 | #include <lttng-kernel-version.h> |
12 | 12 | |
13 | 13 | #if (defined(CONFIG_KALLSYMS) \ |
14 | && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,2) \ | |
14 | && (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,2) \ | |
15 | 15 | || LTTNG_KERNEL_RANGE(3,14,36, 3,15,0) \ |
16 | 16 | || LTTNG_KERNEL_RANGE(3,18,10, 3,19,0) \ |
17 | 17 | || LTTNG_DEBIAN_KERNEL_RANGE(3,16,7,9,0,0, 3,17,0,0,0,0) \ |
18 | 18 | * the get_pageblock_migratetype() macro uses it. |
19 | 19 | */ |
20 | 20 | #if (defined(CONFIG_KALLSYMS) \ |
21 | && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,2) \ | |
21 | && (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,2) \ | |
22 | 22 | || LTTNG_KERNEL_RANGE(3,14,36, 3,15,0) \ |
23 | 23 | || LTTNG_KERNEL_RANGE(3,18,10, 3,19,0) \ |
24 | 24 | || LTTNG_DEBIAN_KERNEL_RANGE(3,16,7,9,0,0, 3,17,0,0,0,0) \ |
9 | 9 | #ifndef _LTTNG_WRAPPER_PERCPU_DEFS_H |
10 | 10 | #define _LTTNG_WRAPPER_PERCPU_DEFS_H |
11 | 11 | |
12 | #include <linux/version.h> | |
12 | #include <lttng-kernel-version.h> | |
13 | 13 | |
14 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) | |
14 | #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0) | |
15 | 15 | |
16 | 16 | #include <linux/percpu-defs.h> |
17 | 17 | |
18 | 18 | #define lttng_this_cpu_ptr(ptr) this_cpu_ptr(ptr) |
19 | 19 | |
20 | #else /* #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) */ | |
20 | #else /* #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0) */ | |
21 | 21 | |
22 | 22 | #include <linux/percpu.h> |
23 | 23 | |
24 | 24 | #define lttng_this_cpu_ptr(ptr) (&__get_cpu_var(*(ptr))) |
25 | 25 | |
26 | #endif /* #else #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) */ | |
26 | #endif /* #else #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,0) */ | |
27 | 27 | |
28 | 28 | #endif /* _LTTNG_WRAPPER_PERCPU_DEFS_H */ |
11 | 11 | |
12 | 12 | #ifdef CONFIG_PERF_EVENTS |
13 | 13 | |
14 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) | |
14 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0)) | |
15 | 15 | static inline struct perf_event * |
16 | 16 | wrapper_perf_event_create_kernel_counter(struct perf_event_attr *attr, |
17 | 17 | int cpu, |
20 | 20 | { |
21 | 21 | return perf_event_create_kernel_counter(attr, cpu, task, callback, NULL); |
22 | 22 | } |
23 | #else /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) */ | |
23 | #else /* (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0)) */ | |
24 | 24 | static inline struct perf_event * |
25 | 25 | wrapper_perf_event_create_kernel_counter(struct perf_event_attr *attr, |
26 | 26 | int cpu, |
29 | 29 | { |
30 | 30 | return perf_event_create_kernel_counter(attr, cpu, task, callback); |
31 | 31 | } |
32 | #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) */ | |
32 | #endif /* (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0)) */ | |
33 | 33 | |
34 | 34 | #endif /* CONFIG_PERF_EVENTS */ |
35 | 35 |
9 | 9 | #ifndef _LTTNG_WRAPPER_RCU_H |
10 | 10 | #define _LTTNG_WRAPPER_RCU_H |
11 | 11 | |
12 | #include <linux/version.h> | |
12 | #include <lttng-kernel-version.h> | |
13 | 13 | #include <linux/rculist.h> |
14 | 14 | #include <linux/rcupdate.h> |
15 | 15 | #include <wrapper/list.h> |
11 | 11 | #include <lttng-kernel-version.h> |
12 | 12 | |
13 | 13 | #if (defined(CONFIG_KALLSYMS) \ |
14 | && (LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0))) | |
14 | && (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(4,2,0))) | |
15 | 15 | |
16 | 16 | #include <linux/kallsyms.h> |
17 | 17 | #include <linux/fs.h> |
14 | 14 | |
15 | 15 | #define LTTNG_SYSCALL_NR_ARGS 6 |
16 | 16 | |
17 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0)) | |
17 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,1,0)) | |
18 | 18 | |
19 | 19 | #define lttng_syscall_get_arguments(task, regs, args) \ |
20 | 20 | syscall_get_arguments(task, regs, args) |
21 | 21 | |
22 | #else /* LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0) */ | |
22 | #else /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,1,0) */ | |
23 | 23 | |
24 | 24 | static inline |
25 | 25 | void lttng_syscall_get_arguments(struct task_struct *task, |
28 | 28 | syscall_get_arguments(task, regs, 0, LTTNG_SYSCALL_NR_ARGS, args); |
29 | 29 | } |
30 | 30 | |
31 | #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0) */ | |
31 | #endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,1,0) */ | |
32 | 32 | |
33 | 33 | #endif /* _LTTNG_WRAPPER_SYSCALL_H */ |
8 | 8 | #ifndef _LTTNG_WRAPPER_TIME_H |
9 | 9 | #define _LTTNG_WRAPPER_TIME_H |
10 | 10 | |
11 | #include <linux/version.h> | |
11 | #include <lttng-kernel-version.h> | |
12 | 12 | |
13 | 13 | /* |
14 | 14 | * Use 64bit timespec on kernels that have it, this makes 32bit arch |
15 | 15 | * y2038 compliant. |
16 | 16 | */ |
17 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)) | |
17 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,17,0)) | |
18 | 18 | # define LTTNG_KERNEL_HAS_TIMESPEC64 |
19 | 19 | #endif |
20 | 20 |
9 | 9 | #ifndef _LTTNG_WRAPPER_TIMER_H |
10 | 10 | #define _LTTNG_WRAPPER_TIMER_H |
11 | 11 | |
12 | #include <linux/version.h> | |
12 | #include <lttng-kernel-version.h> | |
13 | 13 | #include <linux/timer.h> |
14 | 14 | #include <lttng-kernel-version.h> |
15 | 15 | |
25 | 25 | */ |
26 | 26 | |
27 | 27 | |
28 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) | |
28 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0)) | |
29 | 29 | |
30 | 30 | #define LTTNG_TIMER_PINNED TIMER_PINNED |
31 | 31 | #define LTTNG_TIMER_FUNC_ARG_TYPE struct timer_list * |
40 | 40 | timer_setup(timer, callback, flags) |
41 | 41 | |
42 | 42 | |
43 | #else /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0) */ | |
43 | #else /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0) */ | |
44 | 44 | |
45 | 45 | |
46 | 46 | # if (LTTNG_RT_VERSION_CODE >= LTTNG_RT_KERNEL_VERSION(4,6,4,8) \ |
47 | || LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) | |
47 | || LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,8,0)) | |
48 | 48 | |
49 | 49 | #define lttng_init_timer_pinned(timer) \ |
50 | 50 | init_timer_pinned(timer) |
83 | 83 | timer->data = (unsigned long)data; |
84 | 84 | } |
85 | 85 | |
86 | #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0) */ | |
86 | #endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0) */ | |
87 | 87 | |
88 | 88 | #endif /* _LTTNG_WRAPPER_TIMER_H */ |
19 | 19 | #include <linux/time.h> |
20 | 20 | #include <linux/hrtimer.h> |
21 | 21 | #include <linux/percpu.h> |
22 | #include <linux/version.h> | |
22 | #include <lttng-kernel-version.h> | |
23 | 23 | #include <asm/local.h> |
24 | 24 | #include <lttng-kernel-version.h> |
25 | 25 | #include <lttng-clock.h> |
50 | 50 | * this feature on 64-bit architectures. |
51 | 51 | */ |
52 | 52 | |
53 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) \ | |
53 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,17,0) \ | |
54 | 54 | && BITS_PER_LONG == 64 \ |
55 | 55 | && !defined(LTTNG_CLOCK_NMI_SAFE_BROKEN)) |
56 | 56 | #define LTTNG_USE_NMI_SAFE_CLOCK |
9 | 9 | #ifndef _LTTNG_WRAPPER_TRACEPOINT_H |
10 | 10 | #define _LTTNG_WRAPPER_TRACEPOINT_H |
11 | 11 | |
12 | #include <linux/version.h> | |
12 | #include <lttng-kernel-version.h> | |
13 | 13 | #include <linux/tracepoint.h> |
14 | 14 | #include <linux/module.h> |
15 | 15 | |
16 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0)) | |
16 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,10,0)) | |
17 | 17 | #define LTTNG_DEFINE_TRACE(name, proto, args) \ |
18 | 18 | DEFINE_TRACE(name, PARAMS(proto), PARAMS(args)) |
19 | 19 | #else |
28 | 28 | |
29 | 29 | #endif /* HAVE_KABI_2635_TRACEPOINT */ |
30 | 30 | |
31 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) | |
31 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,15,0)) | |
32 | 32 | |
33 | 33 | #include <lttng-tracepoint.h> |
34 | 34 | |
35 | 35 | #define lttng_wrapper_tracepoint_probe_register lttng_tracepoint_probe_register |
36 | 36 | #define lttng_wrapper_tracepoint_probe_unregister lttng_tracepoint_probe_unregister |
37 | 37 | |
38 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */ | |
38 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,15,0)) */ | |
39 | 39 | |
40 | 40 | #define lttng_wrapper_tracepoint_probe_register kabi_2635_tracepoint_probe_register |
41 | 41 | #define lttng_wrapper_tracepoint_probe_unregister kabi_2635_tracepoint_probe_unregister |
51 | 51 | { |
52 | 52 | } |
53 | 53 | |
54 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */ | |
54 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,15,0)) */ | |
55 | 55 | |
56 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) && defined(CONFIG_MODULE_SIG)) | |
56 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,15,0) && defined(CONFIG_MODULE_SIG)) | |
57 | 57 | |
58 | 58 | #include <linux/kallsyms.h> |
59 | 59 | #include <wrapper/kallsyms.h> |
86 | 86 | * } |
87 | 87 | */ |
88 | 88 | |
89 | #endif /* #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) && defined(CONFIG_MODULE_SIG)) */ | |
89 | #endif /* #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,15,0) && defined(CONFIG_MODULE_SIG)) */ | |
90 | 90 | |
91 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) && defined(CONFIG_MODULE_SIG) && defined(MODULE)) | |
91 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,15,0) && defined(CONFIG_MODULE_SIG) && defined(MODULE)) | |
92 | 92 | |
93 | 93 | static inline |
94 | 94 | int wrapper_lttng_fixup_sig(struct module *mod) |
109 | 109 | return ret; |
110 | 110 | } |
111 | 111 | |
112 | #else /* #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) && defined(CONFIG_MODULE_SIG) && defined(MODULE)) */ | |
112 | #else /* #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,15,0) && defined(CONFIG_MODULE_SIG) && defined(MODULE)) */ | |
113 | 113 | |
114 | 114 | static inline |
115 | 115 | int wrapper_lttng_fixup_sig(struct module *mod) |
117 | 117 | return 0; |
118 | 118 | } |
119 | 119 | |
120 | #endif /* #else #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) && defined(CONFIG_MODULE_SIG) && defined(MODULE)) */ | |
120 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,15,0) && defined(CONFIG_MODULE_SIG) && defined(MODULE)) */ | |
121 | 121 | |
122 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)) | |
122 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,19,0)) | |
123 | 123 | static inline struct tracepoint *lttng_tracepoint_ptr_deref(tracepoint_ptr_t *p) |
124 | 124 | { |
125 | 125 | return tracepoint_ptr_deref(p); |
126 | 126 | } |
127 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)) */ | |
127 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,19,0)) */ | |
128 | 128 | static inline struct tracepoint *lttng_tracepoint_ptr_deref(struct tracepoint * const *p) |
129 | 129 | { |
130 | 130 | return *p; |
131 | 131 | } |
132 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)) */ | |
132 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,19,0)) */ | |
133 | 133 | |
134 | 134 | #endif /* _LTTNG_WRAPPER_TRACEPOINT_H */ |
12 | 12 | #include <linux/uaccess.h> |
13 | 13 | #include <lttng-kernel-version.h> |
14 | 14 | |
15 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) || \ | |
15 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,0,0) || \ | |
16 | 16 | LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0)) |
17 | 17 | |
18 | 18 | #define VERIFY_READ 0 |
19 | 19 | #define VERIFY_WRITE 1 |
20 | 20 | #define lttng_access_ok(type, addr, size) access_ok(addr, size) |
21 | 21 | |
22 | #else /* LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) */ | |
22 | #else /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,0,0) */ | |
23 | 23 | |
24 | 24 | #define lttng_access_ok(type, addr, size) access_ok(type, addr, size) |
25 | 25 | |
26 | #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) */ | |
26 | #endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,0,0) */ | |
27 | 27 | |
28 | 28 | #endif /* _LTTNG_WRAPPER_UACCESS_H */ |
13 | 13 | #ifndef _LTTNG_WRAPPER_UPROBES_H |
14 | 14 | #define _LTTNG_WRAPPER_UPROBES_H |
15 | 15 | |
16 | #include <linux/version.h> | |
16 | #include <lttng-kernel-version.h> | |
17 | 17 | |
18 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) | |
18 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,5,0)) | |
19 | 19 | #include <linux/uprobes.h> |
20 | 20 | |
21 | 21 | /* Use kallsym lookup for version before 3.9. */ |
22 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) | |
22 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) | |
23 | 23 | |
24 | 24 | static inline |
25 | 25 | int wrapper_uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc) |
8 | 8 | #ifndef _LTTNG_WRAPPER_USER_NAMESPACE_H |
9 | 9 | #define _LTTNG_WRAPPER_USER_NAMESPACE_H |
10 | 10 | |
11 | #include <linux/version.h> | |
11 | #include <lttng-kernel-version.h> | |
12 | 12 | #include <linux/user_namespace.h> |
13 | 13 | |
14 | 14 | |
15 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0) | |
15 | #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3, 5, 0) | |
16 | 16 | |
17 | 17 | #define lttng_current_xxuid(xxx) \ |
18 | 18 | (from_kuid_munged(&init_user_ns, current_##xxx())) |
7 | 7 | #ifndef _LTTNG_WRAPPER_UUID_H |
8 | 8 | #define _LTTNG_WRAPPER_UUID_H |
9 | 9 | |
10 | #include <linux/version.h> | |
10 | #include <lttng-kernel-version.h> | |
11 | 11 | #include <linux/uuid.h> |
12 | 12 | |
13 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) | |
13 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,7,0)) | |
14 | 14 | static inline |
15 | 15 | void lttng_guid_gen(guid_t *u) |
16 | 16 | { |
17 | 17 | return guid_gen(u); |
18 | 18 | } |
19 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */ | |
19 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,7,0)) */ | |
20 | 20 | |
21 | 21 | typedef uuid_le guid_t; |
22 | 22 | |
25 | 25 | { |
26 | 26 | return uuid_le_gen(u); |
27 | 27 | } |
28 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */ | |
28 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,7,0)) */ | |
29 | 29 | |
30 | 30 | #endif /* _LTTNG_WRAPPER_UUID_H */ |
11 | 11 | #ifndef _LTTNG_WRAPPER_VMALLOC_H |
12 | 12 | #define _LTTNG_WRAPPER_VMALLOC_H |
13 | 13 | |
14 | #include <linux/version.h> | |
14 | #include <lttng-kernel-version.h> | |
15 | 15 | #include <linux/vmalloc.h> |
16 | 16 | #include <linux/mm.h> |
17 | 17 | |
21 | 21 | #include <wrapper/kallsyms.h> |
22 | 22 | #include <lttng-kernel-version.h> |
23 | 23 | |
24 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0)) | |
24 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,8,0)) | |
25 | 25 | |
26 | 26 | /* |
27 | 27 | * wrapper_vmalloc_sync_mappings was removed in v5.8, the vmalloc mappings |
31 | 31 | void wrapper_vmalloc_sync_mappings(void) |
32 | 32 | {} |
33 | 33 | |
34 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) \ | |
34 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0) \ | |
35 | 35 | || LTTNG_KERNEL_RANGE(5,5,12, 5,6,0) \ |
36 | 36 | || LTTNG_KERNEL_RANGE(5,4,28, 5,5,0) \ |
37 | 37 | || LTTNG_KERNEL_RANGE(5,2,37, 5,3,0) \ |
76 | 76 | vmalloc_sync_mappings(); |
77 | 77 | } |
78 | 78 | |
79 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) */ | |
79 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0)) */ | |
80 | 80 | |
81 | 81 | /* |
82 | 82 | * Map vmalloc_sync_mappings to vmalloc_sync_all() on kernels before 5.6. |
114 | 114 | vmalloc_sync_all(); |
115 | 115 | } |
116 | 116 | |
117 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) */ | |
117 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0)) */ | |
118 | 118 | |
119 | 119 | #else /* CONFIG_KALLSYMS */ |
120 | 120 | |
121 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0)) | |
121 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,8,0)) | |
122 | 122 | |
123 | 123 | /* |
124 | 124 | * wrapper_vmalloc_sync_mappings was removed in v5.8, the vmalloc mappings |
128 | 128 | void wrapper_vmalloc_sync_mappings(void) |
129 | 129 | {} |
130 | 130 | |
131 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) \ | |
131 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0) \ | |
132 | 132 | || LTTNG_KERNEL_RANGE(5,5,12, 5,6,0) \ |
133 | 133 | || LTTNG_KERNEL_RANGE(5,4,28, 5,5,0) \ |
134 | 134 | || LTTNG_KERNEL_RANGE(5,2,37, 5,3,0) \ |
146 | 146 | return vmalloc_sync_mappings(); |
147 | 147 | } |
148 | 148 | |
149 | #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) */ | |
149 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0)) */ | |
150 | 150 | |
151 | 151 | static inline |
152 | 152 | void wrapper_vmalloc_sync_mappings(void) |
154 | 154 | return vmalloc_sync_all(); |
155 | 155 | } |
156 | 156 | |
157 | #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) */ | |
158 | ||
159 | #endif | |
160 | ||
161 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) | |
157 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0)) */ | |
158 | ||
159 | #endif | |
160 | ||
161 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,12,0)) | |
162 | 162 | static inline |
163 | 163 | void *lttng_kvmalloc_node(unsigned long size, gfp_t flags, int node) |
164 | 164 | { |
211 | 211 | printk_once(KERN_WARNING "Please rebuild your kernel with CONFIG_KALLSYMS enabled.\n"); |
212 | 212 | } |
213 | 213 | |
214 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) | |
214 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,0,0)) | |
215 | 215 | |
216 | 216 | /* |
217 | 217 | * kallsyms wrapper of __vmalloc_node with a fallback to kmalloc_node. |
261 | 261 | vm_flags, node, caller); |
262 | 262 | } |
263 | 263 | |
264 | #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) | |
264 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,6,0)) | |
265 | 265 | |
266 | 266 | /* |
267 | 267 | * kallsyms wrapper of __vmalloc_node with a fallback to kmalloc_node. |
309 | 309 | node, caller); |
310 | 310 | } |
311 | 311 | |
312 | #else /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) */ | |
312 | #else /* (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,6,0)) */ | |
313 | 313 | |
314 | 314 | /* |
315 | 315 | * kallsyms wrapper of __vmalloc_node with a fallback to kmalloc_node. |
19 | 19 | |
20 | 20 | |
21 | 21 | |
22 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) | |
22 | #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,2,0) | |
23 | 23 | |
24 | 24 | static struct wb_domain *global_wb_domain_sym; |
25 | 25 | |
50 | 50 | return global_wb_domain.dirty_limit; |
51 | 51 | } |
52 | 52 | |
53 | #elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) | |
53 | #elif LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0) | |
54 | 54 | |
55 | 55 | static unsigned long *global_dirty_limit_sym; |
56 | 56 | |
87 | 87 | |
88 | 88 | #include <linux/writeback.h> |
89 | 89 | |
90 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) | |
90 | #if LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0) | |
91 | 91 | static inline |
92 | 92 | unsigned long wrapper_global_dirty_limit(void) |
93 | 93 | { |