From: Mathieu Desnoyers Date: Wed, 6 May 2020 17:44:57 +0000 (-0400) Subject: Cleanup: Move lttng-modules instrumentation headers X-Git-Tag: v2.13.0-rc1~222 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4f47ccf08dfac3d5db7553eb8b40bdab19764727;p=lttng-modules.git Cleanup: Move lttng-modules instrumentation headers The directory hierarchy "instrumentation/events/lttng-module/" only exists for historical reasons and is not needed anymore. Move all its contents into "instrumentation/events/". Signed-off-by: Mathieu Desnoyers --- diff --git a/include/instrumentation/events/9p.h b/include/instrumentation/events/9p.h new file mode 100644 index 00000000..0123bbfc --- /dev/null +++ b/include/instrumentation/events/9p.h @@ -0,0 +1,57 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM 9p + +#if !defined(LTTNG_TRACE_9P_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_9P_H + +#include +#include + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) +LTTNG_TRACEPOINT_EVENT(9p_client_req, + + TP_PROTO(struct p9_client *clnt, int8_t type, int tag), + + TP_ARGS(clnt, type, tag), + + TP_FIELDS( + ctf_integer_hex(void *, clnt, clnt) + ctf_integer(u8, type, type) + ctf_integer(u32, tag, tag) + ) +) + +LTTNG_TRACEPOINT_EVENT(9p_client_res, + + TP_PROTO(struct p9_client *clnt, int8_t type, int tag, int err), + + TP_ARGS(clnt, type, tag, err), + + TP_FIELDS( + ctf_integer_hex(void *, clnt, clnt) + ctf_integer(u8, type, type) + ctf_integer(u32, tag, tag) + ctf_integer(u32, err, err) + ) +) + +LTTNG_TRACEPOINT_EVENT(9p_protocol_dump, + + TP_PROTO(struct p9_client *clnt, struct p9_fcall *pdu), + + TP_ARGS(clnt, pdu), + + TP_FIELDS( + ctf_integer_hex(void *, clnt, clnt) + ctf_integer(u8, type, pdu->id) + ctf_integer(u16, tag, pdu->tag) + ctf_array(unsigned char, line, pdu->sdata, P9_PROTO_DUMP_SZ) + ) +) +#endif + +#endif /* LTTNG_TRACE_9P_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/README b/include/instrumentation/events/README index fc3cd6e2..b13a30b9 100644 --- a/include/instrumentation/events/README +++ b/include/instrumentation/events/README @@ -1,6 +1,6 @@ * Workflow for updating patches from newer kernel: -Pull the new headers from mainline kernel to lttng-modules/. +Pull the new headers from mainline kernel to this subdirectory. Update those headers to fix the lttng-modules instrumentation style. @@ -10,10 +10,10 @@ Update those headers to fix the lttng-modules instrumentation style. a) instrument the kernel with new trace events headers. If you want that instrumentation distributed, you will have to push those changes into the upstream Linux kernel first, -b) copy those headers into lttng-modules/ directory, +b) copy those headers into this subdirectory, c) look at a diff from other headers between mainline kernel version and - lttng-modules/, and use that as a recipe to alter the new - lttng-modules/ headers. + those in this subdirectory, and use that as a recipe to alter the new + headers copy. d) create a new file in probes/ for the new trace event header you added, e) add it to probes/Makefile, f) build, make modules_install, diff --git a/include/instrumentation/events/arch/x86/exceptions.h b/include/instrumentation/events/arch/x86/exceptions.h new file mode 100644 index 00000000..b322f3e7 --- /dev/null +++ b/include/instrumentation/events/arch/x86/exceptions.h @@ -0,0 +1,53 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#if !defined(LTTNG_TRACE_EXCEPTIONS_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_EXCEPTIONS_H + +#include +#include + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM x86_exceptions + +LTTNG_TRACEPOINT_EVENT_CLASS(x86_exceptions_class, + + TP_PROTO(unsigned long address, struct pt_regs *regs, + unsigned long error_code), + + TP_ARGS(address, regs, error_code), + + TP_FIELDS( + ctf_integer_hex(unsigned long, address, address) + ctf_integer_hex(unsigned long, ip, regs->ip) + /* + * Note: we cast error_code from unsigned long + * to unsigned char to save space in the trace. + * Currently, only 5 low bits are used. Should be made + * larger if error codes are added to the kernel. + */ + ctf_integer_hex(unsigned char, error_code, error_code) + ) +) + +#define LTTNG_EXCEPTIONS_TRACEPOINT_EVENT_INSTANCE_MAP(name, map) \ +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(x86_exceptions_class, \ + name, \ + map, \ + TP_PROTO(unsigned long address, struct pt_regs *regs, \ + unsigned long error_code), \ + TP_ARGS(address, regs, error_code) \ +) + +LTTNG_EXCEPTIONS_TRACEPOINT_EVENT_INSTANCE_MAP(page_fault_user, + x86_exceptions_page_fault_user) +LTTNG_EXCEPTIONS_TRACEPOINT_EVENT_INSTANCE_MAP(page_fault_kernel, + x86_exceptions_page_fault_kernel) + +#endif /* LTTNG_TRACE_EXCEPTIONS_H */ + +#undef TRACE_INCLUDE_PATH +#define TRACE_INCLUDE_PATH instrumentation/events/arch/x86 +#undef TRACE_INCLUDE_FILE +#define TRACE_INCLUDE_FILE exceptions + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/arch/x86/irq_vectors.h b/include/instrumentation/events/arch/x86/irq_vectors.h new file mode 100644 index 00000000..dc0e002b --- /dev/null +++ b/include/instrumentation/events/arch/x86/irq_vectors.h @@ -0,0 +1,116 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#if !defined(LTTNG_TRACE_IRQ_VECTORS_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_IRQ_VECTORS_H + +#include +#include + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM x86_irq_vectors + +LTTNG_TRACEPOINT_EVENT_CLASS(x86_irq_vectors_vector_class, + TP_PROTO(int vector), + TP_ARGS(vector), + + TP_FIELDS( + ctf_integer(int, vector, vector) + ) +) + +#define LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(name, map) \ +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(x86_irq_vectors_vector_class, \ + name##_entry, \ + map##_entry, \ + TP_PROTO(int vector), \ + TP_ARGS(vector) \ +) \ +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(x86_irq_vectors_vector_class, \ + name##_exit, \ + map##_exit, \ + TP_PROTO(int vector), \ + TP_ARGS(vector) \ +) + +/* + * local_timer - called when entering/exiting a local timer interrupt + * vector handler + */ +LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(local_timer, + x86_irq_vectors_local_timer) + +/* + * reschedule - called when entering/exiting a reschedule vector handler + */ +LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(reschedule, + x86_irq_vectors_reschedule) + +/* + * spurious_apic - called when entering/exiting a spurious apic vector handler + */ +LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(spurious_apic, + x86_irq_vectors_spurious_apic) + +/* + * error_apic - called when entering/exiting an error apic vector handler + */ +LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(error_apic, + x86_irq_vectors_error_apic) + +/* + * x86_platform_ipi - called when entering/exiting a x86 platform ipi interrupt + * vector handler + */ +LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(x86_platform_ipi, + x86_irq_vectors_ipi) + +/* + * irq_work - called when entering/exiting a irq work interrupt + * vector handler + */ +LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(irq_work, + x86_irq_vectors_irq_work) + +/* + * call_function - called when entering/exiting a call function interrupt + * vector handler + */ +LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(call_function, + x86_irq_vectors_call_function) + +/* + * call_function_single - called when entering/exiting a call function + * single interrupt vector handler + */ +LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(call_function_single, + x86_irq_vectors_call_function_single) + +/* + * threshold_apic - called when entering/exiting a threshold apic interrupt + * vector handler + */ +LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(threshold_apic, + x86_irq_vectors_threshold_apic) + +/* + * deferred_error_apic - called when entering/exiting a deferred apic interrupt + * vector handler + */ +LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(deferred_error_apic, + x86_irq_vectors_deferred_error_apic) + +/* + * thermal_apic - called when entering/exiting a thermal apic interrupt + * vector handler + */ +LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(thermal_apic, + x86_irq_vectors_thermal_apic) + +#endif /* LTTNG_TRACE_IRQ_VECTORS_H */ + +#undef TRACE_INCLUDE_PATH +#define TRACE_INCLUDE_PATH instrumentation/events/arch/x86 +#undef TRACE_INCLUDE_FILE +#define TRACE_INCLUDE_FILE irq_vectors + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/arch/x86/kvm/mmutrace.h b/include/instrumentation/events/arch/x86/kvm/mmutrace.h new file mode 100644 index 00000000..05dd3d6d --- /dev/null +++ b/include/instrumentation/events/arch/x86/kvm/mmutrace.h @@ -0,0 +1,274 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#if !defined(LTTNG_TRACE_KVM_MMU_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_KVM_MMU_H + +#include +#include + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) +#include +#else /* if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ +#include +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM kvm_mmu + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0) || \ + LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0)) + +#define LTTNG_KVM_MMU_PAGE_FIELDS \ + ctf_integer(__u64, gfn, (sp)->gfn) \ + ctf_integer(__u32, role, (sp)->role.word) \ + ctf_integer(__u32, root_count, (sp)->root_count) \ + ctf_integer(bool, unsync, (sp)->unsync) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) + +#define LTTNG_KVM_MMU_PAGE_FIELDS \ + ctf_integer(unsigned long, mmu_valid_gen, (sp)->mmu_valid_gen) \ + ctf_integer(__u64, gfn, (sp)->gfn) \ + ctf_integer(__u32, role, (sp)->role.word) \ + ctf_integer(__u32, root_count, (sp)->root_count) \ + ctf_integer(bool, unsync, (sp)->unsync) + +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) */ + +#define LTTNG_KVM_MMU_PAGE_FIELDS \ + ctf_integer(__u64, gfn, (sp)->gfn) \ + ctf_integer(__u32, role, (sp)->role.word) \ + ctf_integer(__u32, root_count, (sp)->root_count) \ + ctf_integer(bool, unsync, (sp)->unsync) + +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) +/* + * A pagetable walk has started + */ +LTTNG_TRACEPOINT_EVENT( + kvm_mmu_pagetable_walk, + TP_PROTO(u64 addr, u32 pferr), + TP_ARGS(addr, pferr), + + TP_FIELDS( + ctf_integer_hex(__u64, addr, addr) + ctf_integer(__u32, pferr, pferr) + ) +) +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) */ +/* + * A pagetable walk has started + */ +LTTNG_TRACEPOINT_EVENT( + kvm_mmu_pagetable_walk, + TP_PROTO(u64 addr, int write_fault, int user_fault, int fetch_fault), + TP_ARGS(addr, write_fault, user_fault, fetch_fault), + + TP_FIELDS( + ctf_integer_hex(__u64, addr, addr) + ctf_integer(__u32, pferr, + (!!write_fault << 1) | (!!user_fault << 2) + | (!!fetch_fault << 4)) + ) +) +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) */ + +/* We just walked a paging element */ +LTTNG_TRACEPOINT_EVENT( + kvm_mmu_paging_element, + TP_PROTO(u64 pte, int level), + TP_ARGS(pte, level), + + TP_FIELDS( + ctf_integer(__u64, pte, pte) + ctf_integer(__u32, level, level) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(kvm_mmu_set_bit_class, + + TP_PROTO(unsigned long table_gfn, unsigned index, unsigned size), + + TP_ARGS(table_gfn, index, size), + + TP_FIELDS( + ctf_integer(__u64, gpa, + ((u64)table_gfn << PAGE_SHIFT) + index * size) + ) +) + +/* We set a pte accessed bit */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_mmu_set_bit_class, kvm_mmu_set_accessed_bit, + + TP_PROTO(unsigned long table_gfn, unsigned index, unsigned size), + + TP_ARGS(table_gfn, index, size) +) + +/* We set a pte dirty bit */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_mmu_set_bit_class, kvm_mmu_set_dirty_bit, + + TP_PROTO(unsigned long table_gfn, unsigned index, unsigned size), + + TP_ARGS(table_gfn, index, size) +) + +LTTNG_TRACEPOINT_EVENT( + kvm_mmu_walker_error, + TP_PROTO(u32 pferr), + TP_ARGS(pferr), + + TP_FIELDS( + ctf_integer(__u32, pferr, pferr) + ) +) + +LTTNG_TRACEPOINT_EVENT( + kvm_mmu_get_page, + TP_PROTO(struct kvm_mmu_page *sp, bool created), + TP_ARGS(sp, created), + + TP_FIELDS( + LTTNG_KVM_MMU_PAGE_FIELDS + ctf_integer(bool, created, created) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(kvm_mmu_page_class, + + TP_PROTO(struct kvm_mmu_page *sp), + TP_ARGS(sp), + + TP_FIELDS( + LTTNG_KVM_MMU_PAGE_FIELDS + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_mmu_page_class, kvm_mmu_sync_page, + TP_PROTO(struct kvm_mmu_page *sp), + + TP_ARGS(sp) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_mmu_page_class, kvm_mmu_unsync_page, + TP_PROTO(struct kvm_mmu_page *sp), + + TP_ARGS(sp) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_mmu_page_class, kvm_mmu_prepare_zap_page, + TP_PROTO(struct kvm_mmu_page *sp), + + TP_ARGS(sp) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) + +LTTNG_TRACEPOINT_EVENT_MAP( + mark_mmio_spte, + + kvm_mmu_mark_mmio_spte, + + TP_PROTO(u64 *sptep, gfn_t gfn, unsigned access, unsigned int gen), + TP_ARGS(sptep, gfn, access, gen), + + TP_FIELDS( + ctf_integer_hex(void *, sptep, sptep) + ctf_integer(gfn_t, gfn, gfn) + ctf_integer(unsigned, access, access) + ctf_integer(unsigned int, gen, gen) + ) +) + +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) */ + +LTTNG_TRACEPOINT_EVENT_MAP( + mark_mmio_spte, + + kvm_mmu_mark_mmio_spte, + + TP_PROTO(u64 *sptep, gfn_t gfn, unsigned access), + TP_ARGS(sptep, gfn, access), + + TP_FIELDS( + ctf_integer_hex(void *, sptep, sptep) + ctf_integer(gfn_t, gfn, gfn) + ctf_integer(unsigned, access, access) + ) +) + +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) */ + +LTTNG_TRACEPOINT_EVENT_MAP( + handle_mmio_page_fault, + + kvm_mmu_handle_mmio_page_fault, + + TP_PROTO(u64 addr, gfn_t gfn, unsigned access), + TP_ARGS(addr, gfn, access), + + TP_FIELDS( + ctf_integer_hex(u64, addr, addr) + ctf_integer(gfn_t, gfn, gfn) + ctf_integer(unsigned, access, access) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) || \ + LTTNG_KERNEL_RANGE(4,19,103, 4,20,0) || \ + LTTNG_KERNEL_RANGE(5,4,19, 5,5,0) || \ + LTTNG_KERNEL_RANGE(5,5,3, 5,6,0) || \ + LTTNG_UBUNTU_KERNEL_RANGE(4,15,18,92, 4,16,0,0) || \ + LTTNG_UBUNTU_KERNEL_RANGE(5,3,18,43, 5,3,18,45) || \ + LTTNG_UBUNTU_KERNEL_RANGE(5,3,18,46, 5,4,0,0)) +LTTNG_TRACEPOINT_EVENT_MAP( + fast_page_fault, + + kvm_mmu_fast_page_fault, + + TP_PROTO(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, u32 error_code, + u64 *sptep, u64 old_spte, bool retry), + TP_ARGS(vcpu, cr2_or_gpa, error_code, sptep, old_spte, retry), + + TP_FIELDS( + ctf_integer(int, vcpu_id, vcpu->vcpu_id) + ctf_integer(gpa_t, cr2_or_gpa, cr2_or_gpa) + ctf_integer(u32, error_code, error_code) + ctf_integer_hex(u64 *, sptep, sptep) + ctf_integer(u64, old_spte, old_spte) + ctf_integer(u64, new_spte, *sptep) + ctf_integer(bool, retry, retry) + ) +) +#else +LTTNG_TRACEPOINT_EVENT_MAP( + fast_page_fault, + + kvm_mmu_fast_page_fault, + + TP_PROTO(struct kvm_vcpu *vcpu, gva_t gva, u32 error_code, + u64 *sptep, u64 old_spte, bool retry), + TP_ARGS(vcpu, gva, error_code, sptep, old_spte, retry), + + TP_FIELDS( + ctf_integer(int, vcpu_id, vcpu->vcpu_id) + ctf_integer(gva_t, gva, gva) + ctf_integer(u32, error_code, error_code) + ctf_integer_hex(u64 *, sptep, sptep) + ctf_integer(u64, old_spte, old_spte) + ctf_integer(u64, new_spte, *sptep) + ctf_integer(bool, retry, retry) + ) +) +#endif + +#endif /* LTTNG_TRACE_KVM_MMU_H */ + +#undef TRACE_INCLUDE_PATH +#define TRACE_INCLUDE_PATH instrumentation/events/arch/x86/kvm +#undef TRACE_INCLUDE_FILE +#define TRACE_INCLUDE_FILE mmutrace + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/arch/x86/kvm/trace.h b/include/instrumentation/events/arch/x86/kvm/trace.h new file mode 100644 index 00000000..4f09e625 --- /dev/null +++ b/include/instrumentation/events/arch/x86/kvm/trace.h @@ -0,0 +1,540 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#if !defined(LTTNG_TRACE_KVM_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_KVM_H + +#include +#include +#include +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) +#include +#endif +#include +#include <../arch/x86/kvm/lapic.h> +#include <../arch/x86/kvm/kvm_cache_regs.h> + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM kvm_x86 + +/* + * Tracepoint for guest mode entry. + */ +LTTNG_TRACEPOINT_EVENT_MAP(kvm_entry, kvm_x86_entry, + TP_PROTO(unsigned int vcpu_id), + TP_ARGS(vcpu_id), + + TP_FIELDS( + ctf_integer(unsigned int, vcpu_id, vcpu_id) + ) +) + +/* + * Tracepoint for hypercall. + */ +LTTNG_TRACEPOINT_EVENT_MAP(kvm_hypercall, kvm_x86_hypercall, + TP_PROTO(unsigned long nr, unsigned long a0, unsigned long a1, + unsigned long a2, unsigned long a3), + TP_ARGS(nr, a0, a1, a2, a3), + + TP_FIELDS( + ctf_integer(unsigned long, nr, nr) + ctf_integer(unsigned long, a0, a0) + ctf_integer(unsigned long, a1, a1) + ctf_integer(unsigned long, a2, a2) + ctf_integer(unsigned long, a3, a3) + ) +) + +/* + * Tracepoint for hypercall. + */ +LTTNG_TRACEPOINT_EVENT_MAP(kvm_hv_hypercall, kvm_x86_hv_hypercall, + TP_PROTO(__u16 code, bool fast, __u16 rep_cnt, __u16 rep_idx, + __u64 ingpa, __u64 outgpa), + TP_ARGS(code, fast, rep_cnt, rep_idx, ingpa, outgpa), + + TP_FIELDS( + ctf_integer(__u16, rep_cnt, rep_cnt) + ctf_integer(__u16, rep_idx, rep_idx) + ctf_integer(__u64, ingpa, ingpa) + ctf_integer(__u64, outgpa, outgpa) + ctf_integer(__u16, code, code) + ctf_integer(bool, fast, fast) + ) +) + +/* + * Tracepoint for PIO. + */ +LTTNG_TRACEPOINT_EVENT_MAP(kvm_pio, kvm_x86_pio, + TP_PROTO(unsigned int rw, unsigned int port, unsigned int size, + unsigned int count), + TP_ARGS(rw, port, size, count), + + TP_FIELDS( + ctf_integer(unsigned int, rw, rw) + ctf_integer(unsigned int, port, port) + ctf_integer(unsigned int, size, size) + ctf_integer(unsigned int, count, count) + ) +) + +/* + * Tracepoint for cpuid. + */ +LTTNG_TRACEPOINT_EVENT_MAP(kvm_cpuid, kvm_x86_cpuid, + TP_PROTO(unsigned int function, unsigned long rax, unsigned long rbx, + unsigned long rcx, unsigned long rdx), + TP_ARGS(function, rax, rbx, rcx, rdx), + + TP_FIELDS( + ctf_integer(unsigned int, function, function) + ctf_integer(unsigned long, rax, rax) + ctf_integer(unsigned long, rbx, rbx) + ctf_integer(unsigned long, rcx, rcx) + ctf_integer(unsigned long, rdx, rdx) + ) +) + +/* + * Tracepoint for apic access. + */ +LTTNG_TRACEPOINT_EVENT_MAP(kvm_apic, kvm_x86_apic, + TP_PROTO(unsigned int rw, unsigned int reg, unsigned int val), + TP_ARGS(rw, reg, val), + + TP_FIELDS( + ctf_integer(unsigned int, rw, rw) + ctf_integer(unsigned int, reg, reg) + ctf_integer(unsigned int, val, val) + ) +) + +#define trace_kvm_apic_read(reg, val) trace_kvm_apic(0, reg, val) +#define trace_kvm_apic_write(reg, val) trace_kvm_apic(1, reg, val) + +/* + * Tracepoint for kvm guest exit: + */ +LTTNG_TRACEPOINT_EVENT_CODE_MAP(kvm_exit, kvm_x86_exit, + TP_PROTO(unsigned int exit_reason, struct kvm_vcpu *vcpu, u32 isa), + TP_ARGS(exit_reason, vcpu, isa), + + TP_locvar( + u64 info1, info2; + ), + + TP_code_pre( +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) + kvm_x86_ops.get_exit_info(vcpu, &tp_locvar->info1, + &tp_locvar->info2); +#else + kvm_x86_ops->get_exit_info(vcpu, &tp_locvar->info1, + &tp_locvar->info2); +#endif + ), + + TP_FIELDS( + ctf_integer(unsigned int, exit_reason, exit_reason) + ctf_integer(unsigned long, guest_rip, kvm_rip_read(vcpu)) + ctf_integer(u32, isa, isa) + ctf_integer(u64, info1, tp_locvar->info1) + ctf_integer(u64, info2, tp_locvar->info2) + ), + + TP_code_post() +) + +/* + * Tracepoint for kvm interrupt injection: + */ +LTTNG_TRACEPOINT_EVENT_MAP(kvm_inj_virq, kvm_x86_inj_virq, + TP_PROTO(unsigned int irq), + TP_ARGS(irq), + + TP_FIELDS( + ctf_integer(unsigned int, irq, irq) + ) +) + +/* + * Tracepoint for kvm interrupt injection: + */ +LTTNG_TRACEPOINT_EVENT_MAP(kvm_inj_exception, kvm_x86_inj_exception, + TP_PROTO(unsigned exception, bool has_error, unsigned error_code), + TP_ARGS(exception, has_error, error_code), + + TP_FIELDS( + ctf_integer(u8, exception, exception) + ctf_integer(u8, has_error, has_error) + ctf_integer(u32, error_code, error_code) + ) +) + +/* + * Tracepoint for page fault. + */ +LTTNG_TRACEPOINT_EVENT_MAP(kvm_page_fault, kvm_x86_page_fault, + TP_PROTO(unsigned long fault_address, unsigned int error_code), + TP_ARGS(fault_address, error_code), + + TP_FIELDS( + ctf_integer_hex(unsigned long, fault_address, fault_address) + ctf_integer(unsigned int, error_code, error_code) + ) +) + +/* + * Tracepoint for guest MSR access. + */ +LTTNG_TRACEPOINT_EVENT_MAP(kvm_msr, kvm_x86_msr, + TP_PROTO(unsigned write, u32 ecx, u64 data, bool exception), + TP_ARGS(write, ecx, data, exception), + + TP_FIELDS( + ctf_integer(unsigned, write, write) + ctf_integer(u32, ecx, ecx) + ctf_integer(u64, data, data) + ctf_integer(u8, exception, exception) + ) +) + +#define trace_kvm_msr_read(ecx, data) trace_kvm_msr(0, ecx, data, false) +#define trace_kvm_msr_write(ecx, data) trace_kvm_msr(1, ecx, data, false) +#define trace_kvm_msr_read_ex(ecx) trace_kvm_msr(0, ecx, 0, true) +#define trace_kvm_msr_write_ex(ecx, data) trace_kvm_msr(1, ecx, data, true) + +/* + * Tracepoint for guest CR access. + */ +LTTNG_TRACEPOINT_EVENT_MAP(kvm_cr, kvm_x86_cr, + TP_PROTO(unsigned int rw, unsigned int cr, unsigned long val), + TP_ARGS(rw, cr, val), + + TP_FIELDS( + ctf_integer(unsigned int, rw, rw) + ctf_integer(unsigned int, cr, cr) + ctf_integer(unsigned long, val, val) + ) +) + +#define trace_kvm_cr_read(cr, val) trace_kvm_cr(0, cr, val) +#define trace_kvm_cr_write(cr, val) trace_kvm_cr(1, cr, val) + +LTTNG_TRACEPOINT_EVENT_MAP(kvm_pic_set_irq, kvm_x86_pic_set_irq, + TP_PROTO(__u8 chip, __u8 pin, __u8 elcr, __u8 imr, bool coalesced), + TP_ARGS(chip, pin, elcr, imr, coalesced), + + TP_FIELDS( + ctf_integer(__u8, chip, chip) + ctf_integer(__u8, pin, pin) + ctf_integer(__u8, elcr, elcr) + ctf_integer(__u8, imr, imr) + ctf_integer(bool, coalesced, coalesced) + ) +) + +LTTNG_TRACEPOINT_EVENT_MAP(kvm_apic_ipi, kvm_x86_apic_ipi, + TP_PROTO(__u32 icr_low, __u32 dest_id), + TP_ARGS(icr_low, dest_id), + + TP_FIELDS( + ctf_integer(__u32, icr_low, icr_low) + ctf_integer(__u32, dest_id, dest_id) + ) +) + +LTTNG_TRACEPOINT_EVENT_MAP(kvm_apic_accept_irq, kvm_x86_apic_accept_irq, + TP_PROTO(__u32 apicid, __u16 dm, __u8 tm, __u8 vec, bool coalesced), + TP_ARGS(apicid, dm, tm, vec, coalesced), + + TP_FIELDS( + ctf_integer(__u32, apicid, apicid) + ctf_integer(__u16, dm, dm) + ctf_integer(__u8, tm, tm) + ctf_integer(__u8, vec, vec) + ctf_integer(bool, coalesced, coalesced) + ) +) + +LTTNG_TRACEPOINT_EVENT_MAP(kvm_eoi, kvm_x86_eoi, + TP_PROTO(struct kvm_lapic *apic, int vector), + TP_ARGS(apic, vector), + + TP_FIELDS( + ctf_integer(__u32, apicid, apic->vcpu->vcpu_id) + ctf_integer(int, vector, vector) + ) +) + +LTTNG_TRACEPOINT_EVENT_MAP(kvm_pv_eoi, kvm_x86_pv_eoi, + TP_PROTO(struct kvm_lapic *apic, int vector), + TP_ARGS(apic, vector), + + TP_FIELDS( + ctf_integer(__u32, apicid, apic->vcpu->vcpu_id) + ctf_integer(int, vector, vector) + ) +) + +/* + * Tracepoint for nested VMRUN + */ +LTTNG_TRACEPOINT_EVENT_MAP(kvm_nested_vmrun, kvm_x86_nested_vmrun, + TP_PROTO(__u64 rip, __u64 vmcb, __u64 nested_rip, __u32 int_ctl, + __u32 event_inj, bool npt), + TP_ARGS(rip, vmcb, nested_rip, int_ctl, event_inj, npt), + + TP_FIELDS( + ctf_integer(__u64, rip, rip) + ctf_integer(__u64, vmcb, vmcb) + ctf_integer(__u64, nested_rip, nested_rip) + ctf_integer(__u32, int_ctl, int_ctl) + ctf_integer(__u32, event_inj, event_inj) + ctf_integer(bool, npt, npt) + ) +) + +LTTNG_TRACEPOINT_EVENT_MAP(kvm_nested_intercepts, kvm_x86_nested_intercepts, + TP_PROTO(__u16 cr_read, __u16 cr_write, __u32 exceptions, __u64 intercept), + TP_ARGS(cr_read, cr_write, exceptions, intercept), + + TP_FIELDS( + ctf_integer(__u16, cr_read, cr_read) + ctf_integer(__u16, cr_write, cr_write) + ctf_integer(__u32, exceptions, exceptions) + ctf_integer(__u64, intercept, intercept) + ) +) +/* + * Tracepoint for #VMEXIT while nested + */ +LTTNG_TRACEPOINT_EVENT_MAP(kvm_nested_vmexit, kvm_x86_nested_vmexit, + TP_PROTO(__u64 rip, __u32 exit_code, + __u64 exit_info1, __u64 exit_info2, + __u32 exit_int_info, __u32 exit_int_info_err, __u32 isa), + TP_ARGS(rip, exit_code, exit_info1, exit_info2, + exit_int_info, exit_int_info_err, isa), + + TP_FIELDS( + ctf_integer(__u64, rip, rip) + ctf_integer(__u32, exit_code, exit_code) + ctf_integer(__u64, exit_info1, exit_info1) + ctf_integer(__u64, exit_info2, exit_info2) + ctf_integer(__u32, exit_int_info, exit_int_info) + ctf_integer(__u32, exit_int_info_err, exit_int_info_err) + ctf_integer(__u32, isa, isa) + ) +) + +/* + * Tracepoint for #VMEXIT reinjected to the guest + */ +LTTNG_TRACEPOINT_EVENT_MAP(kvm_nested_vmexit_inject, kvm_x86_nested_vmexit_inject, + TP_PROTO(__u32 exit_code, + __u64 exit_info1, __u64 exit_info2, + __u32 exit_int_info, __u32 exit_int_info_err, __u32 isa), + TP_ARGS(exit_code, exit_info1, exit_info2, + exit_int_info, exit_int_info_err, isa), + + TP_FIELDS( + ctf_integer(__u32, exit_code, exit_code) + ctf_integer(__u64, exit_info1, exit_info1) + ctf_integer(__u64, exit_info2, exit_info2) + ctf_integer(__u32, exit_int_info, exit_int_info) + ctf_integer(__u32, exit_int_info_err, exit_int_info_err) + ctf_integer(__u32, isa, isa) + ) +) + +/* + * Tracepoint for nested #vmexit because of interrupt pending + */ +LTTNG_TRACEPOINT_EVENT_MAP(kvm_nested_intr_vmexit, kvm_x86_nested_intr_vmexit, + TP_PROTO(__u64 rip), + TP_ARGS(rip), + + TP_FIELDS( + ctf_integer(__u64, rip, rip) + ) +) + +/* + * Tracepoint for nested #vmexit because of interrupt pending + */ +LTTNG_TRACEPOINT_EVENT_MAP(kvm_invlpga, kvm_x86_invlpga, + TP_PROTO(__u64 rip, int asid, u64 address), + TP_ARGS(rip, asid, address), + + TP_FIELDS( + ctf_integer(__u64, rip, rip) + ctf_integer(int, asid, asid) + ctf_integer_hex(__u64, address, address) + ) +) + +/* + * Tracepoint for nested #vmexit because of interrupt pending + */ +LTTNG_TRACEPOINT_EVENT_MAP(kvm_skinit, kvm_x86_skinit, + TP_PROTO(__u64 rip, __u32 slb), + TP_ARGS(rip, slb), + + TP_FIELDS( + ctf_integer(__u64, rip, rip) + ctf_integer(__u32, slb, slb) + ) +) + +#define KVM_EMUL_INSN_F_CR0_PE (1 << 0) +#define KVM_EMUL_INSN_F_EFL_VM (1 << 1) +#define KVM_EMUL_INSN_F_CS_D (1 << 2) +#define KVM_EMUL_INSN_F_CS_L (1 << 3) + +#define kvm_trace_symbol_emul_flags \ + { 0, "real" }, \ + { KVM_EMUL_INSN_F_CR0_PE \ + | KVM_EMUL_INSN_F_EFL_VM, "vm16" }, \ + { KVM_EMUL_INSN_F_CR0_PE, "prot16" }, \ + { KVM_EMUL_INSN_F_CR0_PE \ + | KVM_EMUL_INSN_F_CS_D, "prot32" }, \ + { KVM_EMUL_INSN_F_CR0_PE \ + | KVM_EMUL_INSN_F_CS_L, "prot64" } + +#define kei_decode_mode(mode) ({ \ + u8 flags = 0xff; \ + switch (mode) { \ + case X86EMUL_MODE_REAL: \ + flags = 0; \ + break; \ + case X86EMUL_MODE_VM86: \ + flags = KVM_EMUL_INSN_F_EFL_VM; \ + break; \ + case X86EMUL_MODE_PROT16: \ + flags = KVM_EMUL_INSN_F_CR0_PE; \ + break; \ + case X86EMUL_MODE_PROT32: \ + flags = KVM_EMUL_INSN_F_CR0_PE \ + | KVM_EMUL_INSN_F_CS_D; \ + break; \ + case X86EMUL_MODE_PROT64: \ + flags = KVM_EMUL_INSN_F_CR0_PE \ + | KVM_EMUL_INSN_F_CS_L; \ + break; \ + } \ + flags; \ + }) + +LTTNG_TRACEPOINT_EVENT_MAP(kvm_emulate_insn, kvm_x86_emulate_insn, + TP_PROTO(struct kvm_vcpu *vcpu, __u8 failed), + TP_ARGS(vcpu, failed), + + TP_FIELDS( +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)) + ctf_integer(__u64, rip, vcpu->arch.emulate_ctxt.decode.fetch.start) + ctf_integer(__u32, csbase, kvm_x86_ops->get_segment_base(vcpu, VCPU_SREG_CS)) + ctf_integer(__u8, len, vcpu->arch.emulate_ctxt.decode.eip + - vcpu->arch.emulate_ctxt.decode.fetch.start) + ctf_array(__u8, insn, vcpu->arch.emulate_ctxt.decode.fetch.data, 15) + ctf_integer(__u8, flags, kei_decode_mode(vcpu->arch.emulate_ctxt.mode)) +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)) + ctf_integer(__u64, rip, vcpu->arch.emulate_ctxt.fetch.start) + ctf_integer(__u32, csbase, kvm_x86_ops->get_segment_base(vcpu, VCPU_SREG_CS)) + ctf_integer(__u8, len, vcpu->arch.emulate_ctxt._eip + - vcpu->arch.emulate_ctxt.fetch.start) + ctf_array(__u8, insn, vcpu->arch.emulate_ctxt.fetch.data, 15) + ctf_integer(__u8, flags, kei_decode_mode(vcpu->arch.emulate_ctxt.mode)) +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(5,7,0)) + ctf_integer(__u64, rip, vcpu->arch.emulate_ctxt._eip - + (vcpu->arch.emulate_ctxt.fetch.ptr - + vcpu->arch.emulate_ctxt.fetch.data)) + ctf_integer(__u32, csbase, kvm_x86_ops->get_segment_base(vcpu, VCPU_SREG_CS)) + ctf_integer(__u8, len, vcpu->arch.emulate_ctxt.fetch.ptr - + vcpu->arch.emulate_ctxt.fetch.data) + ctf_array(__u8, insn, vcpu->arch.emulate_ctxt.fetch.data, 15) + ctf_integer(__u8, flags, kei_decode_mode(vcpu->arch.emulate_ctxt.mode)) +#else + ctf_integer(__u64, rip, vcpu->arch.emulate_ctxt->_eip - + (vcpu->arch.emulate_ctxt->fetch.ptr - + vcpu->arch.emulate_ctxt->fetch.data)) + ctf_integer(__u32, csbase, kvm_x86_ops.get_segment_base(vcpu, VCPU_SREG_CS)) + ctf_integer(__u8, len, vcpu->arch.emulate_ctxt->fetch.ptr - + vcpu->arch.emulate_ctxt->fetch.data) + ctf_array(__u8, insn, vcpu->arch.emulate_ctxt->fetch.data, 15) + ctf_integer(__u8, flags, kei_decode_mode(vcpu->arch.emulate_ctxt->mode)) +#endif + ctf_integer(__u8, failed, failed) + ) +) + +#define trace_kvm_emulate_insn_start(vcpu) trace_kvm_emulate_insn(vcpu, 0) +#define trace_kvm_emulate_insn_failed(vcpu) trace_kvm_emulate_insn(vcpu, 1) + +LTTNG_TRACEPOINT_EVENT_MAP( + vcpu_match_mmio, kvm_x86_vcpu_match_mmio, + TP_PROTO(gva_t gva, gpa_t gpa, bool write, bool gpa_match), + TP_ARGS(gva, gpa, write, gpa_match), + + TP_FIELDS( + ctf_integer(gva_t, gva, gva) + ctf_integer(gpa_t, gpa, gpa) + ctf_integer(bool, write, write) + ctf_integer(bool, gpa_match, gpa_match) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) +LTTNG_TRACEPOINT_EVENT_MAP(kvm_write_tsc_offset, kvm_x86_write_tsc_offset, + TP_PROTO(unsigned int vcpu_id, __u64 previous_tsc_offset, + __u64 next_tsc_offset), + TP_ARGS(vcpu_id, previous_tsc_offset, next_tsc_offset), + + TP_FIELDS( + ctf_integer(unsigned int, vcpu_id, vcpu_id) + ctf_integer(__u64, previous_tsc_offset, previous_tsc_offset) + ctf_integer(__u64, next_tsc_offset, next_tsc_offset) + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) +#ifdef CONFIG_X86_64 + +LTTNG_TRACEPOINT_EVENT_MAP(kvm_update_master_clock, kvm_x86_update_master_clock, + TP_PROTO(bool use_master_clock, unsigned int host_clock, bool offset_matched), + TP_ARGS(use_master_clock, host_clock, offset_matched), + + TP_FIELDS( + ctf_integer(bool, use_master_clock, use_master_clock) + ctf_integer(unsigned int, host_clock, host_clock) + ctf_integer(bool, offset_matched, offset_matched) + ) +) + +LTTNG_TRACEPOINT_EVENT_MAP(kvm_track_tsc, kvm_x86_track_tsc, + TP_PROTO(unsigned int vcpu_id, unsigned int nr_matched, + unsigned int online_vcpus, bool use_master_clock, + unsigned int host_clock), + TP_ARGS(vcpu_id, nr_matched, online_vcpus, use_master_clock, + host_clock), + + TP_FIELDS( + ctf_integer(unsigned int, vcpu_id, vcpu_id) + ctf_integer(unsigned int, nr_vcpus_matched_tsc, nr_matched) + ctf_integer(unsigned int, online_vcpus, online_vcpus) + ctf_integer(bool, use_master_clock, use_master_clock) + ctf_integer(unsigned int, host_clock, host_clock) + ) +) + +#endif /* CONFIG_X86_64 */ +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) */ + +#endif /* LTTNG_TRACE_KVM_H */ + +#undef TRACE_INCLUDE_PATH +#define TRACE_INCLUDE_PATH instrumentation/events/arch/x86/kvm +#undef TRACE_INCLUDE_FILE +#define TRACE_INCLUDE_FILE trace + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/asoc.h b/include/instrumentation/events/asoc.h new file mode 100644 index 00000000..7d86af87 --- /dev/null +++ b/include/instrumentation/events/asoc.h @@ -0,0 +1,414 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM asoc + +#if !defined(LTTNG_TRACE_ASOC_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_ASOC_H + +#include +#include +#include + +#define DAPM_DIRECT "(direct)" + +#ifndef _TRACE_ASOC_DEF +#define _TRACE_ASOC_DEF +struct snd_soc_jack; +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)) +struct snd_soc_codec; +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) && \ + LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)) +struct snd_soc_platform; +#endif +struct snd_soc_card; +struct snd_soc_dapm_widget; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) +struct snd_soc_dapm_path; +#endif +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0) \ + || LTTNG_RHEL_KERNEL_RANGE(3,10,0,514,0,0, 3,11,0,0,0,0)) +#define CODEC_NAME_FIELD component.name +#define CODEC_ID_FIELD component.id +#else +#define CODEC_NAME_FIELD name +#define CODEC_ID_FIELD id +#endif + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)) +/* + * Log register events + */ +LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_reg, + + TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, + unsigned int val), + + TP_ARGS(codec, reg, val), + + TP_FIELDS( + ctf_string(name, codec->CODEC_NAME_FIELD) + ctf_integer(int, id, codec->CODEC_ID_FIELD) + ctf_integer(unsigned int, reg, reg) + ctf_integer(unsigned int, val, val) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_reg, snd_soc_reg_write, + + asoc_snd_soc_reg_write, + + TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, + unsigned int val), + + TP_ARGS(codec, reg, val) + +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_reg, snd_soc_reg_read, + + asoc_snd_soc_reg_read, + + TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, + unsigned int val), + + TP_ARGS(codec, reg, val) + +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) && \ + LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_preg, + + TP_PROTO(struct snd_soc_platform *platform, unsigned int reg, + unsigned int val), + + TP_ARGS(platform, reg, val), + + TP_FIELDS( + ctf_string(name, platform->CODEC_NAME_FIELD) + ctf_integer(int, id, platform->CODEC_ID_FIELD) + ctf_integer(unsigned int, reg, reg) + ctf_integer(unsigned int, val, val) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_preg, snd_soc_preg_write, + + asoc_snd_soc_preg_write, + + TP_PROTO(struct snd_soc_platform *platform, unsigned int reg, + unsigned int val), + + TP_ARGS(platform, reg, val) + +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_preg, snd_soc_preg_read, + + asoc_snd_soc_preg_read, + + TP_PROTO(struct snd_soc_platform *platform, unsigned int reg, + unsigned int val), + + TP_ARGS(platform, reg, val) + +) +#endif + +LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_card, + + TP_PROTO(struct snd_soc_card *card, int val), + + TP_ARGS(card, val), + + TP_FIELDS( + ctf_string(name, card->name) + ctf_integer(int, val, val) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_card, snd_soc_bias_level_start, + + asoc_snd_soc_bias_level_start, + + TP_PROTO(struct snd_soc_card *card, int val), + + TP_ARGS(card, val) + +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_card, snd_soc_bias_level_done, + + asoc_snd_soc_bias_level_done, + + TP_PROTO(struct snd_soc_card *card, int val), + + TP_ARGS(card, val) + +) + +LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_basic, + + TP_PROTO(struct snd_soc_card *card), + + TP_ARGS(card), + + TP_FIELDS( + ctf_string(name, card->name) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic, snd_soc_dapm_start, + + asoc_snd_soc_dapm_start, + + TP_PROTO(struct snd_soc_card *card), + + TP_ARGS(card) + +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic, snd_soc_dapm_done, + + asoc_snd_soc_dapm_done, + + TP_PROTO(struct snd_soc_card *card), + + TP_ARGS(card) + +) + +LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_widget, + + TP_PROTO(struct snd_soc_dapm_widget *w, int val), + + TP_ARGS(w, val), + + TP_FIELDS( + ctf_string(name, w->name) + ctf_integer(int, val, val) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_widget, snd_soc_dapm_widget_power, + + asoc_snd_soc_dapm_widget_power, + + TP_PROTO(struct snd_soc_dapm_widget *w, int val), + + TP_ARGS(w, val) + +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_widget, snd_soc_dapm_widget_event_start, + + asoc_snd_soc_dapm_widget_event_start, + + TP_PROTO(struct snd_soc_dapm_widget *w, int val), + + TP_ARGS(w, val) + +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_widget, snd_soc_dapm_widget_event_done, + + asoc_snd_soc_dapm_widget_event_done, + + TP_PROTO(struct snd_soc_dapm_widget *w, int val), + + TP_ARGS(w, val) + +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) +LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_walk_done, + + asoc_snd_soc_dapm_walk_done, + + TP_PROTO(struct snd_soc_card *card), + + TP_ARGS(card), + + TP_FIELDS( + ctf_string(name, card->name) + ctf_integer(int, power_checks, card->dapm_stats.power_checks) + ctf_integer(int, path_checks, card->dapm_stats.path_checks) + ctf_integer(int, neighbour_checks, card->dapm_stats.neighbour_checks) + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) +LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_path, + + asoc_snd_soc_dapm_path, + + TP_PROTO(struct snd_soc_dapm_widget *widget, + enum snd_soc_dapm_direction dir, + struct snd_soc_dapm_path *path), + + TP_ARGS(widget, dir, path), + + TP_FIELDS( + ctf_string(wname, widget->name) + ctf_string(pname, path->name ? path->name : DAPM_DIRECT) + ctf_string(pnname, path->node[dir]->name) + ctf_integer(int, path_node, (long) path->node[dir]) + ctf_integer(int, path_connect, path->connect) + ctf_integer(int, path_dir, dir) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) +LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_output_path, + + asoc_snd_soc_dapm_output_path, + + TP_PROTO(struct snd_soc_dapm_widget *widget, + struct snd_soc_dapm_path *path), + + TP_ARGS(widget, path), + + TP_FIELDS( + ctf_string(wname, widget->name) + ctf_string(pname, path->name ? path->name : DAPM_DIRECT) + ctf_string(psname, path->sink->name) + ctf_integer(int, path_sink, (long) path->sink) + ctf_integer(int, path_connect, path->connect) + ) +) + +LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_input_path, + + asoc_snd_soc_dapm_input_path, + + TP_PROTO(struct snd_soc_dapm_widget *widget, + struct snd_soc_dapm_path *path), + + TP_ARGS(widget, path), + + TP_FIELDS( + ctf_string(wname, widget->name) + ctf_string(pname,path->name ? path->name : DAPM_DIRECT) + ctf_string(psname, path->source->name) + ctf_integer(int, path_source, (long) path->source) + ctf_integer(int, path_connect, path->connect) + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) +LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_connected, + + asoc_snd_soc_dapm_connected, + + TP_PROTO(int paths, int stream), + + TP_ARGS(paths, stream), + + TP_FIELDS( + ctf_integer(int, paths, paths) + ctf_integer(int, stream, stream) + ) +) +#endif + +LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_irq, + + asoc_snd_soc_jack_irq, + + TP_PROTO(const char *name), + + TP_ARGS(name), + + TP_FIELDS( + ctf_string(name, name) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) +LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_report, + + asoc_snd_soc_jack_report, + + TP_PROTO(struct snd_soc_jack *jack, int mask, int val), + + TP_ARGS(jack, mask, val), + + TP_FIELDS( + ctf_string(name, jack->jack->id) + ctf_integer(int, mask, mask) + ctf_integer(int, val, val) + ) +) + +LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_notify, + + asoc_snd_soc_jack_notify, + + TP_PROTO(struct snd_soc_jack *jack, int val), + + TP_ARGS(jack, val), + + TP_FIELDS( + ctf_string(name, jack->jack->id) + ctf_integer(int, val, val) + ) +) +#else +LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_report, + + asoc_snd_soc_jack_report, + + TP_PROTO(struct snd_soc_jack *jack, int mask, int val), + + TP_ARGS(jack, mask, val), + + TP_FIELDS( + ctf_string(name, jack->jack->name) + ctf_integer(int, mask, mask) + ctf_integer(int, val, val) + ) +) + +LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_notify, + + asoc_snd_soc_jack_notify, + + TP_PROTO(struct snd_soc_jack *jack, int val), + + TP_ARGS(jack, val), + + TP_FIELDS( + ctf_string(name, jack->jack->name) + ctf_integer(int, val, val) + ) +) +#endif + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)) +LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_cache_sync, + + asoc_snd_soc_cache_sync, + + TP_PROTO(struct snd_soc_codec *codec, const char *type, + const char *status), + + TP_ARGS(codec, type, status), + + TP_FIELDS( + ctf_string(name, codec->CODEC_NAME_FIELD) + ctf_string(status, status) + ctf_string(type, type) + ctf_integer(int, id, codec->CODEC_ID_FIELD) + ) +) +#endif + +#endif /* LTTNG_TRACE_ASOC_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/block.h b/include/instrumentation/events/block.h new file mode 100644 index 00000000..3b087d66 --- /dev/null +++ b/include/instrumentation/events/block.h @@ -0,0 +1,1054 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM block + +#if !defined(LTTNG_TRACE_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_BLOCK_H + +#include +#include +#include +#include +#include + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) +#include +#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ + +#ifndef _TRACE_BLOCK_DEF_ +#define _TRACE_BLOCK_DEF_ + +enum { + RWBS_FLAG_WRITE = (1 << 0), + RWBS_FLAG_DISCARD = (1 << 1), + RWBS_FLAG_READ = (1 << 2), + RWBS_FLAG_RAHEAD = (1 << 3), + RWBS_FLAG_BARRIER = (1 << 4), + RWBS_FLAG_SYNC = (1 << 5), + RWBS_FLAG_META = (1 << 6), + RWBS_FLAG_SECURE = (1 << 7), + RWBS_FLAG_FLUSH = (1 << 8), + RWBS_FLAG_FUA = (1 << 9), + RWBS_FLAG_PREFLUSH = (1 << 10), +}; + +#endif /* _TRACE_BLOCK_DEF_ */ + +LTTNG_TRACEPOINT_ENUM(block_rq_type, + TP_ENUM_VALUES( + ctf_enum_value("RWBS_FLAG_WRITE", RWBS_FLAG_WRITE) + ctf_enum_value("RWBS_FLAG_DISCARD", RWBS_FLAG_DISCARD) + ctf_enum_value("RWBS_FLAG_READ", RWBS_FLAG_READ) + ctf_enum_value("RWBS_FLAG_RAHEAD", RWBS_FLAG_RAHEAD) + ctf_enum_value("RWBS_FLAG_BARRIER", RWBS_FLAG_BARRIER) + ctf_enum_value("RWBS_FLAG_SYNC", RWBS_FLAG_SYNC) + ctf_enum_value("RWBS_FLAG_META", RWBS_FLAG_META) + ctf_enum_value("RWBS_FLAG_SECURE", RWBS_FLAG_SECURE) + ctf_enum_value("RWBS_FLAG_FLUSH", RWBS_FLAG_FLUSH) + ctf_enum_value("RWBS_FLAG_FUA", RWBS_FLAG_FUA) + ctf_enum_value("RWBS_FLAG_PREFLUSH", RWBS_FLAG_PREFLUSH) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,103,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,114,94,0,0, 4,4,114,95,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,120,94,0,0, 4,4,120,95,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,126,94,0,0, 4,5,0,0,0,0)) + +#define lttng_req_op(rq) req_op(rq) +#define lttng_req_rw(rq) ((rq)->cmd_flags) +#define lttng_bio_op(bio) bio_op(bio) +#define lttng_bio_rw(bio) ((bio)->bi_opf) + +#define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \ + ctf_enum(block_rq_type, type, rwbs, \ + (((op) == REQ_OP_WRITE || (op) == REQ_OP_WRITE_SAME) ? RWBS_FLAG_WRITE : \ + ( (op) == REQ_OP_DISCARD ? RWBS_FLAG_DISCARD : \ + ( (op) == REQ_OP_SECURE_ERASE ? (RWBS_FLAG_DISCARD | RWBS_FLAG_SECURE) : \ + ( (op) == REQ_OP_FLUSH ? RWBS_FLAG_FLUSH : \ + ( (op) == REQ_OP_READ ? RWBS_FLAG_READ : \ + ( 0 )))))) \ + | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \ + | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \ + | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \ + | ((rw) & REQ_PREFLUSH ? RWBS_FLAG_PREFLUSH : 0) \ + | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0)) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) + +#define lttng_req_op(rq) +#define lttng_req_rw(rq) ((rq)->cmd_flags) +#define lttng_bio_op(bio) +#define lttng_bio_rw(bio) ((bio)->bi_rw) + +#define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \ + ctf_enum(block_rq_type, type, rwbs, ((rw) & WRITE ? RWBS_FLAG_WRITE : \ + ( (rw) & REQ_DISCARD ? RWBS_FLAG_DISCARD : \ + ( (bytes) ? RWBS_FLAG_READ : \ + ( 0 )))) \ + | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \ + | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \ + | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \ + | ((rw) & REQ_SECURE ? RWBS_FLAG_SECURE : 0) \ + | ((rw) & REQ_FLUSH ? RWBS_FLAG_FLUSH : 0) \ + | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0)) + +#else + +#define lttng_req_op(rq) +#define lttng_req_rw(rq) ((rq)->cmd_flags) +#define lttng_bio_op(bio) +#define lttng_bio_rw(bio) ((bio)->bi_rw) + +#define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \ + ctf_enum(block_rq_type, type, rwbs, ((rw) & WRITE ? RWBS_FLAG_WRITE : \ + ( (rw) & REQ_DISCARD ? RWBS_FLAG_DISCARD : \ + ( (bytes) ? RWBS_FLAG_READ : \ + ( 0 )))) \ + | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \ + | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \ + | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \ + | ((rw) & REQ_SECURE ? RWBS_FLAG_SECURE : 0)) + +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(block_buffer, + + TP_PROTO(struct buffer_head *bh), + + TP_ARGS(bh), + + TP_FIELDS ( + ctf_integer(dev_t, dev, bh->b_bdev->bd_dev) + ctf_integer(sector_t, sector, bh->b_blocknr) + ctf_integer(size_t, size, bh->b_size) + ) +) + +/** + * block_touch_buffer - mark a buffer accessed + * @bh: buffer_head being touched + * + * Called from touch_buffer(). + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(block_buffer, block_touch_buffer, + + TP_PROTO(struct buffer_head *bh), + + TP_ARGS(bh) +) + +/** + * block_dirty_buffer - mark a buffer dirty + * @bh: buffer_head being dirtied + * + * Called from mark_buffer_dirty(). + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(block_buffer, block_dirty_buffer, + + TP_PROTO(struct buffer_head *bh), + + TP_ARGS(bh) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) +/* block_rq_with_error event class removed in kernel 4.12 */ +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) +LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq_with_error, + + TP_PROTO(struct request_queue *q, struct request *rq), + + TP_ARGS(q, rq), + + TP_locvar( + sector_t sector; + unsigned int nr_sector; + unsigned char *cmd; + size_t cmd_len; + ), + + TP_code_pre( + if (blk_rq_is_scsi(rq)) { + struct scsi_request *scsi_rq = scsi_req(rq); + tp_locvar->sector = 0; + tp_locvar->nr_sector = 0; + tp_locvar->cmd = scsi_rq->cmd; + tp_locvar->cmd_len = scsi_rq->cmd_len; + } else { + tp_locvar->sector = blk_rq_pos(rq); + tp_locvar->nr_sector = blk_rq_sectors(rq); + tp_locvar->cmd = NULL; + tp_locvar->cmd_len = 0; + } + ), + + TP_FIELDS( + ctf_integer(dev_t, dev, + rq->rq_disk ? disk_devt(rq->rq_disk) : 0) + ctf_integer(sector_t, sector, tp_locvar->sector) + ctf_integer(unsigned int, nr_sector, tp_locvar->nr_sector) + ctf_integer(int, errors, rq->errors) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq)) + ctf_sequence_hex(unsigned char, cmd, + tp_locvar->cmd, size_t, tp_locvar->cmd_len) + ), + + TP_code_post() +) +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ +LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq_with_error, + + TP_PROTO(struct request_queue *q, struct request *rq), + + TP_ARGS(q, rq), + + TP_locvar( + sector_t sector; + unsigned int nr_sector; + unsigned char *cmd; + size_t cmd_len; + ), + + TP_code_pre( + + if (rq->cmd_type == REQ_TYPE_BLOCK_PC) { + tp_locvar->sector = 0; + tp_locvar->nr_sector = 0; + tp_locvar->cmd = rq->cmd; + tp_locvar->cmd_len = rq->cmd_len; + } else { + tp_locvar->sector = blk_rq_pos(rq); + tp_locvar->nr_sector = blk_rq_sectors(rq); + tp_locvar->cmd = NULL; + tp_locvar->cmd_len = 0; + } + ), + + TP_FIELDS( + ctf_integer(dev_t, dev, + rq->rq_disk ? disk_devt(rq->rq_disk) : 0) + ctf_integer(sector_t, sector, tp_locvar->sector) + ctf_integer(unsigned int, nr_sector, tp_locvar->nr_sector) + ctf_integer(int, errors, rq->errors) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq)) + ctf_sequence_hex(unsigned char, cmd, + tp_locvar->cmd, size_t, tp_locvar->cmd_len) + ), + + TP_code_post() +) +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0)) +/** + * block_rq_abort - abort block operation request + * @q: queue containing the block operation request + * @rq: block IO operation request + * + * Called immediately after pending block IO operation request @rq in + * queue @q is aborted. The fields in the operation request @rq + * can be examined to determine which device and sectors the pending + * operation would access. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq_with_error, block_rq_abort, + + TP_PROTO(struct request_queue *q, struct request *rq), + + TP_ARGS(q, rq) +) +#endif + +/** + * block_rq_requeue - place block IO request back on a queue + * @q: queue holding operation + * @rq: block IO operation request + * + * The block operation request @rq is being placed back into queue + * @q. For some reason the request was not completed and needs to be + * put back in the queue. + */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) +LTTNG_TRACEPOINT_EVENT(block_rq_requeue, + + TP_PROTO(struct request_queue *q, struct request *rq), + + TP_ARGS(q, rq), + + TP_FIELDS( + ctf_integer(dev_t, dev, + rq->rq_disk ? disk_devt(rq->rq_disk) : 0) + ctf_integer(sector_t, sector, blk_rq_trace_sector(rq)) + ctf_integer(unsigned int, nr_sector, blk_rq_trace_nr_sectors(rq)) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq)) + ) +) +#else +LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq_with_error, block_rq_requeue, + + TP_PROTO(struct request_queue *q, struct request *rq), + + TP_ARGS(q, rq) +) +#endif + +/** + * block_rq_complete - block IO operation completed by device driver + * @q: queue containing the block operation request + * @rq: block operations request + * @nr_bytes: number of completed bytes + * + * The block_rq_complete tracepoint event indicates that some portion + * of operation request has been completed by the device driver. If + * the @rq->bio is %NULL, then there is absolutely no additional work to + * do for the request. If @rq->bio is non-NULL then there is + * additional work required to complete the request. + */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) +LTTNG_TRACEPOINT_EVENT(block_rq_complete, + + TP_PROTO(struct request *rq, int error, unsigned int nr_bytes), + + TP_ARGS(rq, error, nr_bytes), + + TP_FIELDS( + ctf_integer(dev_t, dev, + rq->rq_disk ? disk_devt(rq->rq_disk) : 0) + ctf_integer(sector_t, sector, blk_rq_pos(rq)) + ctf_integer(unsigned int, nr_sector, nr_bytes >> 9) + ctf_integer(int, error, error) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_req_op(rq), lttng_req_rw(rq), nr_bytes) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) +LTTNG_TRACEPOINT_EVENT_CODE(block_rq_complete, + + TP_PROTO(struct request_queue *q, struct request *rq, + unsigned int nr_bytes), + + TP_ARGS(q, rq, nr_bytes), + + TP_locvar( + unsigned char *cmd; + size_t cmd_len; + ), + + TP_code_pre( + if (blk_rq_is_scsi(rq)) { + struct scsi_request *scsi_rq = scsi_req(rq); + tp_locvar->cmd = scsi_rq->cmd; + tp_locvar->cmd_len = scsi_rq->cmd_len; + } else { + tp_locvar->cmd = NULL; + tp_locvar->cmd_len = 0; + } + ), + + TP_FIELDS( + ctf_integer(dev_t, dev, + rq->rq_disk ? disk_devt(rq->rq_disk) : 0) + ctf_integer(sector_t, sector, blk_rq_pos(rq)) + ctf_integer(unsigned int, nr_sector, nr_bytes >> 9) + ctf_integer(int, errors, rq->errors) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_req_op(rq), lttng_req_rw(rq), nr_bytes) + ctf_sequence_hex(unsigned char, cmd, + tp_locvar->cmd, size_t, tp_locvar->cmd_len) + ), + + TP_code_post() +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,5) \ + || LTTNG_KERNEL_RANGE(3,12,21, 3,13,0) \ + || LTTNG_KERNEL_RANGE(3,10,41, 3,11,0) \ + || LTTNG_KERNEL_RANGE(3,4,91, 3,5,0) \ + || LTTNG_KERNEL_RANGE(3,2,58, 3,3,0) \ + || LTTNG_UBUNTU_KERNEL_RANGE(3,13,11,28, 3,14,0,0) \ + || LTTNG_RHEL_KERNEL_RANGE(3,10,0,229,0,0, 3,11,0,0,0,0)) + +LTTNG_TRACEPOINT_EVENT_CODE(block_rq_complete, + + TP_PROTO(struct request_queue *q, struct request *rq, + unsigned int nr_bytes), + + TP_ARGS(q, rq, nr_bytes), + + TP_locvar( + unsigned char *cmd; + size_t cmd_len; + ), + + TP_code_pre( + if (rq->cmd_type == REQ_TYPE_BLOCK_PC) { + tp_locvar->cmd = rq->cmd; + tp_locvar->cmd_len = rq->cmd_len; + } else { + tp_locvar->cmd = NULL; + tp_locvar->cmd_len = 0; + } + ), + + TP_FIELDS( + ctf_integer(dev_t, dev, + rq->rq_disk ? disk_devt(rq->rq_disk) : 0) + ctf_integer(sector_t, sector, blk_rq_pos(rq)) + ctf_integer(unsigned int, nr_sector, nr_bytes >> 9) + ctf_integer(int, errors, rq->errors) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_req_op(rq), lttng_req_rw(rq), nr_bytes) + ctf_sequence_hex(unsigned char, cmd, + tp_locvar->cmd, size_t, tp_locvar->cmd_len) + ), + + TP_code_post() +) + +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */ + +/** + * block_rq_complete - block IO operation completed by device driver + * @q: queue containing the block operation request + * @rq: block operations request + * + * The block_rq_complete tracepoint event indicates that some portion + * of operation request has been completed by the device driver. If + * the @rq->bio is %NULL, then there is absolutely no additional work to + * do for the request. If @rq->bio is non-NULL then there is + * additional work required to complete the request. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq_with_error, block_rq_complete, + + TP_PROTO(struct request_queue *q, struct request *rq), + + TP_ARGS(q, rq) +) + +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(block_rq, + + TP_PROTO(struct request_queue *q, struct request *rq), + + TP_ARGS(q, rq), + + TP_FIELDS( + ctf_integer(dev_t, dev, + rq->rq_disk ? disk_devt(rq->rq_disk) : 0) + ctf_integer(sector_t, sector, blk_rq_trace_sector(rq)) + ctf_integer(unsigned int, nr_sector, blk_rq_trace_nr_sectors(rq)) + ctf_integer(unsigned int, bytes, blk_rq_bytes(rq)) + ctf_integer(pid_t, tid, current->pid) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq)) + ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) +LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq, + + TP_PROTO(struct request_queue *q, struct request *rq), + + TP_ARGS(q, rq), + + TP_locvar( + sector_t sector; + unsigned int nr_sector; + unsigned int bytes; + unsigned char *cmd; + size_t cmd_len; + ), + + TP_code_pre( + if (blk_rq_is_scsi(rq)) { + struct scsi_request *scsi_rq = scsi_req(rq); + tp_locvar->sector = 0; + tp_locvar->nr_sector = 0; + tp_locvar->bytes = scsi_rq->resid_len; + tp_locvar->cmd = scsi_rq->cmd; + tp_locvar->cmd_len = scsi_rq->cmd_len; + } else { + tp_locvar->sector = blk_rq_pos(rq); + tp_locvar->nr_sector = blk_rq_sectors(rq); + tp_locvar->bytes = 0; + tp_locvar->cmd = NULL; + tp_locvar->cmd_len = 0; + } + ), + + TP_FIELDS( + ctf_integer(dev_t, dev, + rq->rq_disk ? disk_devt(rq->rq_disk) : 0) + ctf_integer(sector_t, sector, tp_locvar->sector) + ctf_integer(unsigned int, nr_sector, tp_locvar->nr_sector) + ctf_integer(unsigned int, bytes, tp_locvar->bytes) + ctf_integer(pid_t, tid, current->pid) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq)) + ctf_sequence_hex(unsigned char, cmd, + tp_locvar->cmd, size_t, tp_locvar->cmd_len) + ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) + ), + + TP_code_post() +) +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ +LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq, + + TP_PROTO(struct request_queue *q, struct request *rq), + + TP_ARGS(q, rq), + + TP_locvar( + sector_t sector; + unsigned int nr_sector; + unsigned int bytes; + unsigned char *cmd; + size_t cmd_len; + ), + + TP_code_pre( + if (rq->cmd_type == REQ_TYPE_BLOCK_PC) { + tp_locvar->sector = 0; + tp_locvar->nr_sector = 0; + tp_locvar->bytes = blk_rq_bytes(rq); + tp_locvar->cmd = rq->cmd; + tp_locvar->cmd_len = rq->cmd_len; + } else { + tp_locvar->sector = blk_rq_pos(rq); + tp_locvar->nr_sector = blk_rq_sectors(rq); + tp_locvar->bytes = 0; + tp_locvar->cmd = NULL; + tp_locvar->cmd_len = 0; + } + ), + + TP_FIELDS( + ctf_integer(dev_t, dev, + rq->rq_disk ? disk_devt(rq->rq_disk) : 0) + ctf_integer(sector_t, sector, tp_locvar->sector) + ctf_integer(unsigned int, nr_sector, tp_locvar->nr_sector) + ctf_integer(unsigned int, bytes, tp_locvar->bytes) + ctf_integer(pid_t, tid, current->pid) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq)) + ctf_sequence_hex(unsigned char, cmd, + tp_locvar->cmd, size_t, tp_locvar->cmd_len) + ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) + ), + + TP_code_post() +) +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ + +/** + * block_rq_insert - insert block operation request into queue + * @q: target queue + * @rq: block IO operation request + * + * Called immediately before block operation request @rq is inserted + * into queue @q. The fields in the operation request @rq struct can + * be examined to determine which device and sectors the pending + * operation would access. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq, block_rq_insert, + + TP_PROTO(struct request_queue *q, struct request *rq), + + TP_ARGS(q, rq) +) + +/** + * block_rq_issue - issue pending block IO request operation to device driver + * @q: queue holding operation + * @rq: block IO operation operation request + * + * Called when block operation request @rq from queue @q is sent to a + * device driver for processing. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq, block_rq_issue, + + TP_PROTO(struct request_queue *q, struct request *rq), + + TP_ARGS(q, rq) +) + +/** + * block_bio_bounce - used bounce buffer when processing block operation + * @q: queue holding the block operation + * @bio: block operation + * + * A bounce buffer was used to handle the block operation @bio in @q. + * This occurs when hardware limitations prevent a direct transfer of + * data between the @bio data memory area and the IO device. Use of a + * bounce buffer requires extra copying of data and decreases + * performance. + */ +LTTNG_TRACEPOINT_EVENT(block_bio_bounce, + + TP_PROTO(struct request_queue *q, struct bio *bio), + + TP_ARGS(q, bio), + + TP_FIELDS( +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) + ctf_integer(dev_t, dev, bio_dev(bio)) +#else + ctf_integer(dev_t, dev, bio->bi_bdev ? bio->bi_bdev->bd_dev : 0) +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) + ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_bio_op(bio), lttng_bio_rw(bio), + bio->bi_iter.bi_size) +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(sector_t, sector, bio->bi_sector) + ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_bio_op(bio), lttng_bio_rw(bio), + bio->bi_size) +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(pid_t, tid, current->pid) + ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) + ) +) + +/** + * block_bio_complete - completed all work on the block operation + * @q: queue holding the block operation + * @bio: block operation completed + * @error: io error value + * + * This tracepoint indicates there is no further work to do on this + * block IO operation @bio. + */ +LTTNG_TRACEPOINT_EVENT(block_bio_complete, + + TP_PROTO(struct request_queue *q, struct bio *bio, int error), + + TP_ARGS(q, bio, error), + + TP_FIELDS( +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) + ctf_integer(dev_t, dev, bio_dev(bio)) +#else + ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) + ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) + ctf_integer(int, error, error) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_bio_op(bio), lttng_bio_rw(bio), + bio->bi_iter.bi_size) +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(sector_t, sector, bio->bi_sector) + ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) + ctf_integer(int, error, error) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(block_bio_merge, + + TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio), + + TP_ARGS(q, rq, bio), + + TP_FIELDS( +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) + ctf_integer(dev_t, dev, bio_dev(bio)) +#else + ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) + ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_bio_op(bio), lttng_bio_rw(bio), + bio->bi_iter.bi_size) +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(sector_t, sector, bio->bi_sector) + ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(pid_t, tid, current->pid) + ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) + ) +) + +/** + * block_bio_backmerge - merging block operation to the end of an existing operation + * @q: queue holding operation + * @bio: new block operation to merge + * + * Merging block request @bio to the end of an existing block request + * in queue @q. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio_merge, block_bio_backmerge, + + TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio), + + TP_ARGS(q, rq, bio) +) + +/** + * block_bio_frontmerge - merging block operation to the beginning of an existing operation + * @q: queue holding operation + * @bio: new block operation to merge + * + * Merging block IO operation @bio to the beginning of an existing block + * operation in queue @q. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio_merge, block_bio_frontmerge, + + TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio), + + TP_ARGS(q, rq, bio) +) + +/** + * block_bio_queue - putting new block IO operation in queue + * @q: queue holding operation + * @bio: new block operation + * + * About to place the block IO operation @bio into queue @q. + */ +LTTNG_TRACEPOINT_EVENT(block_bio_queue, + + TP_PROTO(struct request_queue *q, struct bio *bio), + + TP_ARGS(q, bio), + + TP_FIELDS( +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) + ctf_integer(dev_t, dev, bio_dev(bio)) +#else + ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) + ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_bio_op(bio), lttng_bio_rw(bio), + bio->bi_iter.bi_size) +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(sector_t, sector, bio->bi_sector) + ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(pid_t, tid, current->pid) + ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) + ) +) +#else /* if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) */ +LTTNG_TRACEPOINT_EVENT_CLASS(block_bio, + + TP_PROTO(struct request_queue *q, struct bio *bio), + + TP_ARGS(q, bio), + + TP_FIELDS( + ctf_integer(dev_t, dev, bio->bi_bdev ? bio->bi_bdev->bd_dev : 0) + ctf_integer(sector_t, sector, bio->bi_sector) + ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) + ctf_integer(pid_t, tid, current->pid) + ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) + ) +) + +/** + * block_bio_backmerge - merging block operation to the end of an existing operation + * @q: queue holding operation + * @bio: new block operation to merge + * + * Merging block request @bio to the end of an existing block request + * in queue @q. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_backmerge, + + TP_PROTO(struct request_queue *q, struct bio *bio), + + TP_ARGS(q, bio) +) + +/** + * block_bio_frontmerge - merging block operation to the beginning of an existing operation + * @q: queue holding operation + * @bio: new block operation to merge + * + * Merging block IO operation @bio to the beginning of an existing block + * operation in queue @q. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_frontmerge, + + TP_PROTO(struct request_queue *q, struct bio *bio), + + TP_ARGS(q, bio) +) + +/** + * block_bio_queue - putting new block IO operation in queue + * @q: queue holding operation + * @bio: new block operation + * + * About to place the block IO operation @bio into queue @q. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_queue, + + TP_PROTO(struct request_queue *q, struct bio *bio), + + TP_ARGS(q, bio) +) +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) */ + +LTTNG_TRACEPOINT_EVENT_CLASS(block_get_rq, + + TP_PROTO(struct request_queue *q, struct bio *bio, int rw), + + TP_ARGS(q, bio, rw), + + TP_FIELDS( +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) + ctf_integer(dev_t, dev, bio ? bio_dev(bio) : 0) +#else + ctf_integer(dev_t, dev, bio ? bio->bi_bdev->bd_dev : 0) +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + ctf_integer(sector_t, sector, bio ? bio->bi_iter.bi_sector : 0) + ctf_integer(unsigned int, nr_sector, + bio ? bio_sectors(bio) : 0) + blk_rwbs_ctf_integer(unsigned int, rwbs, + bio ? lttng_bio_op(bio) : 0, + bio ? lttng_bio_rw(bio) : 0, + bio ? bio->bi_iter.bi_size : 0) +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(sector_t, sector, bio ? bio->bi_sector : 0) + ctf_integer(unsigned int, nr_sector, + bio ? bio->bi_size >> 9 : 0) + blk_rwbs_ctf_integer(unsigned int, rwbs, + bio ? lttng_bio_op(bio) : 0, + bio ? lttng_bio_rw(bio) : 0, + bio ? bio->bi_size : 0) +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(pid_t, tid, current->pid) + ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) + ) +) + +/** + * block_getrq - get a free request entry in queue for block IO operations + * @q: queue for operations + * @bio: pending block IO operation (can be %NULL) + * @rw: low bit indicates a read (%0) or a write (%1) + * + * A request struct for queue @q has been allocated to handle the + * block IO operation @bio. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(block_get_rq, block_getrq, + + TP_PROTO(struct request_queue *q, struct bio *bio, int rw), + + TP_ARGS(q, bio, rw) +) + +/** + * block_sleeprq - waiting to get a free request entry in queue for block IO operation + * @q: queue for operation + * @bio: pending block IO operation (can be %NULL) + * @rw: low bit indicates a read (%0) or a write (%1) + * + * In the case where a request struct cannot be provided for queue @q + * the process needs to wait for an request struct to become + * available. This tracepoint event is generated each time the + * process goes to sleep waiting for request struct become available. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(block_get_rq, block_sleeprq, + + TP_PROTO(struct request_queue *q, struct bio *bio, int rw), + + TP_ARGS(q, bio, rw) +) + +/** + * block_plug - keep operations requests in request queue + * @q: request queue to plug + * + * Plug the request queue @q. Do not allow block operation requests + * to be sent to the device driver. Instead, accumulate requests in + * the queue to improve throughput performance of the block device. + */ +LTTNG_TRACEPOINT_EVENT(block_plug, + + TP_PROTO(struct request_queue *q), + + TP_ARGS(q), + + TP_FIELDS( + ctf_integer(pid_t, tid, current->pid) + ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(block_unplug, + + TP_PROTO(struct request_queue *q, unsigned int depth, bool explicit), + + TP_ARGS(q, depth, explicit), + + TP_FIELDS( + ctf_integer(int, nr_rq, depth) + ctf_integer(pid_t, tid, current->pid) + ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) + ) +) + +/** + * block_unplug - release of operations requests in request queue + * @q: request queue to unplug + * @depth: number of requests just added to the queue + * @explicit: whether this was an explicit unplug, or one from schedule() + * + * Unplug request queue @q because device driver is scheduled to work + * on elements in the request queue. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(block_unplug, block_unplug, + + TP_PROTO(struct request_queue *q, unsigned int depth, bool explicit), + + TP_ARGS(q, depth, explicit) +) + +/** + * block_split - split a single bio struct into two bio structs + * @q: queue containing the bio + * @bio: block operation being split + * @new_sector: The starting sector for the new bio + * + * The bio request @bio in request queue @q needs to be split into two + * bio requests. The newly created @bio request starts at + * @new_sector. This split may be required due to hardware limitation + * such as operation crossing device boundaries in a RAID system. + */ +LTTNG_TRACEPOINT_EVENT(block_split, + + TP_PROTO(struct request_queue *q, struct bio *bio, + unsigned int new_sector), + + TP_ARGS(q, bio, new_sector), + + TP_FIELDS( +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) + ctf_integer(dev_t, dev, bio_dev(bio)) +#else + ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_bio_op(bio), lttng_bio_rw(bio), + bio->bi_iter.bi_size) +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(sector_t, sector, bio->bi_sector) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(sector_t, new_sector, new_sector) + ctf_integer(pid_t, tid, current->pid) + ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) + ) +) + +/** + * block_bio_remap - map request for a logical device to the raw device + * @q: queue holding the operation + * @bio: revised operation + * @dev: device for the operation + * @from: original sector for the operation + * + * An operation for a logical device has been mapped to the + * raw block device. + */ +LTTNG_TRACEPOINT_EVENT(block_bio_remap, + + TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev, + sector_t from), + + TP_ARGS(q, bio, dev, from), + + TP_FIELDS( +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) + ctf_integer(dev_t, dev, bio_dev(bio)) +#else + ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) + ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_bio_op(bio), lttng_bio_rw(bio), + bio->bi_iter.bi_size) +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(sector_t, sector, bio->bi_sector) + ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(dev_t, old_dev, dev) + ctf_integer(sector_t, old_sector, from) + ) +) + +/** + * block_rq_remap - map request for a block operation request + * @q: queue holding the operation + * @rq: block IO operation request + * @dev: device for the operation + * @from: original sector for the operation + * + * The block operation request @rq in @q has been remapped. The block + * operation request @rq holds the current information and @from hold + * the original sector. + */ +LTTNG_TRACEPOINT_EVENT(block_rq_remap, + + TP_PROTO(struct request_queue *q, struct request *rq, dev_t dev, + sector_t from), + + TP_ARGS(q, rq, dev, from), + + TP_FIELDS( + ctf_integer(dev_t, dev, disk_devt(rq->rq_disk)) + ctf_integer(sector_t, sector, blk_rq_pos(rq)) + ctf_integer(unsigned int, nr_sector, blk_rq_sectors(rq)) + ctf_integer(dev_t, old_dev, dev) + ctf_integer(sector_t, old_sector, from) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq)) + ) +) + +#undef __print_rwbs_flags +#undef blk_fill_rwbs + +#endif /* LTTNG_TRACE_BLOCK_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/btrfs.h b/include/instrumentation/events/btrfs.h new file mode 100644 index 00000000..f38444bf --- /dev/null +++ b/include/instrumentation/events/btrfs.h @@ -0,0 +1,2385 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM btrfs + +#if !defined(LTTNG_TRACE_BTRFS_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_BTRFS_H + +#include +#include +#include + +#ifndef _TRACE_BTRFS_DEF_ +#define _TRACE_BTRFS_DEF_ +struct btrfs_root; +struct btrfs_fs_info; +struct btrfs_inode; +struct extent_map; +struct btrfs_ordered_extent; +struct btrfs_delayed_ref_node; +struct btrfs_delayed_tree_ref; +struct btrfs_delayed_data_ref; +struct btrfs_delayed_ref_head; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) +struct btrfs_block_group; +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) +struct btrfs_block_group_cache; +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) +struct btrfs_free_cluster; +#endif +struct map_lookup; +struct extent_buffer; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) +struct extent_state; +#endif +#endif + +#define BTRFS_UUID_SIZE 16 + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)) +#define lttng_fs_info_fsid fs_info->fs_devices->fsid +#else +#define lttng_fs_info_fsid fs_info->fsid +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) +LTTNG_TRACEPOINT_EVENT(btrfs_transaction_commit, + + TP_PROTO(const struct btrfs_root *root), + + TP_ARGS(root), + + TP_FIELDS( + ctf_integer(u64, generation, root->fs_info->generation) + ctf_integer(u64, root_objectid, root->root_key.objectid) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__inode, + + TP_PROTO(const struct inode *inode), + + TP_ARGS(inode), + + TP_FIELDS( + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(blkcnt_t, blocks, inode->i_blocks) + ctf_integer(u64, disk_i_size, BTRFS_I(inode)->disk_i_size) + ctf_integer(u64, generation, BTRFS_I(inode)->generation) + ctf_integer(u64, last_trans, BTRFS_I(inode)->last_trans) + ctf_integer(u64, logged_trans, BTRFS_I(inode)->logged_trans) + ctf_integer(u64, root_objectid, + BTRFS_I(inode)->root->root_key.objectid) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_new, + + TP_PROTO(const struct inode *inode), + + TP_ARGS(inode) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_request, + + TP_PROTO(const struct inode *inode), + + TP_ARGS(inode) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_evict, + + TP_PROTO(const struct inode *inode), + + TP_ARGS(inode) +) +#else +LTTNG_TRACEPOINT_EVENT(btrfs_transaction_commit, + + TP_PROTO(struct btrfs_root *root), + + TP_ARGS(root), + + TP_FIELDS( + ctf_integer(u64, generation, root->fs_info->generation) + ctf_integer(u64, root_objectid, root->root_key.objectid) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__inode, + + TP_PROTO(struct inode *inode), + + TP_ARGS(inode), + + TP_FIELDS( + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(blkcnt_t, blocks, inode->i_blocks) + ctf_integer(u64, disk_i_size, BTRFS_I(inode)->disk_i_size) + ctf_integer(u64, generation, BTRFS_I(inode)->generation) + ctf_integer(u64, last_trans, BTRFS_I(inode)->last_trans) + ctf_integer(u64, logged_trans, BTRFS_I(inode)->logged_trans) + ctf_integer(u64, root_objectid, + BTRFS_I(inode)->root->root_key.objectid) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_new, + + TP_PROTO(struct inode *inode), + + TP_ARGS(inode) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_request, + + TP_PROTO(struct inode *inode), + + TP_ARGS(inode) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_evict, + + TP_PROTO(struct inode *inode), + + TP_ARGS(inode) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) + +LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, + + TP_PROTO(const struct btrfs_root *root, const struct btrfs_inode *inode, + const struct extent_map *map), + + TP_ARGS(root, inode, map), + + TP_FIELDS( + ctf_integer(u64, root_objectid, root->root_key.objectid) + ctf_integer(u64, ino, btrfs_ino(inode)) + ctf_integer(u64, start, map->start) + ctf_integer(u64, len, map->len) + ctf_integer(u64, orig_start, map->orig_start) + ctf_integer(u64, block_start, map->block_start) + ctf_integer(u64, block_len, map->block_len) + ctf_integer(unsigned long, flags, map->flags) + ctf_integer(int, refs, refcount_read(&map->refs)) + ctf_integer(unsigned int, compress_type, map->compress_type) + ) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) + +LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, + + TP_PROTO(struct btrfs_root *root, struct btrfs_inode *inode, + struct extent_map *map), + + TP_ARGS(root, inode, map), + + TP_FIELDS( + ctf_integer(u64, root_objectid, root->root_key.objectid) + ctf_integer(u64, ino, btrfs_ino(inode)) + ctf_integer(u64, start, map->start) + ctf_integer(u64, len, map->len) + ctf_integer(u64, orig_start, map->orig_start) + ctf_integer(u64, block_start, map->block_start) + ctf_integer(u64, block_len, map->block_len) + ctf_integer(unsigned long, flags, map->flags) + ctf_integer(int, refs, refcount_read(&map->refs)) + ctf_integer(unsigned int, compress_type, map->compress_type) + ) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) + +LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, + + TP_PROTO(struct btrfs_root *root, struct btrfs_inode *inode, + struct extent_map *map), + + TP_ARGS(root, inode, map), + + TP_FIELDS( + ctf_integer(u64, root_objectid, root->root_key.objectid) + ctf_integer(u64, ino, btrfs_ino(inode)) + ctf_integer(u64, start, map->start) + ctf_integer(u64, len, map->len) + ctf_integer(u64, orig_start, map->orig_start) + ctf_integer(u64, block_start, map->block_start) + ctf_integer(u64, block_len, map->block_len) + ctf_integer(unsigned long, flags, map->flags) + ctf_integer(int, refs, atomic_read(&map->refs)) + ctf_integer(unsigned int, compress_type, map->compress_type) + ) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) + +LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, + + TP_PROTO(struct btrfs_root *root, struct inode *inode, + struct extent_map *map), + + TP_ARGS(root, inode, map), + + TP_FIELDS( + ctf_integer(u64, root_objectid, root->root_key.objectid) + ctf_integer(u64, ino, btrfs_ino(inode)) + ctf_integer(u64, start, map->start) + ctf_integer(u64, len, map->len) + ctf_integer(u64, orig_start, map->orig_start) + ctf_integer(u64, block_start, map->block_start) + ctf_integer(u64, block_len, map->block_len) + ctf_integer(unsigned long, flags, map->flags) + ctf_integer(int, refs, atomic_read(&map->refs)) + ctf_integer(unsigned int, compress_type, map->compress_type) + ) +) + +#elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) + +LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, + + TP_PROTO(const struct btrfs_root *root, const struct extent_map *map), + + TP_ARGS(root, map), + + TP_FIELDS( + ctf_integer(u64, root_objectid, root->root_key.objectid) + ctf_integer(u64, start, map->start) + ctf_integer(u64, len, map->len) + ctf_integer(u64, orig_start, map->orig_start) + ctf_integer(u64, block_start, map->block_start) + ctf_integer(u64, block_len, map->block_len) + ctf_integer(unsigned long, flags, map->flags) + ctf_integer(int, refs, atomic_read(&map->refs)) + ctf_integer(unsigned int, compress_type, map->compress_type) + ) +) + +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ + +LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, + + TP_PROTO(struct btrfs_root *root, struct extent_map *map), + + TP_ARGS(root, map), + + TP_FIELDS( + ctf_integer(u64, root_objectid, root->root_key.objectid) + ctf_integer(u64, start, map->start) + ctf_integer(u64, len, map->len) + ctf_integer(u64, orig_start, map->orig_start) + ctf_integer(u64, block_start, map->block_start) + ctf_integer(u64, block_len, map->block_len) + ctf_integer(unsigned long, flags, map->flags) + ctf_integer(int, refs, atomic_read(&map->refs)) + ctf_integer(unsigned int, compress_type, map->compress_type) + ) +) + +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) +LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist, + + TP_PROTO(const struct btrfs_fs_info *fs_info, + const struct extent_map *existing, const struct extent_map *map, + u64 start, u64 len), + + TP_ARGS(fs_info, existing, map, start, len), + + TP_FIELDS( + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) + ctf_integer(u64, e_start, existing->start) + ctf_integer(u64, e_len, existing->len) + ctf_integer(u64, map_start, map->start) + ctf_integer(u64, map_len, map->len) + ctf_integer(u64, start, start) + ctf_integer(u64, len, len) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0)) +LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist, + + TP_PROTO(struct btrfs_fs_info *fs_info, + const struct extent_map *existing, const struct extent_map *map, + u64 start, u64 len), + + TP_ARGS(fs_info, existing, map, start, len), + + TP_FIELDS( + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) + ctf_integer(u64, e_start, existing->start) + ctf_integer(u64, e_len, existing->len) + ctf_integer(u64, map_start, map->start) + ctf_integer(u64, map_len, map->len) + ctf_integer(u64, start, start) + ctf_integer(u64, len, len) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) +LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist, + + TP_PROTO(const struct extent_map *existing, const struct extent_map *map, u64 start, u64 len), + + TP_ARGS(existing, map, start, len), + + TP_FIELDS( + ctf_integer(u64, e_start, existing->start) + ctf_integer(u64, e_len, existing->len) + ctf_integer(u64, map_start, map->start) + ctf_integer(u64, map_len, map->len) + ctf_integer(u64, start, start) + ctf_integer(u64, len, len) + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent, + + TP_PROTO(const struct inode *inode, + const struct btrfs_ordered_extent *ordered), + + TP_ARGS(inode, ordered), + + TP_FIELDS( + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(u64, file_offset, ordered->file_offset) + ctf_integer(u64, start, ordered->disk_bytenr) + ctf_integer(u64, len, ordered->num_bytes) + ctf_integer(u64, disk_len, ordered->disk_num_bytes) + ctf_integer(u64, bytes_left, ordered->bytes_left) + ctf_integer(unsigned long, flags, ordered->flags) + ctf_integer(int, compress_type, ordered->compress_type) + ctf_integer(int, refs, refcount_read(&ordered->refs)) + ctf_integer(u64, root_objectid, + BTRFS_I(inode)->root->root_key.objectid) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent, + + TP_PROTO(const struct inode *inode, + const struct btrfs_ordered_extent *ordered), + + TP_ARGS(inode, ordered), + + TP_FIELDS( + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(u64, file_offset, ordered->file_offset) + ctf_integer(u64, start, ordered->start) + ctf_integer(u64, len, ordered->len) + ctf_integer(u64, disk_len, ordered->disk_len) + ctf_integer(u64, bytes_left, ordered->bytes_left) + ctf_integer(unsigned long, flags, ordered->flags) + ctf_integer(int, compress_type, ordered->compress_type) + ctf_integer(int, refs, refcount_read(&ordered->refs)) + ctf_integer(u64, root_objectid, + BTRFS_I(inode)->root->root_key.objectid) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent, + + TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), + + TP_ARGS(inode, ordered), + + TP_FIELDS( + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(u64, file_offset, ordered->file_offset) + ctf_integer(u64, start, ordered->start) + ctf_integer(u64, len, ordered->len) + ctf_integer(u64, disk_len, ordered->disk_len) + ctf_integer(u64, bytes_left, ordered->bytes_left) + ctf_integer(unsigned long, flags, ordered->flags) + ctf_integer(int, compress_type, ordered->compress_type) + ctf_integer(int, refs, refcount_read(&ordered->refs)) + ctf_integer(u64, root_objectid, + BTRFS_I(inode)->root->root_key.objectid) + ) +) +#elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent, + + TP_PROTO(const struct inode *inode, const struct btrfs_ordered_extent *ordered), + + TP_ARGS(inode, ordered), + + TP_FIELDS( + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(u64, file_offset, ordered->file_offset) + ctf_integer(u64, start, ordered->start) + ctf_integer(u64, len, ordered->len) + ctf_integer(u64, disk_len, ordered->disk_len) + ctf_integer(u64, bytes_left, ordered->bytes_left) + ctf_integer(unsigned long, flags, ordered->flags) + ctf_integer(int, compress_type, ordered->compress_type) + ctf_integer(int, refs, atomic_read(&ordered->refs)) + ctf_integer(u64, root_objectid, + BTRFS_I(inode)->root->root_key.objectid) + ) +) +#else +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent, + + TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), + + TP_ARGS(inode, ordered), + + TP_FIELDS( + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(u64, file_offset, ordered->file_offset) + ctf_integer(u64, start, ordered->start) + ctf_integer(u64, len, ordered->len) + ctf_integer(u64, disk_len, ordered->disk_len) + ctf_integer(u64, bytes_left, ordered->bytes_left) + ctf_integer(unsigned long, flags, ordered->flags) + ctf_integer(int, compress_type, ordered->compress_type) + ctf_integer(int, refs, atomic_read(&ordered->refs)) + ctf_integer(u64, root_objectid, + BTRFS_I(inode)->root->root_key.objectid) + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add, + + TP_PROTO(const struct inode *inode, + const struct btrfs_ordered_extent *ordered), + + TP_ARGS(inode, ordered) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_remove, + + TP_PROTO(const struct inode *inode, + const struct btrfs_ordered_extent *ordered), + + TP_ARGS(inode, ordered) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_start, + + TP_PROTO(const struct inode *inode, + const struct btrfs_ordered_extent *ordered), + + TP_ARGS(inode, ordered) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put, + + TP_PROTO(const struct inode *inode, + const struct btrfs_ordered_extent *ordered), + + TP_ARGS(inode, ordered) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage, + + TP_PROTO(const struct page *page, const struct inode *inode, + const struct writeback_control *wbc), + + TP_ARGS(page, inode, wbc), + + TP_FIELDS( + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(pgoff_t, index, page->index) + ctf_integer(long, nr_to_write, wbc->nr_to_write) + ctf_integer(long, pages_skipped, wbc->pages_skipped) + ctf_integer(loff_t, range_start, wbc->range_start) + ctf_integer(loff_t, range_end, wbc->range_end) + ctf_integer(char, for_kupdate, wbc->for_kupdate) + ctf_integer(char, for_reclaim, wbc->for_reclaim) + ctf_integer(char, range_cyclic, wbc->range_cyclic) + ctf_integer(pgoff_t, writeback_index, + inode->i_mapping->writeback_index) + ctf_integer(u64, root_objectid, + BTRFS_I(inode)->root->root_key.objectid) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs__writepage, + + __extent_writepage, + + btrfs__extent_writepage, + + TP_PROTO(const struct page *page, const struct inode *inode, + const struct writeback_control *wbc), + + TP_ARGS(page, inode, wbc) +) + +LTTNG_TRACEPOINT_EVENT(btrfs_writepage_end_io_hook, + + TP_PROTO(const struct page *page, u64 start, u64 end, int uptodate), + + TP_ARGS(page, start, end, uptodate), + + TP_FIELDS( + ctf_integer(ino_t, ino, page->mapping->host->i_ino) + ctf_integer(pgoff_t, index, page->index) + ctf_integer(u64, start, start) + ctf_integer(u64, end, end) + ctf_integer(int, uptodate, uptodate) + ctf_integer(u64, root_objectid, + BTRFS_I(page->mapping->host)->root->root_key.objectid) + ) +) + +LTTNG_TRACEPOINT_EVENT(btrfs_sync_file, + + TP_PROTO(const struct file *file, int datasync), + + TP_ARGS(file, datasync), + + TP_FIELDS( + ctf_integer(ino_t, ino, file->f_path.dentry->d_inode->i_ino) + ctf_integer(ino_t, parent, file->f_path.dentry->d_parent->d_inode->i_ino) + ctf_integer(int, datasync, datasync) + ctf_integer(u64, root_objectid, + BTRFS_I(file->f_path.dentry->d_inode)->root->root_key.objectid) + ) +) +#else +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add, + + TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), + + TP_ARGS(inode, ordered) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_remove, + + TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), + + TP_ARGS(inode, ordered) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_start, + + TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), + + TP_ARGS(inode, ordered) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put, + + TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), + + TP_ARGS(inode, ordered) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage, + + TP_PROTO(struct page *page, struct inode *inode, + struct writeback_control *wbc), + + TP_ARGS(page, inode, wbc), + + TP_FIELDS( + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(pgoff_t, index, page->index) + ctf_integer(long, nr_to_write, wbc->nr_to_write) + ctf_integer(long, pages_skipped, wbc->pages_skipped) + ctf_integer(loff_t, range_start, wbc->range_start) + ctf_integer(loff_t, range_end, wbc->range_end) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)) + ctf_integer(char, nonblocking, wbc->nonblocking) +#endif + ctf_integer(char, for_kupdate, wbc->for_kupdate) + ctf_integer(char, for_reclaim, wbc->for_reclaim) + ctf_integer(char, range_cyclic, wbc->range_cyclic) + ctf_integer(pgoff_t, writeback_index, + inode->i_mapping->writeback_index) + ctf_integer(u64, root_objectid, + BTRFS_I(inode)->root->root_key.objectid) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs__writepage, + + __extent_writepage, + + btrfs__extent_writepage, + + TP_PROTO(struct page *page, struct inode *inode, + struct writeback_control *wbc), + + TP_ARGS(page, inode, wbc) +) + +LTTNG_TRACEPOINT_EVENT(btrfs_writepage_end_io_hook, + + TP_PROTO(struct page *page, u64 start, u64 end, int uptodate), + + TP_ARGS(page, start, end, uptodate), + + TP_FIELDS( + ctf_integer(ino_t, ino, page->mapping->host->i_ino) + ctf_integer(pgoff_t, index, page->index) + ctf_integer(u64, start, start) + ctf_integer(u64, end, end) + ctf_integer(int, uptodate, uptodate) + ctf_integer(u64, root_objectid, + BTRFS_I(page->mapping->host)->root->root_key.objectid) + ) +) + +LTTNG_TRACEPOINT_EVENT(btrfs_sync_file, + + TP_PROTO(struct file *file, int datasync), + + TP_ARGS(file, datasync), + + TP_FIELDS( + ctf_integer(ino_t, ino, file->f_path.dentry->d_inode->i_ino) + ctf_integer(ino_t, parent, file->f_path.dentry->d_parent->d_inode->i_ino) + ctf_integer(int, datasync, datasync) + ctf_integer(u64, root_objectid, + BTRFS_I(file->f_path.dentry->d_inode)->root->root_key.objectid) + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,103,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,114,94,0,0, 4,4,114,95,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,120,94,0,0, 4,4,120,95,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,126,94,0,0, 4,5,0,0,0,0)) +LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs, + + TP_PROTO(const struct btrfs_fs_info *fs_info, int wait), + + TP_ARGS(fs_info, wait), + + TP_FIELDS( + ctf_integer(int, wait, wait) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) +LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs, + + TP_PROTO(struct btrfs_fs_info *fs_info, int wait), + + TP_ARGS(fs_info, wait), + + TP_FIELDS( + ctf_integer(int, wait, wait) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs, + + TP_PROTO(int wait), + + TP_ARGS(wait), + + TP_FIELDS( + ctf_integer(int, wait, wait) + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) +LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group, + + TP_PROTO(const struct btrfs_fs_info *fs_info, + const struct btrfs_block_group *block_group, int create), + + TP_ARGS(fs_info, block_group, create), + + TP_FIELDS( + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) + ctf_integer(u64, offset, block_group->start) + ctf_integer(u64, size, block_group->length) + ctf_integer(u64, flags, block_group->flags) + ctf_integer(u64, bytes_used, block_group->used) + ctf_integer(u64, bytes_super, block_group->bytes_super) + ctf_integer(int, create, create) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) +LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group, + + TP_PROTO(const struct btrfs_fs_info *fs_info, + const struct btrfs_block_group_cache *block_group, int create), + + TP_ARGS(fs_info, block_group, create), + + TP_FIELDS( + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) + ctf_integer(u64, offset, block_group->key.objectid) + ctf_integer(u64, size, block_group->key.offset) + ctf_integer(u64, flags, block_group->flags) + ctf_integer(u64, bytes_used, btrfs_block_group_used(&block_group->item)) + ctf_integer(u64, bytes_super, block_group->bytes_super) + ctf_integer(int, create, create) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group, + + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_block_group_cache *block_group, int create), + + TP_ARGS(fs_info, block_group, create), + + TP_FIELDS( + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) + ctf_integer(u64, offset, block_group->key.objectid) + ctf_integer(u64, size, block_group->key.offset) + ctf_integer(u64, flags, block_group->flags) + ctf_integer(u64, bytes_used, btrfs_block_group_used(&block_group->item)) + ctf_integer(u64, bytes_super, block_group->bytes_super) + ctf_integer(int, create, create) + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,103,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,114,94,0,0, 4,4,114,95,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,120,94,0,0, 4,4,120,95,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,126,94,0,0, 4,5,0,0,0,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref, + + TP_PROTO(const struct btrfs_fs_info *fs_info, + const struct btrfs_delayed_ref_node *ref, + const struct btrfs_delayed_tree_ref *full_ref, + int action), + + TP_ARGS(fs_info, ref, full_ref, action), + + TP_FIELDS( + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) + ctf_integer(u64, bytenr, ref->bytenr) + ctf_integer(u64, num_bytes, ref->num_bytes) + ctf_integer(int, action, action) + ctf_integer(u64, parent, full_ref->parent) + ctf_integer(u64, ref_root, full_ref->root) + ctf_integer(int, level, full_ref->level) + ctf_integer(int, type, ref->type) + ctf_integer(u64, seq, ref->seq) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, + + add_delayed_tree_ref, + + btrfs_add_delayed_tree_ref, + + TP_PROTO(const struct btrfs_fs_info *fs_info, + const struct btrfs_delayed_ref_node *ref, + const struct btrfs_delayed_tree_ref *full_ref, + int action), + + TP_ARGS(fs_info, ref, full_ref, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, + + run_delayed_tree_ref, + + btrfs_run_delayed_tree_ref, + + TP_PROTO(const struct btrfs_fs_info *fs_info, + const struct btrfs_delayed_ref_node *ref, + const struct btrfs_delayed_tree_ref *full_ref, + int action), + + TP_ARGS(fs_info, ref, full_ref, action) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref, + + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_tree_ref *full_ref, + int action), + + TP_ARGS(fs_info, ref, full_ref, action), + + TP_FIELDS( + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) + ctf_integer(u64, bytenr, ref->bytenr) + ctf_integer(u64, num_bytes, ref->num_bytes) + ctf_integer(int, action, action) + ctf_integer(u64, parent, full_ref->parent) + ctf_integer(u64, ref_root, full_ref->root) + ctf_integer(int, level, full_ref->level) + ctf_integer(int, type, ref->type) + ctf_integer(u64, seq, ref->seq) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, + + add_delayed_tree_ref, + + btrfs_add_delayed_tree_ref, + + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_tree_ref *full_ref, + int action), + + TP_ARGS(fs_info, ref, full_ref, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, + + run_delayed_tree_ref, + + btrfs_run_delayed_tree_ref, + + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_tree_ref *full_ref, + int action), + + TP_ARGS(fs_info, ref, full_ref, action) +) +#elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,92,0,0, 4,5,0,0,0,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref, + + TP_PROTO(const struct btrfs_delayed_ref_node *ref, + const struct btrfs_delayed_tree_ref *full_ref, + int action), + + TP_ARGS(ref, full_ref, action), + + TP_FIELDS( + ctf_integer(u64, bytenr, ref->bytenr) + ctf_integer(u64, num_bytes, ref->num_bytes) + ctf_integer(int, action, action) + ctf_integer(u64, parent, full_ref->parent) + ctf_integer(u64, ref_root, full_ref->root) + ctf_integer(int, level, full_ref->level) + ctf_integer(int, type, ref->type) + ctf_integer(u64, seq, ref->seq) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, + + add_delayed_tree_ref, + + btrfs_add_delayed_tree_ref, + + TP_PROTO(const struct btrfs_delayed_ref_node *ref, + const struct btrfs_delayed_tree_ref *full_ref, + int action), + + TP_ARGS(ref, full_ref, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, + + run_delayed_tree_ref, + + btrfs_run_delayed_tree_ref, + + TP_PROTO(const struct btrfs_delayed_ref_node *ref, + const struct btrfs_delayed_tree_ref *full_ref, + int action), + + TP_ARGS(ref, full_ref, action) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref, + + TP_PROTO(struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_tree_ref *full_ref, + int action), + + TP_ARGS(ref, full_ref, action), + + TP_FIELDS( + ctf_integer(u64, bytenr, ref->bytenr) + ctf_integer(u64, num_bytes, ref->num_bytes) + ctf_integer(int, action, action) + ctf_integer(u64, parent, full_ref->parent) + ctf_integer(u64, ref_root, full_ref->root) + ctf_integer(int, level, full_ref->level) + ctf_integer(int, type, ref->type) + ctf_integer(u64, seq, ref->seq) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, + + add_delayed_tree_ref, + + btrfs_add_delayed_tree_ref, + + TP_PROTO(struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_tree_ref *full_ref, + int action), + + TP_ARGS(ref, full_ref, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, + + run_delayed_tree_ref, + + btrfs_run_delayed_tree_ref, + + TP_PROTO(struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_tree_ref *full_ref, + int action), + + TP_ARGS(ref, full_ref, action) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)) +LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref, + + TP_PROTO(struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_tree_ref *full_ref, + int action), + + TP_ARGS(ref, full_ref, action), + + TP_FIELDS( + ctf_integer(u64, bytenr, ref->bytenr) + ctf_integer(u64, num_bytes, ref->num_bytes) + ctf_integer(int, action, action) + ctf_integer(u64, parent, full_ref->parent) + ctf_integer(u64, ref_root, full_ref->root) + ctf_integer(int, level, full_ref->level) + ctf_integer(int, type, ref->type) + ctf_integer(u64, seq, ref->seq) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref, + + TP_PROTO(struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_tree_ref *full_ref, + int action), + + TP_ARGS(ref, full_ref, action), + + TP_FIELDS( + ctf_integer(u64, bytenr, ref->bytenr) + ctf_integer(u64, num_bytes, ref->num_bytes) + ctf_integer(int, action, action) + ctf_integer(u64, parent, full_ref->parent) + ctf_integer(u64, ref_root, full_ref->root) + ctf_integer(int, level, full_ref->level) + ctf_integer(int, type, ref->type) + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,103,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,114,94,0,0, 4,4,114,95,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,120,94,0,0, 4,4,120,95,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,126,94,0,0, 4,5,0,0,0,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref, + + TP_PROTO(const struct btrfs_fs_info *fs_info, + const struct btrfs_delayed_ref_node *ref, + const struct btrfs_delayed_data_ref *full_ref, + int action), + + TP_ARGS(fs_info, ref, full_ref, action), + + TP_FIELDS( + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) + ctf_integer(u64, bytenr, ref->bytenr) + ctf_integer(u64, num_bytes, ref->num_bytes) + ctf_integer(int, action, action) + ctf_integer(u64, parent, full_ref->parent) + ctf_integer(u64, ref_root, full_ref->root) + ctf_integer(u64, owner, full_ref->objectid) + ctf_integer(u64, offset, full_ref->offset) + ctf_integer(int, type, ref->type) + ctf_integer(u64, seq, ref->seq) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, + + add_delayed_data_ref, + + btrfs_add_delayed_data_ref, + + TP_PROTO(const struct btrfs_fs_info *fs_info, + const struct btrfs_delayed_ref_node *ref, + const struct btrfs_delayed_data_ref *full_ref, + int action), + + TP_ARGS(fs_info, ref, full_ref, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, + + run_delayed_data_ref, + + btrfs_run_delayed_data_ref, + + TP_PROTO(const struct btrfs_fs_info *fs_info, + const struct btrfs_delayed_ref_node *ref, + const struct btrfs_delayed_data_ref *full_ref, + int action), + + TP_ARGS(fs_info, ref, full_ref, action) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref, + + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_data_ref *full_ref, + int action), + + TP_ARGS(fs_info, ref, full_ref, action), + + TP_FIELDS( + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) + ctf_integer(u64, bytenr, ref->bytenr) + ctf_integer(u64, num_bytes, ref->num_bytes) + ctf_integer(int, action, action) + ctf_integer(u64, parent, full_ref->parent) + ctf_integer(u64, ref_root, full_ref->root) + ctf_integer(u64, owner, full_ref->objectid) + ctf_integer(u64, offset, full_ref->offset) + ctf_integer(int, type, ref->type) + ctf_integer(u64, seq, ref->seq) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, + + add_delayed_data_ref, + + btrfs_add_delayed_data_ref, + + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_data_ref *full_ref, + int action), + + TP_ARGS(fs_info, ref, full_ref, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, + + run_delayed_data_ref, + + btrfs_run_delayed_data_ref, + + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_data_ref *full_ref, + int action), + + TP_ARGS(fs_info, ref, full_ref, action) +) +#elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,92,0,0, 4,5,0,0,0,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref, + + TP_PROTO(const struct btrfs_delayed_ref_node *ref, + const struct btrfs_delayed_data_ref *full_ref, + int action), + + TP_ARGS(ref, full_ref, action), + + TP_FIELDS( + ctf_integer(u64, bytenr, ref->bytenr) + ctf_integer(u64, num_bytes, ref->num_bytes) + ctf_integer(int, action, action) + ctf_integer(u64, parent, full_ref->parent) + ctf_integer(u64, ref_root, full_ref->root) + ctf_integer(u64, owner, full_ref->objectid) + ctf_integer(u64, offset, full_ref->offset) + ctf_integer(int, type, ref->type) + ctf_integer(u64, seq, ref->seq) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, + + add_delayed_data_ref, + + btrfs_add_delayed_data_ref, + + TP_PROTO(const struct btrfs_delayed_ref_node *ref, + const struct btrfs_delayed_data_ref *full_ref, + int action), + + TP_ARGS(fs_info, ref, full_ref, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, + + run_delayed_data_ref, + + btrfs_run_delayed_data_ref, + + TP_PROTO(const struct btrfs_delayed_ref_node *ref, + const struct btrfs_delayed_data_ref *full_ref, + int action), + + TP_ARGS(fs_info, ref, full_ref, action) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref, + + TP_PROTO(struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_data_ref *full_ref, + int action), + + TP_ARGS(ref, full_ref, action), + + TP_FIELDS( + ctf_integer(u64, bytenr, ref->bytenr) + ctf_integer(u64, num_bytes, ref->num_bytes) + ctf_integer(int, action, action) + ctf_integer(u64, parent, full_ref->parent) + ctf_integer(u64, ref_root, full_ref->root) + ctf_integer(u64, owner, full_ref->objectid) + ctf_integer(u64, offset, full_ref->offset) + ctf_integer(int, type, ref->type) + ctf_integer(u64, seq, ref->seq) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, + + add_delayed_data_ref, + + btrfs_add_delayed_data_ref, + + TP_PROTO(struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_data_ref *full_ref, + int action), + + TP_ARGS(fs_info, ref, full_ref, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, + + run_delayed_data_ref, + + btrfs_run_delayed_data_ref, + + TP_PROTO(struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_data_ref *full_ref, + int action), + + TP_ARGS(fs_info, ref, full_ref, action) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)) +LTTNG_TRACEPOINT_EVENT(btrfs_delayed_data_ref, + + TP_PROTO(struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_data_ref *full_ref, + int action), + + TP_ARGS(ref, full_ref, action), + + TP_FIELDS( + ctf_integer(u64, bytenr, ref->bytenr) + ctf_integer(u64, num_bytes, ref->num_bytes) + ctf_integer(int, action, action) + ctf_integer(u64, parent, full_ref->parent) + ctf_integer(u64, ref_root, full_ref->root) + ctf_integer(u64, owner, full_ref->objectid) + ctf_integer(u64, offset, full_ref->offset) + ctf_integer(int, type, ref->type) + ctf_integer(u64, seq, ref->seq) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(btrfs_delayed_data_ref, + + TP_PROTO(struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_data_ref *full_ref, + int action), + + TP_ARGS(ref, full_ref, action), + + TP_FIELDS( + ctf_integer(u64, bytenr, ref->bytenr) + ctf_integer(u64, num_bytes, ref->num_bytes) + ctf_integer(int, action, action) + ctf_integer(u64, parent, full_ref->parent) + ctf_integer(u64, ref_root, full_ref->root) + ctf_integer(u64, owner, full_ref->objectid) + ctf_integer(u64, offset, full_ref->offset) + ctf_integer(int, type, ref->type) + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, + + TP_PROTO(const struct btrfs_fs_info *fs_info, + const struct btrfs_delayed_ref_head *head_ref, + int action), + + TP_ARGS(fs_info, head_ref, action), + + TP_FIELDS( + ctf_integer(u64, bytenr, head_ref->bytenr) + ctf_integer(u64, num_bytes, head_ref->num_bytes) + ctf_integer(int, action, action) + ctf_integer(int, is_data, head_ref->is_data) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, + + add_delayed_ref_head, + + btrfs_add_delayed_ref_head, + + TP_PROTO(const struct btrfs_fs_info *fs_info, + const struct btrfs_delayed_ref_head *head_ref, + int action), + + TP_ARGS(fs_info, head_ref, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, + + run_delayed_ref_head, + + btrfs_run_delayed_ref_head, + + TP_PROTO(const struct btrfs_fs_info *fs_info, + const struct btrfs_delayed_ref_head *head_ref, + int action), + + TP_ARGS(fs_info, head_ref, action) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,103,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,114,94,0,0, 4,4,114,95,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,120,94,0,0, 4,4,120,95,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,126,94,0,0, 4,5,0,0,0,0)) + +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, + + TP_PROTO(const struct btrfs_fs_info *fs_info, + const struct btrfs_delayed_ref_node *ref, + const struct btrfs_delayed_ref_head *head_ref, + int action), + + TP_ARGS(fs_info, ref, head_ref, action), + + TP_FIELDS( + ctf_integer(u64, bytenr, ref->bytenr) + ctf_integer(u64, num_bytes, ref->num_bytes) + ctf_integer(int, action, action) + ctf_integer(int, is_data, head_ref->is_data) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, + + add_delayed_ref_head, + + btrfs_add_delayed_ref_head, + + TP_PROTO(const struct btrfs_fs_info *fs_info, + const struct btrfs_delayed_ref_node *ref, + const struct btrfs_delayed_ref_head *head_ref, + int action), + + TP_ARGS(fs_info, ref, head_ref, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, + + run_delayed_ref_head, + + btrfs_run_delayed_ref_head, + + TP_PROTO(const struct btrfs_fs_info *fs_info, + const struct btrfs_delayed_ref_node *ref, + const struct btrfs_delayed_ref_head *head_ref, + int action), + + TP_ARGS(fs_info, ref, head_ref, action) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, + + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_ref_head *head_ref, + int action), + + TP_ARGS(fs_info, ref, head_ref, action), + + TP_FIELDS( + ctf_integer(u64, bytenr, ref->bytenr) + ctf_integer(u64, num_bytes, ref->num_bytes) + ctf_integer(int, action, action) + ctf_integer(int, is_data, head_ref->is_data) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, + + add_delayed_ref_head, + + btrfs_add_delayed_ref_head, + + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_ref_head *head_ref, + int action), + + TP_ARGS(fs_info, ref, head_ref, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, + + run_delayed_ref_head, + + btrfs_run_delayed_ref_head, + + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_ref_head *head_ref, + int action), + + TP_ARGS(fs_info, ref, head_ref, action) +) + +#elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,92,0,0, 4,5,0,0,0,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, + + TP_PROTO(const struct btrfs_delayed_ref_node *ref, + const struct btrfs_delayed_ref_head *head_ref, + int action), + + TP_ARGS(ref, head_ref, action), + + TP_FIELDS( + ctf_integer(u64, bytenr, ref->bytenr) + ctf_integer(u64, num_bytes, ref->num_bytes) + ctf_integer(int, action, action) + ctf_integer(int, is_data, head_ref->is_data) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, + + add_delayed_ref_head, + + btrfs_add_delayed_ref_head, + + TP_PROTO(const struct btrfs_delayed_ref_node *ref, + const struct btrfs_delayed_ref_head *head_ref, + int action), + + TP_ARGS(ref, head_ref, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, + + run_delayed_ref_head, + + btrfs_run_delayed_ref_head, + + TP_PROTO(const struct btrfs_delayed_ref_node *ref, + const struct btrfs_delayed_ref_head *head_ref, + int action), + + TP_ARGS(ref, head_ref, action) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, + + TP_PROTO(struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_ref_head *head_ref, + int action), + + TP_ARGS(ref, head_ref, action), + + TP_FIELDS( + ctf_integer(u64, bytenr, ref->bytenr) + ctf_integer(u64, num_bytes, ref->num_bytes) + ctf_integer(int, action, action) + ctf_integer(int, is_data, head_ref->is_data) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, + + add_delayed_ref_head, + + btrfs_add_delayed_ref_head, + + TP_PROTO(struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_ref_head *head_ref, + int action), + + TP_ARGS(ref, head_ref, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, + + run_delayed_ref_head, + + btrfs_run_delayed_ref_head, + + TP_PROTO(struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_ref_head *head_ref, + int action), + + TP_ARGS(ref, head_ref, action) +) + +#else +LTTNG_TRACEPOINT_EVENT(btrfs_delayed_ref_head, + + TP_PROTO(struct btrfs_delayed_ref_node *ref, + struct btrfs_delayed_ref_head *head_ref, + int action), + + TP_ARGS(ref, head_ref, action), + + TP_FIELDS( + ctf_integer(u64, bytenr, ref->bytenr) + ctf_integer(u64, num_bytes, ref->num_bytes) + ctf_integer(int, action, action) + ctf_integer(int, is_data, head_ref->is_data) + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) + +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk, + + TP_PROTO(const struct btrfs_fs_info *fs_info, const struct map_lookup *map, + u64 offset, u64 size), + + TP_ARGS(fs_info, map, offset, size), + + TP_FIELDS( + ctf_integer(int, num_stripes, map->num_stripes) + ctf_integer(u64, type, map->type) + ctf_integer(int, sub_stripes, map->sub_stripes) + ctf_integer(u64, offset, offset) + ctf_integer(u64, size, size) + ctf_integer(u64, root_objectid, fs_info->chunk_root->root_key.objectid) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc, + + TP_PROTO(const struct btrfs_fs_info *fs_info, const struct map_lookup *map, + u64 offset, u64 size), + + TP_ARGS(fs_info, map, offset, size) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free, + + TP_PROTO(const struct btrfs_fs_info *fs_info, const struct map_lookup *map, + u64 offset, u64 size), + + TP_ARGS(fs_info, map, offset, size) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) + +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk, + + TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map, + u64 offset, u64 size), + + TP_ARGS(fs_info, map, offset, size), + + TP_FIELDS( + ctf_integer(int, num_stripes, map->num_stripes) + ctf_integer(u64, type, map->type) + ctf_integer(int, sub_stripes, map->sub_stripes) + ctf_integer(u64, offset, offset) + ctf_integer(u64, size, size) + ctf_integer(u64, root_objectid, fs_info->chunk_root->root_key.objectid) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc, + + TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map, + u64 offset, u64 size), + + TP_ARGS(fs_info, map, offset, size) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free, + + TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map, + u64 offset, u64 size), + + TP_ARGS(fs_info, map, offset, size) +) + +#elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) + +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk, + + TP_PROTO(const struct btrfs_root *root, const struct map_lookup *map, + u64 offset, u64 size), + + TP_ARGS(root, map, offset, size), + + TP_FIELDS( + ctf_integer(int, num_stripes, map->num_stripes) + ctf_integer(u64, type, map->type) + ctf_integer(int, sub_stripes, map->sub_stripes) + ctf_integer(u64, offset, offset) + ctf_integer(u64, size, size) + ctf_integer(u64, root_objectid, root->root_key.objectid) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc, + + TP_PROTO(const struct btrfs_root *root, const struct map_lookup *map, + u64 offset, u64 size), + + TP_ARGS(root, map, offset, size) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free, + + TP_PROTO(const struct btrfs_root *root, const struct map_lookup *map, + u64 offset, u64 size), + + TP_ARGS(root, map, offset, size) +) + +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ + +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk, + + TP_PROTO(struct btrfs_root *root, struct map_lookup *map, + u64 offset, u64 size), + + TP_ARGS(root, map, offset, size), + + TP_FIELDS( + ctf_integer(int, num_stripes, map->num_stripes) + ctf_integer(u64, type, map->type) + ctf_integer(int, sub_stripes, map->sub_stripes) + ctf_integer(u64, offset, offset) + ctf_integer(u64, size, size) + ctf_integer(u64, root_objectid, root->root_key.objectid) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc, + + TP_PROTO(struct btrfs_root *root, struct map_lookup *map, + u64 offset, u64 size), + + TP_ARGS(root, map, offset, size) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free, + + TP_PROTO(struct btrfs_root *root, struct map_lookup *map, + u64 offset, u64 size), + + TP_ARGS(root, map, offset, size) +) + +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) +LTTNG_TRACEPOINT_EVENT(btrfs_cow_block, + + TP_PROTO(const struct btrfs_root *root, const struct extent_buffer *buf, + const struct extent_buffer *cow), + + TP_ARGS(root, buf, cow), + + TP_FIELDS( + ctf_integer(u64, root_objectid, root->root_key.objectid) + ctf_integer(u64, buf_start, buf->start) + ctf_integer(int, refs, atomic_read(&buf->refs)) + ctf_integer(u64, cow_start, cow->start) + ctf_integer(int, buf_level, btrfs_header_level(buf)) + ctf_integer(int, cow_level, btrfs_header_level(cow)) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(btrfs_cow_block, + + TP_PROTO(struct btrfs_root *root, struct extent_buffer *buf, + struct extent_buffer *cow), + + TP_ARGS(root, buf, cow), + + TP_FIELDS( + ctf_integer(u64, root_objectid, root->root_key.objectid) + ctf_integer(u64, buf_start, buf->start) + ctf_integer(int, refs, atomic_read(&buf->refs)) + ctf_integer(u64, cow_start, cow->start) + ctf_integer(int, buf_level, btrfs_header_level(buf)) + ctf_integer(int, cow_level, btrfs_header_level(cow)) + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) +LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation, + + TP_PROTO(const struct btrfs_fs_info *fs_info, const char *type, u64 val, + u64 bytes, int reserve), + + TP_ARGS(fs_info, type, val, bytes, reserve), + + TP_FIELDS( + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) + ctf_string(type, type) + ctf_integer(u64, val, val) + ctf_integer(u64, bytes, bytes) + ctf_integer(int, reserve, reserve) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) +LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation, + + TP_PROTO(const struct btrfs_fs_info *fs_info, char *type, u64 val, + u64 bytes, int reserve), + + TP_ARGS(fs_info, type, val, bytes, reserve), + + TP_FIELDS( + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) + ctf_string(type, type) + ctf_integer(u64, val, val) + ctf_integer(u64, bytes, bytes) + ctf_integer(int, reserve, reserve) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) +LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation, + + TP_PROTO(struct btrfs_fs_info *fs_info, char *type, u64 val, + u64 bytes, int reserve), + + TP_ARGS(fs_info, type, val, bytes, reserve), + + TP_FIELDS( + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) + ctf_string(type, type) + ctf_integer(u64, val, val) + ctf_integer(u64, bytes, bytes) + ctf_integer(int, reserve, reserve) + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) + +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, + + TP_PROTO(const struct btrfs_fs_info *fs_info, u64 start, u64 len), + + TP_ARGS(fs_info, start, len), + + TP_FIELDS( + ctf_integer(u64, start, start) + ctf_integer(u64, len, len) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc, + + TP_PROTO(const struct btrfs_fs_info *fs_info, u64 start, u64 len), + + TP_ARGS(fs_info, start, len) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free, + + TP_PROTO(const struct btrfs_fs_info *fs_info, u64 start, u64 len), + + TP_ARGS(fs_info, start, len) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) + +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, + + TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len), + + TP_ARGS(fs_info, start, len), + + TP_FIELDS( + ctf_integer(u64, start, start) + ctf_integer(u64, len, len) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc, + + TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len), + + TP_ARGS(fs_info, start, len) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free, + + TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len), + + TP_ARGS(fs_info, start, len) +) + +#elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) + +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, + + TP_PROTO(const struct btrfs_root *root, u64 start, u64 len), + + TP_ARGS(root, start, len), + + TP_FIELDS( + ctf_integer(u64, root_objectid, root->root_key.objectid) + ctf_integer(u64, start, start) + ctf_integer(u64, len, len) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc, + + TP_PROTO(const struct btrfs_root *root, u64 start, u64 len), + + TP_ARGS(root, start, len) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free, + + TP_PROTO(const struct btrfs_root *root, u64 start, u64 len), + + TP_ARGS(root, start, len) +) + +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ + +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, + + TP_PROTO(struct btrfs_root *root, u64 start, u64 len), + + TP_ARGS(root, start, len), + + TP_FIELDS( + ctf_integer(u64, root_objectid, root->root_key.objectid) + ctf_integer(u64, start, start) + ctf_integer(u64, len, len) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc, + + TP_PROTO(struct btrfs_root *root, u64 start, u64 len), + + TP_ARGS(root, start, len) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free, + + TP_PROTO(struct btrfs_root *root, u64 start, u64 len), + + TP_ARGS(root, start, len) +) + +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) +LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, + + btrfs_find_free_extent, + + TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size, + u64 data), + + TP_ARGS(fs_info, num_bytes, empty_size, data), + + TP_FIELDS( + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) + ctf_integer(u64, num_bytes, num_bytes) + ctf_integer(u64, empty_size, empty_size) + ctf_integer(u64, data, data) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, + + TP_PROTO(const struct btrfs_block_group *block_group, u64 start, + u64 len), + + TP_ARGS(block_group, start, len), + + TP_FIELDS( + ctf_array(u8, fsid, block_group->lttng_fs_info_fsid, BTRFS_UUID_SIZE) + ctf_integer(u64, bg_objectid, block_group->start) + ctf_integer(u64, flags, block_group->flags) + ctf_integer(u64, start, start) + ctf_integer(u64, len, len) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, + + TP_PROTO(const struct btrfs_block_group *block_group, u64 start, + u64 len), + + TP_ARGS(block_group, start, len) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, + + TP_PROTO(const struct btrfs_block_group *block_group, u64 start, + u64 len), + + TP_ARGS(block_group, start, len) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0)) +LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, + + btrfs_find_free_extent, + + TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size, + u64 data), + + TP_ARGS(fs_info, num_bytes, empty_size, data), + + TP_FIELDS( + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) + ctf_integer(u64, num_bytes, num_bytes) + ctf_integer(u64, empty_size, empty_size) + ctf_integer(u64, data, data) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, + + TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start, + u64 len), + + TP_ARGS(block_group, start, len), + + TP_FIELDS( + ctf_array(u8, fsid, block_group->lttng_fs_info_fsid, BTRFS_UUID_SIZE) + ctf_integer(u64, bg_objectid, block_group->key.objectid) + ctf_integer(u64, flags, block_group->flags) + ctf_integer(u64, start, start) + ctf_integer(u64, len, len) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, + + TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start, + u64 len), + + TP_ARGS(block_group, start, len) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, + + TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start, + u64 len), + + TP_ARGS(block_group, start, len) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) +LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, + + btrfs_find_free_extent, + + TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size, + u64 data), + + TP_ARGS(fs_info, num_bytes, empty_size, data), + + TP_FIELDS( + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) + ctf_integer(u64, num_bytes, num_bytes) + ctf_integer(u64, empty_size, empty_size) + ctf_integer(u64, data, data) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, + + TP_PROTO(const struct btrfs_fs_info *fs_info, + const struct btrfs_block_group_cache *block_group, u64 start, + u64 len), + + TP_ARGS(fs_info, block_group, start, len), + + TP_FIELDS( + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) + ctf_integer(u64, bg_objectid, block_group->key.objectid) + ctf_integer(u64, flags, block_group->flags) + ctf_integer(u64, start, start) + ctf_integer(u64, len, len) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, + + TP_PROTO(const struct btrfs_fs_info *fs_info, + const struct btrfs_block_group_cache *block_group, u64 start, + u64 len), + + TP_ARGS(fs_info, block_group, start, len) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, + + TP_PROTO(const struct btrfs_fs_info *fs_info, + const struct btrfs_block_group_cache *block_group, u64 start, + u64 len), + + TP_ARGS(fs_info, block_group, start, len) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) + +LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, + + btrfs_find_free_extent, + + TP_PROTO(struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size, + u64 data), + + TP_ARGS(fs_info, num_bytes, empty_size, data), + + TP_FIELDS( + ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) + ctf_integer(u64, num_bytes, num_bytes) + ctf_integer(u64, empty_size, empty_size) + ctf_integer(u64, data, data) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, + + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_block_group_cache *block_group, u64 start, + u64 len), + + TP_ARGS(fs_info, block_group, start, len), + + TP_FIELDS( + ctf_integer(u64, bg_objectid, block_group->key.objectid) + ctf_integer(u64, flags, block_group->flags) + ctf_integer(u64, start, start) + ctf_integer(u64, len, len) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, + + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_block_group_cache *block_group, u64 start, + u64 len), + + TP_ARGS(fs_info, block_group, start, len) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, + + TP_PROTO(struct btrfs_fs_info *fs_info, + struct btrfs_block_group_cache *block_group, u64 start, + u64 len), + + TP_ARGS(fs_info, block_group, start, len) +) +#elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) + +LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, + + btrfs_find_free_extent, + + TP_PROTO(const struct btrfs_root *root, u64 num_bytes, u64 empty_size, + u64 data), + + TP_ARGS(root, num_bytes, empty_size, data), + + TP_FIELDS( + ctf_integer(u64, root_objectid, root->root_key.objectid) + ctf_integer(u64, num_bytes, num_bytes) + ctf_integer(u64, empty_size, empty_size) + ctf_integer(u64, data, data) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, + + TP_PROTO(const struct btrfs_root *root, + const struct btrfs_block_group_cache *block_group, u64 start, + u64 len), + + TP_ARGS(root, block_group, start, len), + + TP_FIELDS( + ctf_integer(u64, root_objectid, root->root_key.objectid) + ctf_integer(u64, bg_objectid, block_group->key.objectid) + ctf_integer(u64, flags, block_group->flags) + ctf_integer(u64, start, start) + ctf_integer(u64, len, len) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, + + TP_PROTO(const struct btrfs_root *root, + const struct btrfs_block_group_cache *block_group, u64 start, + u64 len), + + TP_ARGS(root, block_group, start, len) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, + + TP_PROTO(const struct btrfs_root *root, + const struct btrfs_block_group_cache *block_group, u64 start, + u64 len), + + TP_ARGS(root, block_group, start, len) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) + +LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, + + btrfs_find_free_extent, + + TP_PROTO(struct btrfs_root *root, u64 num_bytes, u64 empty_size, + u64 data), + + TP_ARGS(root, num_bytes, empty_size, data), + + TP_FIELDS( + ctf_integer(u64, root_objectid, root->root_key.objectid) + ctf_integer(u64, num_bytes, num_bytes) + ctf_integer(u64, empty_size, empty_size) + ctf_integer(u64, data, data) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, + + TP_PROTO(struct btrfs_root *root, + struct btrfs_block_group_cache *block_group, u64 start, + u64 len), + + TP_ARGS(root, block_group, start, len), + + TP_FIELDS( + ctf_integer(u64, root_objectid, root->root_key.objectid) + ctf_integer(u64, bg_objectid, block_group->key.objectid) + ctf_integer(u64, flags, block_group->flags) + ctf_integer(u64, start, start) + ctf_integer(u64, len, len) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, + + TP_PROTO(struct btrfs_root *root, + struct btrfs_block_group_cache *block_group, u64 start, + u64 len), + + TP_ARGS(root, block_group, start, len) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, + + TP_PROTO(struct btrfs_root *root, + struct btrfs_block_group_cache *block_group, u64 start, + u64 len), + + TP_ARGS(root, block_group, start, len) +) + +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) +LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster, + + TP_PROTO(const struct btrfs_block_group *block_group, u64 start, + u64 bytes, u64 empty_size, u64 min_bytes), + + TP_ARGS(block_group, start, bytes, empty_size, min_bytes), + + TP_FIELDS( + ctf_integer(u64, bg_objectid, block_group->start) + ctf_integer(u64, flags, block_group->flags) + ctf_integer(u64, start, start) + ctf_integer(u64, bytes, bytes) + ctf_integer(u64, empty_size, empty_size) + ctf_integer(u64, min_bytes, min_bytes) + ) +) + +LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup, + + TP_PROTO(const struct btrfs_block_group *block_group), + + TP_ARGS(block_group), + + TP_FIELDS( + ctf_integer(u64, bg_objectid, block_group->start) + ) +) + +LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster, + + TP_PROTO(const struct btrfs_block_group *block_group, + const struct btrfs_free_cluster *cluster, u64 size, int bitmap), + + TP_ARGS(block_group, cluster, size, bitmap), + + TP_FIELDS( + ctf_integer(u64, bg_objectid, block_group->start) + ctf_integer(u64, flags, block_group->flags) + ctf_integer(u64, start, cluster->window_start) + ctf_integer(u64, max_size, cluster->max_size) + ctf_integer(u64, size, size) + ctf_integer(int, bitmap, bitmap) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) +LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster, + + TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start, + u64 bytes, u64 empty_size, u64 min_bytes), + + TP_ARGS(block_group, start, bytes, empty_size, min_bytes), + + TP_FIELDS( + ctf_integer(u64, bg_objectid, block_group->key.objectid) + ctf_integer(u64, flags, block_group->flags) + ctf_integer(u64, start, start) + ctf_integer(u64, bytes, bytes) + ctf_integer(u64, empty_size, empty_size) + ctf_integer(u64, min_bytes, min_bytes) + ) +) + +LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup, + + TP_PROTO(const struct btrfs_block_group_cache *block_group), + + TP_ARGS(block_group), + + TP_FIELDS( + ctf_integer(u64, bg_objectid, block_group->key.objectid) + ) +) + +LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster, + + TP_PROTO(const struct btrfs_block_group_cache *block_group, + const struct btrfs_free_cluster *cluster, u64 size, int bitmap), + + TP_ARGS(block_group, cluster, size, bitmap), + + TP_FIELDS( + ctf_integer(u64, bg_objectid, block_group->key.objectid) + ctf_integer(u64, flags, block_group->flags) + ctf_integer(u64, start, cluster->window_start) + ctf_integer(u64, max_size, cluster->max_size) + ctf_integer(u64, size, size) + ctf_integer(int, bitmap, bitmap) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) +LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster, + + TP_PROTO(struct btrfs_block_group_cache *block_group, u64 start, + u64 bytes, u64 empty_size, u64 min_bytes), + + TP_ARGS(block_group, start, bytes, empty_size, min_bytes), + + TP_FIELDS( + ctf_integer(u64, bg_objectid, block_group->key.objectid) + ctf_integer(u64, flags, block_group->flags) + ctf_integer(u64, start, start) + ctf_integer(u64, bytes, bytes) + ctf_integer(u64, empty_size, empty_size) + ctf_integer(u64, min_bytes, min_bytes) + ) +) + +LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup, + + TP_PROTO(struct btrfs_block_group_cache *block_group), + + TP_ARGS(block_group), + + TP_FIELDS( + ctf_integer(u64, bg_objectid, block_group->key.objectid) + ) +) + +LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster, + + TP_PROTO(struct btrfs_block_group_cache *block_group, + struct btrfs_free_cluster *cluster, u64 size, int bitmap), + + TP_ARGS(block_group, cluster, size, bitmap), + + TP_FIELDS( + ctf_integer(u64, bg_objectid, block_group->key.objectid) + ctf_integer(u64, flags, block_group->flags) + ctf_integer(u64, start, cluster->window_start) + ctf_integer(u64, max_size, cluster->max_size) + ctf_integer(u64, size, size) + ctf_integer(int, bitmap, bitmap) + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ + LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) +LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state, + + btrfs_alloc_extent_state, + + TP_PROTO(const struct extent_state *state, gfp_t mask, unsigned long IP), + + TP_ARGS(state, mask, IP), + + TP_FIELDS( + ctf_integer_hex(const struct extent_state *, state, state) + ctf_integer(gfp_t, mask, mask) + ctf_integer_hex(unsigned long, ip, IP) + ) +) + +LTTNG_TRACEPOINT_EVENT_MAP(free_extent_state, + + btrfs_free_extent_state, + + TP_PROTO(const struct extent_state *state, unsigned long IP), + + TP_ARGS(state, IP), + + TP_FIELDS( + ctf_integer_hex(const struct extent_state *, state, state) + ctf_integer_hex(unsigned long, ip, IP) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) +LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state, + + btrfs_alloc_extent_state, + + TP_PROTO(struct extent_state *state, gfp_t mask, unsigned long IP), + + TP_ARGS(state, mask, IP), + + TP_FIELDS( + ctf_integer_hex(struct extent_state *, state, state) + ctf_integer(gfp_t, mask, mask) + ctf_integer_hex(unsigned long, ip, IP) + ) +) + +LTTNG_TRACEPOINT_EVENT_MAP(free_extent_state, + + btrfs_free_extent_state, + + TP_PROTO(struct extent_state *state, unsigned long IP), + + TP_ARGS(state, IP), + + TP_FIELDS( + ctf_integer_hex(struct extent_state *, state, state) + ctf_integer_hex(unsigned long, ip, IP) + ) +) +#endif + +#endif /* LTTNG_TRACE_BTRFS_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/compaction.h b/include/instrumentation/events/compaction.h new file mode 100644 index 00000000..72925c14 --- /dev/null +++ b/include/instrumentation/events/compaction.h @@ -0,0 +1,158 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM compaction + +#if !defined(LTTNG_TRACE_COMPACTION_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_COMPACTION_H + +#include +#include +#include + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0) + +LTTNG_TRACEPOINT_EVENT_CLASS(compaction_isolate_template, + + TP_PROTO(unsigned long start_pfn, + unsigned long end_pfn, + unsigned long nr_scanned, + unsigned long nr_taken), + + TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken), + + TP_FIELDS( + ctf_integer(unsigned long, start_pfn, start_pfn) + ctf_integer(unsigned long, end_pfn, end_pfn) + ctf_integer(unsigned long, nr_scanned, nr_scanned) + ctf_integer(unsigned long, nr_taken, nr_taken) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(compaction_isolate_template, + + mm_compaction_isolate_migratepages, + + compaction_isolate_migratepages, + + TP_PROTO(unsigned long start_pfn, + unsigned long end_pfn, + unsigned long nr_scanned, + unsigned long nr_taken), + + TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(compaction_isolate_template, + + mm_compaction_isolate_freepages, + + compaction_isolate_freepages, + + TP_PROTO(unsigned long start_pfn, + unsigned long end_pfn, + unsigned long nr_scanned, + unsigned long nr_taken), + + TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken) +) + +#else /* #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0) */ + +LTTNG_TRACEPOINT_EVENT_CLASS(compaction_isolate_template, + + TP_PROTO(unsigned long nr_scanned, + unsigned long nr_taken), + + TP_ARGS(nr_scanned, nr_taken), + + TP_FIELDS( + ctf_integer(unsigned long, nr_scanned, nr_scanned) + ctf_integer(unsigned long, nr_taken, nr_taken) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(compaction_isolate_template, + + mm_compaction_isolate_migratepages, + + compaction_isolate_migratepages, + + TP_PROTO(unsigned long nr_scanned, + unsigned long nr_taken), + + TP_ARGS(nr_scanned, nr_taken) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(compaction_isolate_template, + + mm_compaction_isolate_freepages, + + compaction_isolate_freepages, + + TP_PROTO(unsigned long nr_scanned, + unsigned long nr_taken), + + TP_ARGS(nr_scanned, nr_taken) +) + +#endif /* #else #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0) */ + +#if LTTNG_KERNEL_RANGE(3,12,30, 3,13,0) || \ + LTTNG_KERNEL_RANGE(3,14,25, 3,15,0) || \ + (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) +LTTNG_TRACEPOINT_EVENT_CODE_MAP(mm_compaction_migratepages, + + compaction_migratepages, + + TP_PROTO(unsigned long nr_all, + int migrate_rc, + struct list_head *migratepages), + + TP_ARGS(nr_all, migrate_rc, migratepages), + + TP_locvar( + unsigned long nr_failed; + ), + + TP_code_pre( + tp_locvar->nr_failed = 0; + + { + struct list_head *page_lru; + + if (migrate_rc >= 0) + tp_locvar->nr_failed = migrate_rc; + else + list_for_each(page_lru, migratepages) + tp_locvar->nr_failed++; + } + ), + + TP_FIELDS( + ctf_integer(unsigned long, nr_migrated, nr_all - tp_locvar->nr_failed) + ctf_integer(unsigned long, nr_failed, tp_locvar->nr_failed) + ), + + TP_code_post() +) +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */ +LTTNG_TRACEPOINT_EVENT_MAP(mm_compaction_migratepages, + + compaction_migratepages, + + TP_PROTO(unsigned long nr_migrated, + unsigned long nr_failed), + + TP_ARGS(nr_migrated, nr_failed), + + TP_FIELDS( + ctf_integer(unsigned long, nr_migrated, nr_migrated) + ctf_integer(unsigned long, nr_failed, nr_failed) + ) +) +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */ + +#endif /* LTTNG_TRACE_COMPACTION_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/ext3.h b/include/instrumentation/events/ext3.h new file mode 100644 index 00000000..8852a1ee --- /dev/null +++ b/include/instrumentation/events/ext3.h @@ -0,0 +1,522 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM ext3 + +#if !defined(LTTNG_TRACE_EXT3_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_EXT3_H + +#include +#include + +LTTNG_TRACEPOINT_EVENT(ext3_free_inode, + TP_PROTO(struct inode *inode), + + TP_ARGS(inode), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(umode_t, mode, inode->i_mode) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + ctf_integer(uid_t, uid, i_uid_read(inode)) + ctf_integer(gid_t, gid, i_gid_read(inode)) +#else + ctf_integer(uid_t, uid, inode->i_uid) + ctf_integer(gid_t, gid, inode->i_gid) +#endif + ctf_integer(blkcnt_t, blocks, inode->i_blocks) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_request_inode, + TP_PROTO(struct inode *dir, int mode), + + TP_ARGS(dir, mode), + + TP_FIELDS( + ctf_integer(dev_t, dev, dir->i_sb->s_dev) + ctf_integer(ino_t, dir, dir->i_ino) + ctf_integer(umode_t, mode, mode) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_allocate_inode, + TP_PROTO(struct inode *inode, struct inode *dir, int mode), + + TP_ARGS(inode, dir, mode), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ino_t, dir, dir->i_ino) + ctf_integer(umode_t, mode, mode) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_evict_inode, + TP_PROTO(struct inode *inode), + + TP_ARGS(inode), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(int, nlink, inode->i_nlink) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_drop_inode, + TP_PROTO(struct inode *inode, int drop), + + TP_ARGS(inode, drop), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(int, drop, drop) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_mark_inode_dirty, + TP_PROTO(struct inode *inode, unsigned long IP), + + TP_ARGS(inode, IP), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer_hex(unsigned long, ip, IP) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_write_begin, + TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, + unsigned int flags), + + TP_ARGS(inode, pos, len, flags), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(loff_t, pos, pos) + ctf_integer(unsigned int, len, len) + ctf_integer(unsigned int, flags, flags) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(ext3__write_end, + TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, + unsigned int copied), + + TP_ARGS(inode, pos, len, copied), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(loff_t, pos, pos) + ctf_integer(unsigned int, len, len) + ctf_integer(unsigned int, copied, copied) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext3__write_end, ext3_ordered_write_end, + + TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, + unsigned int copied), + + TP_ARGS(inode, pos, len, copied) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext3__write_end, ext3_writeback_write_end, + + TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, + unsigned int copied), + + TP_ARGS(inode, pos, len, copied) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext3__write_end, ext3_journalled_write_end, + + TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, + unsigned int copied), + + TP_ARGS(inode, pos, len, copied) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(ext3__page_op, + TP_PROTO(struct page *page), + + TP_ARGS(page), + + TP_FIELDS( + ctf_integer(dev_t, dev, page->mapping->host->i_sb->s_dev) + ctf_integer(ino_t, ino, page->mapping->host->i_ino) + ctf_integer(pgoff_t, index, page->index) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext3__page_op, ext3_ordered_writepage, + + TP_PROTO(struct page *page), + + TP_ARGS(page) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext3__page_op, ext3_writeback_writepage, + + TP_PROTO(struct page *page), + + TP_ARGS(page) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext3__page_op, ext3_journalled_writepage, + + TP_PROTO(struct page *page), + + TP_ARGS(page) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext3__page_op, ext3_readpage, + + TP_PROTO(struct page *page), + + TP_ARGS(page) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext3__page_op, ext3_releasepage, + + TP_PROTO(struct page *page), + + TP_ARGS(page) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) + +LTTNG_TRACEPOINT_EVENT(ext3_invalidatepage, + TP_PROTO(struct page *page, unsigned int offset, unsigned int length), + + TP_ARGS(page, offset, length), + + TP_FIELDS( + ctf_integer(pgoff_t, index, page->index) + ctf_integer(unsigned int, offset, offset) + ctf_integer(unsigned int, length, length) + ctf_integer(ino_t, ino, page->mapping->host->i_ino) + ctf_integer(dev_t, dev, page->mapping->host->i_sb->s_dev) + ) +) + +#else + +LTTNG_TRACEPOINT_EVENT(ext3_invalidatepage, + TP_PROTO(struct page *page, unsigned long offset), + + TP_ARGS(page, offset), + + TP_FIELDS( + ctf_integer(pgoff_t, index, page->index) + ctf_integer(unsigned long, offset, offset) + ctf_integer(ino_t, ino, page->mapping->host->i_ino) + ctf_integer(dev_t, dev, page->mapping->host->i_sb->s_dev) + ) +) + +#endif + +LTTNG_TRACEPOINT_EVENT(ext3_discard_blocks, + TP_PROTO(struct super_block *sb, unsigned long blk, + unsigned long count), + + TP_ARGS(sb, blk, count), + + TP_FIELDS( + ctf_integer(dev_t, dev, sb->s_dev) + ctf_integer(unsigned long, blk, blk) + ctf_integer(unsigned long, count, count) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_request_blocks, + TP_PROTO(struct inode *inode, unsigned long goal, + unsigned long count), + + TP_ARGS(inode, goal, count), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(unsigned long, count, count) + ctf_integer(unsigned long, goal, goal) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_allocate_blocks, + TP_PROTO(struct inode *inode, unsigned long goal, + unsigned long count, unsigned long block), + + TP_ARGS(inode, goal, count, block), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(unsigned long, block, block) + ctf_integer(unsigned long, count, count) + ctf_integer(unsigned long, goal, goal) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_free_blocks, + TP_PROTO(struct inode *inode, unsigned long block, + unsigned long count), + + TP_ARGS(inode, block, count), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(umode_t, mode, inode->i_mode) + ctf_integer(unsigned long, block, block) + ctf_integer(unsigned long, count, count) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_sync_file_enter, + TP_PROTO(struct file *file, int datasync), + + TP_ARGS(file, datasync), + + TP_FIELDS( + ctf_integer(dev_t, dev, file->f_path.dentry->d_inode->i_sb->s_dev) + ctf_integer(ino_t, ino, file->f_path.dentry->d_inode->i_ino) + ctf_integer(ino_t, parent, file->f_path.dentry->d_parent->d_inode->i_ino) + ctf_integer(int, datasync, datasync) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_sync_file_exit, + TP_PROTO(struct inode *inode, int ret), + + TP_ARGS(inode, ret), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(int, ret, ret) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_sync_fs, + TP_PROTO(struct super_block *sb, int wait), + + TP_ARGS(sb, wait), + + TP_FIELDS( + ctf_integer(dev_t, dev, sb->s_dev) + ctf_integer(int, wait, wait) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_rsv_window_add, + TP_PROTO(struct super_block *sb, + struct ext3_reserve_window_node *rsv_node), + + TP_ARGS(sb, rsv_node), + + TP_FIELDS( + ctf_integer(unsigned long, start, rsv_node->rsv_window._rsv_start) + ctf_integer(unsigned long, end, rsv_node->rsv_window._rsv_end) + ctf_integer(dev_t, dev, sb->s_dev) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_discard_reservation, + TP_PROTO(struct inode *inode, + struct ext3_reserve_window_node *rsv_node), + + TP_ARGS(inode, rsv_node), + + TP_FIELDS( + ctf_integer(unsigned long, start, rsv_node->rsv_window._rsv_start) + ctf_integer(unsigned long, end, rsv_node->rsv_window._rsv_end) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_alloc_new_reservation, + TP_PROTO(struct super_block *sb, unsigned long goal), + + TP_ARGS(sb, goal), + + TP_FIELDS( + ctf_integer(dev_t, dev, sb->s_dev) + ctf_integer(unsigned long, goal, goal) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_reserved, + TP_PROTO(struct super_block *sb, unsigned long block, + struct ext3_reserve_window_node *rsv_node), + + TP_ARGS(sb, block, rsv_node), + + TP_FIELDS( + ctf_integer(unsigned long, block, block) + ctf_integer(unsigned long, start, rsv_node->rsv_window._rsv_start) + ctf_integer(unsigned long, end, rsv_node->rsv_window._rsv_end) + ctf_integer(dev_t, dev, sb->s_dev) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_forget, + TP_PROTO(struct inode *inode, int is_metadata, unsigned long block), + + TP_ARGS(inode, is_metadata, block), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(umode_t, mode, inode->i_mode) + ctf_integer(int, is_metadata, is_metadata) + ctf_integer(unsigned long, block, block) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_read_block_bitmap, + TP_PROTO(struct super_block *sb, unsigned int group), + + TP_ARGS(sb, group), + + TP_FIELDS( + ctf_integer(dev_t, dev, sb->s_dev) + ctf_integer(__u32, group, group) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_direct_IO_enter, + TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw), + + TP_ARGS(inode, offset, len, rw), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(loff_t, pos, offset) + ctf_integer(unsigned long, len, len) + ctf_integer(int, rw, rw) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_direct_IO_exit, + TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, + int rw, int ret), + + TP_ARGS(inode, offset, len, rw, ret), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(loff_t, pos, offset) + ctf_integer(unsigned long, len, len) + ctf_integer(int, rw, rw) + ctf_integer(int, ret, ret) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_unlink_enter, + TP_PROTO(struct inode *parent, struct dentry *dentry), + + TP_ARGS(parent, dentry), + + TP_FIELDS( + ctf_integer(ino_t, parent, parent->i_ino) + ctf_integer(ino_t, ino, dentry->d_inode->i_ino) + ctf_integer(loff_t, size, dentry->d_inode->i_size) + ctf_integer(dev_t, dev, dentry->d_inode->i_sb->s_dev) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_unlink_exit, + TP_PROTO(struct dentry *dentry, int ret), + + TP_ARGS(dentry, ret), + + TP_FIELDS( + ctf_integer(dev_t, dev, dentry->d_inode->i_sb->s_dev) + ctf_integer(ino_t, ino, dentry->d_inode->i_ino) + ctf_integer(int, ret, ret) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(ext3__truncate, + TP_PROTO(struct inode *inode), + + TP_ARGS(inode), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(blkcnt_t, blocks, inode->i_blocks) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext3__truncate, ext3_truncate_enter, + + TP_PROTO(struct inode *inode), + + TP_ARGS(inode) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext3__truncate, ext3_truncate_exit, + + TP_PROTO(struct inode *inode), + + TP_ARGS(inode) +) + +LTTNG_TRACEPOINT_EVENT(ext3_get_blocks_enter, + TP_PROTO(struct inode *inode, unsigned long lblk, + unsigned long len, int create), + + TP_ARGS(inode, lblk, len, create), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(unsigned long, lblk, lblk) + ctf_integer(unsigned long, len, len) + ctf_integer(int, create, create) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_get_blocks_exit, + TP_PROTO(struct inode *inode, unsigned long lblk, + unsigned long pblk, unsigned long len, int ret), + + TP_ARGS(inode, lblk, pblk, len, ret), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(unsigned long, lblk, lblk) + ctf_integer(unsigned long, pblk, pblk) + ctf_integer(unsigned long, len, len) + ctf_integer(int, ret, ret) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext3_load_inode, + TP_PROTO(struct inode *inode), + + TP_ARGS(inode), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ) +) + +#endif /* LTTNG_TRACE_EXT3_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/ext4.h b/include/instrumentation/events/ext4.h new file mode 100644 index 00000000..e57aff8b --- /dev/null +++ b/include/instrumentation/events/ext4.h @@ -0,0 +1,1871 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM ext4 + +#if !defined(LTTNG_TRACE_EXT4_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_EXT4_H + +#include +#include +#include + +#ifndef _TRACE_EXT4_DEF_ +#define _TRACE_EXT4_DEF_ +struct ext4_allocation_context; +struct ext4_allocation_request; +struct ext4_prealloc_space; +struct ext4_inode_info; +struct mpage_da_data; +struct ext4_map_blocks; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) +struct ext4_extent; +#endif +#endif + +#define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) +#define TP_MODE_T __u16 +#else +#define TP_MODE_T umode_t +#endif + +LTTNG_TRACEPOINT_EVENT(ext4_free_inode, + TP_PROTO(struct inode *inode), + + TP_ARGS(inode), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + ctf_integer(uid_t, uid, i_uid_read(inode)) + ctf_integer(gid_t, gid, i_gid_read(inode)) +#else + ctf_integer(uid_t, uid, inode->i_uid) + ctf_integer(gid_t, gid, inode->i_gid) +#endif + ctf_integer(__u64, blocks, inode->i_blocks) + ctf_integer(TP_MODE_T, mode, inode->i_mode) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_request_inode, + TP_PROTO(struct inode *dir, int mode), + + TP_ARGS(dir, mode), + + TP_FIELDS( + ctf_integer(dev_t, dev, dir->i_sb->s_dev) + ctf_integer(ino_t, dir, dir->i_ino) + ctf_integer(TP_MODE_T, mode, mode) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_allocate_inode, + TP_PROTO(struct inode *inode, struct inode *dir, int mode), + + TP_ARGS(inode, dir, mode), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ino_t, dir, dir->i_ino) + ctf_integer(TP_MODE_T, mode, mode) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_evict_inode, + TP_PROTO(struct inode *inode), + + TP_ARGS(inode), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(int, nlink, inode->i_nlink) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_drop_inode, + TP_PROTO(struct inode *inode, int drop), + + TP_ARGS(inode, drop), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(int, drop, drop) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_mark_inode_dirty, + TP_PROTO(struct inode *inode, unsigned long IP), + + TP_ARGS(inode, IP), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer_hex(unsigned long, ip, IP) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_begin_ordered_truncate, + TP_PROTO(struct inode *inode, loff_t new_size), + + TP_ARGS(inode, new_size), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(loff_t, new_size, new_size) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(ext4__write_begin, + + TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, + unsigned int flags), + + TP_ARGS(inode, pos, len, flags), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(loff_t, pos, pos) + ctf_integer(unsigned int, len, len) + ctf_integer(unsigned int, flags, flags) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__write_begin, ext4_write_begin, + + TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, + unsigned int flags), + + TP_ARGS(inode, pos, len, flags) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__write_begin, ext4_da_write_begin, + + TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, + unsigned int flags), + + TP_ARGS(inode, pos, len, flags) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(ext4__write_end, + TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, + unsigned int copied), + + TP_ARGS(inode, pos, len, copied), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(loff_t, pos, pos) + ctf_integer(unsigned int, len, len) + ctf_integer(unsigned int, copied, copied) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__write_end, ext4_ordered_write_end, + + TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, + unsigned int copied), + + TP_ARGS(inode, pos, len, copied) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__write_end, ext4_writeback_write_end, + + TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, + unsigned int copied), + + TP_ARGS(inode, pos, len, copied) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__write_end, ext4_journalled_write_end, + + TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, + unsigned int copied), + + TP_ARGS(inode, pos, len, copied) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__write_end, ext4_da_write_end, + + TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, + unsigned int copied), + + TP_ARGS(inode, pos, len, copied) +) + +LTTNG_TRACEPOINT_EVENT(ext4_da_writepages, + TP_PROTO(struct inode *inode, struct writeback_control *wbc), + + TP_ARGS(inode, wbc), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(long, nr_to_write, wbc->nr_to_write) + ctf_integer(long, pages_skipped, wbc->pages_skipped) + ctf_integer(loff_t, range_start, wbc->range_start) + ctf_integer(loff_t, range_end, wbc->range_end) + ctf_integer(pgoff_t, writeback_index, inode->i_mapping->writeback_index) + ctf_integer(int, sync_mode, wbc->sync_mode) + ctf_integer(char, for_kupdate, wbc->for_kupdate) + ctf_integer(char, range_cyclic, wbc->range_cyclic) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) + +LTTNG_TRACEPOINT_EVENT(ext4_da_write_pages, + TP_PROTO(struct inode *inode, pgoff_t first_page, + struct writeback_control *wbc), + + TP_ARGS(inode, first_page, wbc), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(pgoff_t, first_page, first_page) + ctf_integer(long, nr_to_write, wbc->nr_to_write) + ctf_integer(int, sync_mode, wbc->sync_mode) + ) +) + +#else + +LTTNG_TRACEPOINT_EVENT(ext4_da_write_pages, + TP_PROTO(struct inode *inode, struct mpage_da_data *mpd), + + TP_ARGS(inode, mpd), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(__u64, b_blocknr, mpd->b_blocknr) + ctf_integer(__u32, b_size, mpd->b_size) + ctf_integer(__u32, b_state, mpd->b_state) + ctf_integer(unsigned long, first_page, mpd->first_page) + ctf_integer(int, io_done, mpd->io_done) + ctf_integer(int, pages_written, mpd->pages_written) + ctf_integer(int, sync_mode, mpd->wbc->sync_mode) + ) +) + +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) + +LTTNG_TRACEPOINT_EVENT(ext4_da_write_pages_extent, + TP_PROTO(struct inode *inode, struct ext4_map_blocks *map), + + TP_ARGS(inode, map), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(__u64, lblk, map->m_lblk) + ctf_integer(__u32, len, map->m_len) + ctf_integer(__u32, flags, map->m_flags) + ) +) + +#endif + +LTTNG_TRACEPOINT_EVENT(ext4_da_writepages_result, + TP_PROTO(struct inode *inode, struct writeback_control *wbc, + int ret, int pages_written), + + TP_ARGS(inode, wbc, ret, pages_written), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(int, ret, ret) + ctf_integer(int, pages_written, pages_written) + ctf_integer(long, pages_skipped, wbc->pages_skipped) + ctf_integer(pgoff_t, writeback_index, inode->i_mapping->writeback_index) + ctf_integer(int, sync_mode, wbc->sync_mode) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(ext4__page_op, + TP_PROTO(struct page *page), + + TP_ARGS(page), + + TP_FIELDS( + ctf_integer(dev_t, dev, page->mapping->host->i_sb->s_dev) + ctf_integer(ino_t, ino, page->mapping->host->i_ino) + ctf_integer(pgoff_t, index, page->index) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__page_op, ext4_writepage, + + TP_PROTO(struct page *page), + + TP_ARGS(page) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__page_op, ext4_readpage, + + TP_PROTO(struct page *page), + + TP_ARGS(page) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__page_op, ext4_releasepage, + + TP_PROTO(struct page *page), + + TP_ARGS(page) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) + +LTTNG_TRACEPOINT_EVENT_CLASS(ext4_invalidatepage_op, + TP_PROTO(struct page *page, unsigned int offset, unsigned int length), + + TP_ARGS(page, offset, length), + + TP_FIELDS( + ctf_integer(dev_t, dev, page->mapping->host->i_sb->s_dev) + ctf_integer(ino_t, ino, page->mapping->host->i_ino) + ctf_integer(pgoff_t, index, page->index) + ctf_integer(unsigned int, offset, offset) + ctf_integer(unsigned int, length, length) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4_invalidatepage_op, ext4_invalidatepage, + TP_PROTO(struct page *page, unsigned int offset, unsigned int length), + + TP_ARGS(page, offset, length) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4_invalidatepage_op, ext4_journalled_invalidatepage, + TP_PROTO(struct page *page, unsigned int offset, unsigned int length), + + TP_ARGS(page, offset, length) +) + +#else + +LTTNG_TRACEPOINT_EVENT(ext4_invalidatepage, + TP_PROTO(struct page *page, unsigned long offset), + + TP_ARGS(page, offset), + + TP_FIELDS( + ctf_integer(dev_t, dev, page->mapping->host->i_sb->s_dev) + ctf_integer(ino_t, ino, page->mapping->host->i_ino) + ctf_integer(pgoff_t, index, page->index) + ctf_integer(unsigned long, offset, offset) + + ) +) + +#endif + +LTTNG_TRACEPOINT_EVENT(ext4_discard_blocks, + TP_PROTO(struct super_block *sb, unsigned long long blk, + unsigned long long count), + + TP_ARGS(sb, blk, count), + + TP_FIELDS( + ctf_integer(dev_t, dev, sb->s_dev) + ctf_integer(__u64, blk, blk) + ctf_integer(__u64, count, count) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(ext4__mb_new_pa, + TP_PROTO(struct ext4_allocation_context *ac, + struct ext4_prealloc_space *pa), + + TP_ARGS(ac, pa), + + TP_FIELDS( + ctf_integer(dev_t, dev, ac->ac_sb->s_dev) + ctf_integer(ino_t, ino, ac->ac_inode->i_ino) + ctf_integer(__u64, pa_pstart, pa->pa_pstart) + ctf_integer(__u64, pa_lstart, pa->pa_lstart) + ctf_integer(__u32, pa_len, pa->pa_len) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__mb_new_pa, ext4_mb_new_inode_pa, + + TP_PROTO(struct ext4_allocation_context *ac, + struct ext4_prealloc_space *pa), + + TP_ARGS(ac, pa) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__mb_new_pa, ext4_mb_new_group_pa, + + TP_PROTO(struct ext4_allocation_context *ac, + struct ext4_prealloc_space *pa), + + TP_ARGS(ac, pa) +) + +LTTNG_TRACEPOINT_EVENT(ext4_mb_release_inode_pa, + TP_PROTO( + struct ext4_prealloc_space *pa, + unsigned long long block, unsigned int count), + + TP_ARGS(pa, block, count), + + TP_FIELDS( + ctf_integer(dev_t, dev, pa->pa_inode->i_sb->s_dev) + ctf_integer(ino_t, ino, pa->pa_inode->i_ino) + ctf_integer(__u64, block, block) + ctf_integer(__u32, count, count) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) +LTTNG_TRACEPOINT_EVENT(ext4_mb_release_group_pa, + + TP_PROTO(struct super_block *sb, struct ext4_prealloc_space *pa), + + TP_ARGS(sb, pa), + + TP_FIELDS( + ctf_integer(dev_t, dev, sb->s_dev) + ctf_integer(__u64, pa_pstart, pa->pa_pstart) + ctf_integer(__u32, pa_len, pa->pa_len) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(ext4_mb_release_group_pa, + + TP_PROTO(struct ext4_prealloc_space *pa), + + TP_ARGS(pa), + + TP_FIELDS( + ctf_integer(dev_t, dev, pa->pa_inode->i_sb->s_dev) + ctf_integer(__u64, pa_pstart, pa->pa_pstart) + ctf_integer(__u32, pa_len, pa->pa_len) + ) +) +#endif + +LTTNG_TRACEPOINT_EVENT(ext4_discard_preallocations, + TP_PROTO(struct inode *inode), + + TP_ARGS(inode), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_mb_discard_preallocations, + TP_PROTO(struct super_block *sb, int needed), + + TP_ARGS(sb, needed), + + TP_FIELDS( + ctf_integer(dev_t, dev, sb->s_dev) + ctf_integer(int, needed, needed) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_request_blocks, + TP_PROTO(struct ext4_allocation_request *ar), + + TP_ARGS(ar), + + TP_FIELDS( + ctf_integer(dev_t, dev, ar->inode->i_sb->s_dev) + ctf_integer(ino_t, ino, ar->inode->i_ino) + ctf_integer(unsigned int, len, ar->len) + ctf_integer(__u32, logical, ar->logical) + ctf_integer(__u32, lleft, ar->lleft) + ctf_integer(__u32, lright, ar->lright) + ctf_integer(__u64, goal, ar->goal) + ctf_integer(__u64, pleft, ar->pleft) + ctf_integer(__u64, pright, ar->pright) + ctf_integer(unsigned int, flags, ar->flags) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_allocate_blocks, + TP_PROTO(struct ext4_allocation_request *ar, unsigned long long block), + + TP_ARGS(ar, block), + + TP_FIELDS( + ctf_integer(dev_t, dev, ar->inode->i_sb->s_dev) + ctf_integer(ino_t, ino, ar->inode->i_ino) + ctf_integer(__u64, block, block) + ctf_integer(unsigned int, len, ar->len) + ctf_integer(__u32, logical, ar->logical) + ctf_integer(__u32, lleft, ar->lleft) + ctf_integer(__u32, lright, ar->lright) + ctf_integer(__u64, goal, ar->goal) + ctf_integer(__u64, pleft, ar->pleft) + ctf_integer(__u64, pright, ar->pright) + ctf_integer(unsigned int, flags, ar->flags) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_free_blocks, + TP_PROTO(struct inode *inode, __u64 block, unsigned long count, + int flags), + + TP_ARGS(inode, block, count, flags), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(__u64, block, block) + ctf_integer(unsigned long, count, count) + ctf_integer(int, flags, flags) + ctf_integer(TP_MODE_T, mode, inode->i_mode) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_sync_file_enter, + TP_PROTO(struct file *file, int datasync), + + TP_ARGS(file, datasync), + + TP_FIELDS( + ctf_integer(dev_t, dev, file->f_path.dentry->d_inode->i_sb->s_dev) + ctf_integer(ino_t, ino, file->f_path.dentry->d_inode->i_ino) + ctf_integer(ino_t, parent, file->f_path.dentry->d_parent->d_inode->i_ino) + ctf_integer(int, datasync, datasync) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_sync_file_exit, + TP_PROTO(struct inode *inode, int ret), + + TP_ARGS(inode, ret), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(int, ret, ret) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_sync_fs, + TP_PROTO(struct super_block *sb, int wait), + + TP_ARGS(sb, wait), + + TP_FIELDS( + ctf_integer(dev_t, dev, sb->s_dev) + ctf_integer(int, wait, wait) + + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0)) +LTTNG_TRACEPOINT_EVENT(ext4_alloc_da_blocks, + TP_PROTO(struct inode *inode), + + TP_ARGS(inode), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(unsigned int, data_blocks, EXT4_I(inode)->i_reserved_data_blocks) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(ext4_alloc_da_blocks, + TP_PROTO(struct inode *inode), + + TP_ARGS(inode), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(unsigned int, data_blocks, EXT4_I(inode)->i_reserved_data_blocks) + ctf_integer(unsigned int, meta_blocks, EXT4_I(inode)->i_reserved_meta_blocks) + ) +) +#endif + +LTTNG_TRACEPOINT_EVENT(ext4_mballoc_alloc, + TP_PROTO(struct ext4_allocation_context *ac), + + TP_ARGS(ac), + + TP_FIELDS( + ctf_integer(dev_t, dev, ac->ac_inode->i_sb->s_dev) + ctf_integer(ino_t, ino, ac->ac_inode->i_ino) + ctf_integer(__u32, orig_logical, ac->ac_o_ex.fe_logical) + ctf_integer(int, orig_start, ac->ac_o_ex.fe_start) + ctf_integer(__u32, orig_group, ac->ac_o_ex.fe_group) + ctf_integer(int, orig_len, ac->ac_o_ex.fe_len) + ctf_integer(__u32, goal_logical, ac->ac_g_ex.fe_logical) + ctf_integer(int, goal_start, ac->ac_g_ex.fe_start) + ctf_integer(__u32, goal_group, ac->ac_g_ex.fe_group) + ctf_integer(int, goal_len, ac->ac_g_ex.fe_len) + ctf_integer(__u32, result_logical, ac->ac_f_ex.fe_logical) + ctf_integer(int, result_start, ac->ac_f_ex.fe_start) + ctf_integer(__u32, result_group, ac->ac_f_ex.fe_group) + ctf_integer(int, result_len, ac->ac_f_ex.fe_len) + ctf_integer(__u16, found, ac->ac_found) + ctf_integer(__u16, groups, ac->ac_groups_scanned) + ctf_integer(__u16, buddy, ac->ac_buddy) + ctf_integer(__u16, flags, ac->ac_flags) + ctf_integer(__u16, tail, ac->ac_tail) + ctf_integer(__u8, cr, ac->ac_criteria) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_mballoc_prealloc, + TP_PROTO(struct ext4_allocation_context *ac), + + TP_ARGS(ac), + + TP_FIELDS( + ctf_integer(dev_t, dev, ac->ac_inode->i_sb->s_dev) + ctf_integer(ino_t, ino, ac->ac_inode->i_ino) + ctf_integer(__u32, orig_logical, ac->ac_o_ex.fe_logical) + ctf_integer(int, orig_start, ac->ac_o_ex.fe_start) + ctf_integer(__u32, orig_group, ac->ac_o_ex.fe_group) + ctf_integer(int, orig_len, ac->ac_o_ex.fe_len) + ctf_integer(__u32, result_logical, ac->ac_b_ex.fe_logical) + ctf_integer(int, result_start, ac->ac_b_ex.fe_start) + ctf_integer(__u32, result_group, ac->ac_b_ex.fe_group) + ctf_integer(int, result_len, ac->ac_b_ex.fe_len) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(ext4__mballoc, + TP_PROTO(struct super_block *sb, + struct inode *inode, + ext4_group_t group, + ext4_grpblk_t start, + ext4_grpblk_t len), + + TP_ARGS(sb, inode, group, start, len), + + TP_FIELDS( + ctf_integer(dev_t, dev, sb->s_dev) + ctf_integer(ino_t, ino, inode ? inode->i_ino : 0) + ctf_integer(int, result_start, start) + ctf_integer(__u32, result_group, group) + ctf_integer(int, result_len, len) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__mballoc, ext4_mballoc_discard, + + TP_PROTO(struct super_block *sb, + struct inode *inode, + ext4_group_t group, + ext4_grpblk_t start, + ext4_grpblk_t len), + + TP_ARGS(sb, inode, group, start, len) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__mballoc, ext4_mballoc_free, + + TP_PROTO(struct super_block *sb, + struct inode *inode, + ext4_group_t group, + ext4_grpblk_t start, + ext4_grpblk_t len), + + TP_ARGS(sb, inode, group, start, len) +) + +LTTNG_TRACEPOINT_EVENT(ext4_forget, + TP_PROTO(struct inode *inode, int is_metadata, __u64 block), + + TP_ARGS(inode, is_metadata, block), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(__u64, block, block) + ctf_integer(int, is_metadata, is_metadata) + ctf_integer(TP_MODE_T, mode, inode->i_mode) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0)) +LTTNG_TRACEPOINT_EVENT(ext4_da_update_reserve_space, + TP_PROTO(struct inode *inode, int used_blocks, int quota_claim), + + TP_ARGS(inode, used_blocks, quota_claim), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(__u64, i_blocks, inode->i_blocks) + ctf_integer(int, used_blocks, used_blocks) + ctf_integer(int, reserved_data_blocks, + EXT4_I(inode)->i_reserved_data_blocks) + ctf_integer(int, quota_claim, quota_claim) + ctf_integer(TP_MODE_T, mode, inode->i_mode) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) +LTTNG_TRACEPOINT_EVENT(ext4_da_update_reserve_space, + TP_PROTO(struct inode *inode, int used_blocks, int quota_claim), + + TP_ARGS(inode, used_blocks, quota_claim), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(__u64, i_blocks, inode->i_blocks) + ctf_integer(int, used_blocks, used_blocks) + ctf_integer(int, reserved_data_blocks, + EXT4_I(inode)->i_reserved_data_blocks) + ctf_integer(int, reserved_meta_blocks, + EXT4_I(inode)->i_reserved_meta_blocks) + ctf_integer(int, allocated_meta_blocks, + EXT4_I(inode)->i_allocated_meta_blocks) + ctf_integer(int, quota_claim, quota_claim) + ctf_integer(TP_MODE_T, mode, inode->i_mode) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(ext4_da_update_reserve_space, + TP_PROTO(struct inode *inode, int used_blocks), + + TP_ARGS(inode, used_blocks), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(__u64, i_blocks, inode->i_blocks) + ctf_integer(int, used_blocks, used_blocks) + ctf_integer(int, reserved_data_blocks, + EXT4_I(inode)->i_reserved_data_blocks) + ctf_integer(int, reserved_meta_blocks, + EXT4_I(inode)->i_reserved_meta_blocks) + ctf_integer(int, allocated_meta_blocks, + EXT4_I(inode)->i_allocated_meta_blocks) + ctf_integer(TP_MODE_T, mode, inode->i_mode) + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0)) +LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_space, + TP_PROTO(struct inode *inode), + + TP_ARGS(inode), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(__u64, i_blocks, inode->i_blocks) + ctf_integer(int, reserved_data_blocks, + EXT4_I(inode)->i_reserved_data_blocks) + ctf_integer(TP_MODE_T, mode, inode->i_mode) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) +LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_space, + TP_PROTO(struct inode *inode), + + TP_ARGS(inode), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(__u64, i_blocks, inode->i_blocks) + ctf_integer(int, reserved_data_blocks, + EXT4_I(inode)->i_reserved_data_blocks) + ctf_integer(int, reserved_meta_blocks, + EXT4_I(inode)->i_reserved_meta_blocks) + ctf_integer(TP_MODE_T, mode, inode->i_mode) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_space, + TP_PROTO(struct inode *inode, int md_needed), + + TP_ARGS(inode, md_needed), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(__u64, i_blocks, inode->i_blocks) + ctf_integer(int, md_needed, md_needed) + ctf_integer(int, reserved_data_blocks, + EXT4_I(inode)->i_reserved_data_blocks) + ctf_integer(int, reserved_meta_blocks, + EXT4_I(inode)->i_reserved_meta_blocks) + ctf_integer(TP_MODE_T, mode, inode->i_mode) + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0)) +LTTNG_TRACEPOINT_EVENT(ext4_da_release_space, + TP_PROTO(struct inode *inode, int freed_blocks), + + TP_ARGS(inode, freed_blocks), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(__u64, i_blocks, inode->i_blocks) + ctf_integer(int, freed_blocks, freed_blocks) + ctf_integer(int, reserved_data_blocks, + EXT4_I(inode)->i_reserved_data_blocks) + ctf_integer(TP_MODE_T, mode, inode->i_mode) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(ext4_da_release_space, + TP_PROTO(struct inode *inode, int freed_blocks), + + TP_ARGS(inode, freed_blocks), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(__u64, i_blocks, inode->i_blocks) + ctf_integer(int, freed_blocks, freed_blocks) + ctf_integer(int, reserved_data_blocks, + EXT4_I(inode)->i_reserved_data_blocks) + ctf_integer(int, reserved_meta_blocks, + EXT4_I(inode)->i_reserved_meta_blocks) + ctf_integer(int, allocated_meta_blocks, + EXT4_I(inode)->i_allocated_meta_blocks) + ctf_integer(TP_MODE_T, mode, inode->i_mode) + ) +) +#endif + +LTTNG_TRACEPOINT_EVENT_CLASS(ext4__bitmap_load, + TP_PROTO(struct super_block *sb, unsigned long group), + + TP_ARGS(sb, group), + + TP_FIELDS( + ctf_integer(dev_t, dev, sb->s_dev) + ctf_integer(__u32, group, group) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__bitmap_load, ext4_mb_bitmap_load, + + TP_PROTO(struct super_block *sb, unsigned long group), + + TP_ARGS(sb, group) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__bitmap_load, ext4_mb_buddy_bitmap_load, + + TP_PROTO(struct super_block *sb, unsigned long group), + + TP_ARGS(sb, group) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__bitmap_load, ext4_read_block_bitmap_load, + + TP_PROTO(struct super_block *sb, unsigned long group), + + TP_ARGS(sb, group) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__bitmap_load, ext4_load_inode_bitmap, + + TP_PROTO(struct super_block *sb, unsigned long group), + + TP_ARGS(sb, group) +) + +LTTNG_TRACEPOINT_EVENT(ext4_direct_IO_enter, + TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw), + + TP_ARGS(inode, offset, len, rw), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(loff_t, pos, offset) + ctf_integer(unsigned long, len, len) + ctf_integer(int, rw, rw) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_direct_IO_exit, + TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, + int rw, int ret), + + TP_ARGS(inode, offset, len, rw, ret), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(loff_t, pos, offset) + ctf_integer(unsigned long, len, len) + ctf_integer(int, rw, rw) + ctf_integer(int, ret, ret) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_fallocate_exit, + TP_PROTO(struct inode *inode, loff_t offset, + unsigned int max_blocks, int ret), + + TP_ARGS(inode, offset, max_blocks, ret), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(loff_t, pos, offset) + ctf_integer(unsigned int, blocks, max_blocks) + ctf_integer(int, ret, ret) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) + +LTTNG_TRACEPOINT_EVENT_CLASS(ext4__fallocate_mode, + TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode), + + TP_ARGS(inode, offset, len, mode), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(loff_t, pos, offset) + ctf_integer(loff_t, len, len) + ctf_integer(int, mode, mode) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__fallocate_mode, ext4_fallocate_enter, + + TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode), + + TP_ARGS(inode, offset, len, mode) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__fallocate_mode, ext4_punch_hole, + + TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode), + + TP_ARGS(inode, offset, len, mode) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__fallocate_mode, ext4_zero_range, + + TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode), + + TP_ARGS(inode, offset, len, mode) +) + +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */ + +LTTNG_TRACEPOINT_EVENT(ext4_fallocate_enter, + TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode), + + TP_ARGS(inode, offset, len, mode), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(loff_t, pos, offset) + ctf_integer(loff_t, len, len) + ctf_integer(int, mode, mode) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) + +LTTNG_TRACEPOINT_EVENT(ext4_punch_hole, + TP_PROTO(struct inode *inode, loff_t offset, loff_t len), + + TP_ARGS(inode, offset, len), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(loff_t, pos, offset) + ctf_integer(loff_t, len, len) + ) +) + +#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) */ + +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */ + +LTTNG_TRACEPOINT_EVENT(ext4_unlink_enter, + TP_PROTO(struct inode *parent, struct dentry *dentry), + + TP_ARGS(parent, dentry), + + TP_FIELDS( + ctf_integer(dev_t, dev, dentry->d_inode->i_sb->s_dev) + ctf_integer(ino_t, ino, dentry->d_inode->i_ino) + ctf_integer(ino_t, parent, parent->i_ino) + ctf_integer(loff_t, size, dentry->d_inode->i_size) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_unlink_exit, + TP_PROTO(struct dentry *dentry, int ret), + + TP_ARGS(dentry, ret), + + TP_FIELDS( + ctf_integer(dev_t, dev, dentry->d_inode->i_sb->s_dev) + ctf_integer(ino_t, ino, dentry->d_inode->i_ino) + ctf_integer(int, ret, ret) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(ext4__truncate, + TP_PROTO(struct inode *inode), + + TP_ARGS(inode), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(unsigned int, blocks, inode->i_blocks) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__truncate, ext4_truncate_enter, + + TP_PROTO(struct inode *inode), + + TP_ARGS(inode) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__truncate, ext4_truncate_exit, + + TP_PROTO(struct inode *inode), + + TP_ARGS(inode) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) +/* 'ux' is the uninitialized extent. */ +LTTNG_TRACEPOINT_EVENT(ext4_ext_convert_to_initialized_enter, + TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, + struct ext4_extent *ux), + + TP_ARGS(inode, map, ux), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_lblk_t, m_lblk, map->m_lblk) + ctf_integer(unsigned, m_len, map->m_len) + ctf_integer(ext4_lblk_t, u_lblk, le32_to_cpu(ux->ee_block)) + ctf_integer(unsigned, u_len, ext4_ext_get_actual_len(ux)) + ctf_integer(ext4_fsblk_t, u_pblk, ext4_ext_pblock(ux)) + ) +) + +/* + * 'ux' is the uninitialized extent. + * 'ix' is the initialized extent to which blocks are transferred. + */ +LTTNG_TRACEPOINT_EVENT(ext4_ext_convert_to_initialized_fastpath, + TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, + struct ext4_extent *ux, struct ext4_extent *ix), + + TP_ARGS(inode, map, ux, ix), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_lblk_t, m_lblk, map->m_lblk) + ctf_integer(unsigned, m_len, map->m_len) + ctf_integer(ext4_lblk_t, u_lblk, le32_to_cpu(ux->ee_block)) + ctf_integer(unsigned, u_len, ext4_ext_get_actual_len(ux)) + ctf_integer(ext4_fsblk_t, u_pblk, ext4_ext_pblock(ux)) + ctf_integer(ext4_lblk_t, i_lblk, le32_to_cpu(ix->ee_block)) + ctf_integer(unsigned, i_len, ext4_ext_get_actual_len(ix)) + ctf_integer(ext4_fsblk_t, i_pblk, ext4_ext_pblock(ix)) + ) +) +#endif + +LTTNG_TRACEPOINT_EVENT_CLASS(ext4__map_blocks_enter, + TP_PROTO(struct inode *inode, ext4_lblk_t lblk, + unsigned int len, unsigned int flags), + + TP_ARGS(inode, lblk, len, flags), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_lblk_t, lblk, lblk) + ctf_integer(unsigned int, len, len) + ctf_integer(unsigned int, flags, flags) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__map_blocks_enter, ext4_ext_map_blocks_enter, + TP_PROTO(struct inode *inode, ext4_lblk_t lblk, + unsigned len, unsigned flags), + + TP_ARGS(inode, lblk, len, flags) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__map_blocks_enter, ext4_ind_map_blocks_enter, + TP_PROTO(struct inode *inode, ext4_lblk_t lblk, + unsigned len, unsigned flags), + + TP_ARGS(inode, lblk, len, flags) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) + +LTTNG_TRACEPOINT_EVENT_CLASS(ext4__map_blocks_exit, + TP_PROTO(struct inode *inode, unsigned flags, struct ext4_map_blocks *map, + int ret), + + TP_ARGS(inode, flags, map, ret), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(unsigned int, flags, flags) + ctf_integer(ext4_fsblk_t, pblk, map->m_pblk) + ctf_integer(ext4_lblk_t, lblk, map->m_lblk) + ctf_integer(unsigned int, len, map->m_len) + ctf_integer(unsigned int, mflags, map->m_flags) + ctf_integer(int, ret, ret) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__map_blocks_exit, ext4_ext_map_blocks_exit, + TP_PROTO(struct inode *inode, unsigned flags, + struct ext4_map_blocks *map, int ret), + + TP_ARGS(inode, flags, map, ret) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__map_blocks_exit, ext4_ind_map_blocks_exit, + TP_PROTO(struct inode *inode, unsigned flags, + struct ext4_map_blocks *map, int ret), + + TP_ARGS(inode, flags, map, ret) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) + +LTTNG_TRACEPOINT_EVENT_CLASS(ext4__map_blocks_exit, + TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int ret), + + TP_ARGS(inode, map, ret), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_fsblk_t, pblk, map->m_pblk) + ctf_integer(ext4_lblk_t, lblk, map->m_lblk) + ctf_integer(unsigned int, len, map->m_len) + ctf_integer(unsigned int, mflags, map->m_flags) + ctf_integer(int, ret, ret) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__map_blocks_exit, ext4_ext_map_blocks_exit, + TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int ret), + + TP_ARGS(inode, map, ret) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__map_blocks_exit, ext4_ind_map_blocks_exit, + TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int ret), + + TP_ARGS(inode, map, ret) +) + +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */ + +LTTNG_TRACEPOINT_EVENT_CLASS(ext4__map_blocks_exit, + TP_PROTO(struct inode *inode, ext4_lblk_t lblk, + ext4_fsblk_t pblk, unsigned int len, int ret), + + TP_ARGS(inode, lblk, pblk, len, ret), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_fsblk_t, pblk, pblk) + ctf_integer(ext4_lblk_t, lblk, lblk) + ctf_integer(unsigned int, len, len) + ctf_integer(int, ret, ret) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__map_blocks_exit, ext4_ext_map_blocks_exit, + TP_PROTO(struct inode *inode, ext4_lblk_t lblk, + ext4_fsblk_t pblk, unsigned len, int ret), + + TP_ARGS(inode, lblk, pblk, len, ret) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__map_blocks_exit, ext4_ind_map_blocks_exit, + TP_PROTO(struct inode *inode, ext4_lblk_t lblk, + ext4_fsblk_t pblk, unsigned len, int ret), + + TP_ARGS(inode, lblk, pblk, len, ret) +) + +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */ + +LTTNG_TRACEPOINT_EVENT(ext4_ext_load_extent, + TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk), + + TP_ARGS(inode, lblk, pblk), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_fsblk_t, pblk, pblk) + ctf_integer(ext4_lblk_t, lblk, lblk) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_load_inode, + TP_PROTO(struct inode *inode), + + TP_ARGS(inode), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) + +LTTNG_TRACEPOINT_EVENT(ext4_journal_start, + TP_PROTO(struct super_block *sb, int blocks, int rsv_blocks, + int revoke_creds, unsigned long IP), + + TP_ARGS(sb, blocks, rsv_blocks, revoke_creds, IP), + + TP_FIELDS( + ctf_integer(dev_t, dev, sb->s_dev) + ctf_integer_hex(unsigned long, ip, IP) + ctf_integer(int, blocks, blocks) + ctf_integer(int, rsv_blocks, rsv_blocks) + ctf_integer(int, revoke_creds, revoke_creds) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_journal_start_reserved, + TP_PROTO(struct super_block *sb, int blocks, unsigned long IP), + + TP_ARGS(sb, blocks, IP), + + TP_FIELDS( + ctf_integer(dev_t, dev, sb->s_dev) + ctf_integer_hex(unsigned long, ip, IP) + ctf_integer(int, blocks, blocks) + ) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) + +LTTNG_TRACEPOINT_EVENT(ext4_journal_start, + TP_PROTO(struct super_block *sb, int blocks, int rsv_blocks, + unsigned long IP), + + TP_ARGS(sb, blocks, rsv_blocks, IP), + + TP_FIELDS( + ctf_integer(dev_t, dev, sb->s_dev) + ctf_integer_hex(unsigned long, ip, IP) + ctf_integer(int, blocks, blocks) + ctf_integer(int, rsv_blocks, rsv_blocks) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_journal_start_reserved, + TP_PROTO(struct super_block *sb, int blocks, unsigned long IP), + + TP_ARGS(sb, blocks, IP), + + TP_FIELDS( + ctf_integer(dev_t, dev, sb->s_dev) + ctf_integer_hex(unsigned long, ip, IP) + ctf_integer(int, blocks, blocks) + ) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) + +LTTNG_TRACEPOINT_EVENT(ext4_journal_start, + TP_PROTO(struct super_block *sb, int nblocks, unsigned long IP), + + TP_ARGS(sb, nblocks, IP), + + TP_FIELDS( + ctf_integer(dev_t, dev, sb->s_dev) + ctf_integer_hex(unsigned long, ip, IP) + ctf_integer(int, nblocks, nblocks) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(ext4__trim, + TP_PROTO(struct super_block *sb, + ext4_group_t group, + ext4_grpblk_t start, + ext4_grpblk_t len), + + TP_ARGS(sb, group, start, len), + + TP_FIELDS( + ctf_integer(int, dev_major, MAJOR(sb->s_dev)) + ctf_integer(int, dev_minor, MINOR(sb->s_dev)) + ctf_integer(__u32, group, group) + ctf_integer(int, start, start) + ctf_integer(int, len, len) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__trim, ext4_trim_extent, + + TP_PROTO(struct super_block *sb, + ext4_group_t group, + ext4_grpblk_t start, + ext4_grpblk_t len), + + TP_ARGS(sb, group, start, len) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__trim, ext4_trim_all_free, + + TP_PROTO(struct super_block *sb, + ext4_group_t group, + ext4_grpblk_t start, + ext4_grpblk_t len), + + TP_ARGS(sb, group, start, len) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) + +LTTNG_TRACEPOINT_EVENT(ext4_ext_handle_uninitialized_extents, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) + TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int flags, + unsigned int allocated, ext4_fsblk_t newblock), + + TP_ARGS(inode, map, flags, allocated, newblock), +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */ + TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, + unsigned int allocated, ext4_fsblk_t newblock), + + TP_ARGS(inode, map, allocated, newblock), +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */ + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) + ctf_integer(int, flags, flags) +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */ + ctf_integer(int, flags, map->m_flags) +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */ + ctf_integer(ext4_lblk_t, lblk, map->m_lblk) + ctf_integer(ext4_fsblk_t, pblk, map->m_pblk) + ctf_integer(unsigned int, len, map->m_len) + ctf_integer(unsigned int, allocated, allocated) + ctf_integer(ext4_fsblk_t, newblk, newblock) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_get_implied_cluster_alloc_exit, + TP_PROTO(struct super_block *sb, struct ext4_map_blocks *map, int ret), + + TP_ARGS(sb, map, ret), + + TP_FIELDS( + ctf_integer(dev_t, dev, sb->s_dev) + ctf_integer(unsigned int, flags, map->m_flags) + ctf_integer(ext4_lblk_t, lblk, map->m_lblk) + ctf_integer(ext4_fsblk_t, pblk, map->m_pblk) + ctf_integer(unsigned int, len, map->m_len) + ctf_integer(int, ret, ret) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_ext_put_in_cache, + TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len, + ext4_fsblk_t start), + + TP_ARGS(inode, lblk, len, start), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_lblk_t, lblk, lblk) + ctf_integer(unsigned int, len, len) + ctf_integer(ext4_fsblk_t, start, start) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_ext_in_cache, + TP_PROTO(struct inode *inode, ext4_lblk_t lblk, int ret), + + TP_ARGS(inode, lblk, ret), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_lblk_t, lblk, lblk) + ctf_integer(int, ret, ret) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_find_delalloc_range, + TP_PROTO(struct inode *inode, ext4_lblk_t from, ext4_lblk_t to, + int reverse, int found, ext4_lblk_t found_blk), + + TP_ARGS(inode, from, to, reverse, found, found_blk), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_lblk_t, from, from) + ctf_integer(ext4_lblk_t, to, to) + ctf_integer(int, reverse, reverse) + ctf_integer(int, found, found) + ctf_integer(ext4_lblk_t, found_blk, found_blk) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_get_reserved_cluster_alloc, + TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len), + + TP_ARGS(inode, lblk, len), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_lblk_t, lblk, lblk) + ctf_integer(unsigned int, len, len) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_ext_show_extent, + TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk, + unsigned short len), + + TP_ARGS(inode, lblk, pblk, len), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_fsblk_t, pblk, pblk) + ctf_integer(ext4_lblk_t, lblk, lblk) + ctf_integer(unsigned short, len, len) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \ + LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0)) + +LTTNG_TRACEPOINT_EVENT(ext4_remove_blocks, + TP_PROTO(struct inode *inode, struct ext4_extent *ex, + ext4_lblk_t from, ext4_fsblk_t to, + struct partial_cluster *pc), + + TP_ARGS(inode, ex, from, to, pc), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_lblk_t, from, from) + ctf_integer(ext4_lblk_t, to, to) + ctf_integer(ext4_fsblk_t, ee_pblk, ext4_ext_pblock(ex)) + ctf_integer(ext4_lblk_t, ee_lblk, le32_to_cpu(ex->ee_block)) + ctf_integer(unsigned short, ee_len, ext4_ext_get_actual_len(ex)) + ctf_integer(ext4_fsblk_t, pc_pclu, pc->pclu) + ctf_integer(ext4_lblk_t, pc_lblk, pc->lblk) + ctf_integer(int, pc_state, pc->state) + ) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) + +LTTNG_TRACEPOINT_EVENT(ext4_remove_blocks, + TP_PROTO(struct inode *inode, struct ext4_extent *ex, + ext4_lblk_t from, ext4_fsblk_t to, + long long partial_cluster), + + TP_ARGS(inode, ex, from, to, partial_cluster), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_lblk_t, from, from) + ctf_integer(ext4_lblk_t, to, to) + ctf_integer(long long, partial, partial_cluster) + ctf_integer(ext4_fsblk_t, ee_pblk, ext4_ext_pblock(ex)) + ctf_integer(ext4_lblk_t, ee_lblk, le32_to_cpu(ex->ee_block)) + ctf_integer(unsigned short, ee_len, ext4_ext_get_actual_len(ex)) + ) +) + +#else + +LTTNG_TRACEPOINT_EVENT(ext4_remove_blocks, + TP_PROTO(struct inode *inode, struct ext4_extent *ex, + ext4_lblk_t from, ext4_fsblk_t to, + ext4_fsblk_t partial_cluster), + + TP_ARGS(inode, ex, from, to, partial_cluster), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_lblk_t, from, from) + ctf_integer(ext4_lblk_t, to, to) + ctf_integer(ext4_fsblk_t, partial, partial_cluster) + ctf_integer(ext4_fsblk_t, ee_pblk, ext4_ext_pblock(ex)) + ctf_integer(ext4_lblk_t, ee_lblk, le32_to_cpu(ex->ee_block)) + ctf_integer(unsigned short, ee_len, ext4_ext_get_actual_len(ex)) + ) +) + +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \ + LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0)) + +LTTNG_TRACEPOINT_EVENT(ext4_ext_rm_leaf, + TP_PROTO(struct inode *inode, ext4_lblk_t start, + struct ext4_extent *ex, + struct partial_cluster *pc), + + TP_ARGS(inode, start, ex, pc), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_lblk_t, start, start) + ctf_integer(ext4_lblk_t, ee_lblk, le32_to_cpu(ex->ee_block)) + ctf_integer(ext4_fsblk_t, ee_pblk, ext4_ext_pblock(ex)) + ctf_integer(short, ee_len, ext4_ext_get_actual_len(ex)) + ctf_integer(ext4_fsblk_t, pc_pclu, pc->pclu) + ctf_integer(ext4_lblk_t, pc_lblk, pc->lblk) + ctf_integer(int, pc_state, pc->state) + ) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) + +LTTNG_TRACEPOINT_EVENT(ext4_ext_rm_leaf, + TP_PROTO(struct inode *inode, ext4_lblk_t start, + struct ext4_extent *ex, + long long partial_cluster), + + TP_ARGS(inode, start, ex, partial_cluster), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(long long, partial, partial_cluster) + ctf_integer(ext4_lblk_t, start, start) + ctf_integer(ext4_lblk_t, ee_lblk, le32_to_cpu(ex->ee_block)) + ctf_integer(ext4_fsblk_t, ee_pblk, ext4_ext_pblock(ex)) + ctf_integer(short, ee_len, ext4_ext_get_actual_len(ex)) + ) +) + +#else + +LTTNG_TRACEPOINT_EVENT(ext4_ext_rm_leaf, + TP_PROTO(struct inode *inode, ext4_lblk_t start, + struct ext4_extent *ex, ext4_fsblk_t partial_cluster), + + TP_ARGS(inode, start, ex, partial_cluster), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(long long, partial, partial_cluster) + ctf_integer(ext4_lblk_t, start, start) + ctf_integer(ext4_lblk_t, ee_lblk, le32_to_cpu(ex->ee_block)) + ctf_integer(ext4_fsblk_t, ee_pblk, ext4_ext_pblock(ex)) + ctf_integer(short, ee_len, ext4_ext_get_actual_len(ex)) + ) +) + +#endif + +LTTNG_TRACEPOINT_EVENT(ext4_ext_rm_idx, + TP_PROTO(struct inode *inode, ext4_fsblk_t pblk), + + TP_ARGS(inode, pblk), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_fsblk_t, pblk, pblk) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) + +LTTNG_TRACEPOINT_EVENT(ext4_ext_remove_space, + TP_PROTO(struct inode *inode, ext4_lblk_t start, + ext4_lblk_t end, int depth), + + TP_ARGS(inode, start, end, depth), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_lblk_t, start, start) + ctf_integer(ext4_lblk_t, end, end) + ctf_integer(int, depth, depth) + ) +) + +#else + +LTTNG_TRACEPOINT_EVENT(ext4_ext_remove_space, + TP_PROTO(struct inode *inode, ext4_lblk_t start, int depth), + + TP_ARGS(inode, start, depth), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_lblk_t, start, start) + ctf_integer(int, depth, depth) + ) +) + +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \ + LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0)) + +LTTNG_TRACEPOINT_EVENT(ext4_ext_remove_space_done, + TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t end, + int depth, struct partial_cluster *pc, __le16 eh_entries), + + TP_ARGS(inode, start, end, depth, pc, eh_entries), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_lblk_t, start, start) + ctf_integer(ext4_lblk_t, end, end) + ctf_integer(int, depth, depth) + ctf_integer(unsigned short, eh_entries, le16_to_cpu(eh_entries)) + ctf_integer(ext4_fsblk_t, pc_pclu, pc->pclu) + ctf_integer(ext4_lblk_t, pc_lblk, pc->lblk) + ctf_integer(int, pc_state, pc->state) + ) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) + +LTTNG_TRACEPOINT_EVENT(ext4_ext_remove_space_done, + TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t end, + int depth, long long partial, __le16 eh_entries), + + TP_ARGS(inode, start, end, depth, partial, eh_entries), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_lblk_t, start, start) + ctf_integer(ext4_lblk_t, end, end) + ctf_integer(int, depth, depth) + ctf_integer(long long, partial, partial) + ctf_integer(unsigned short, eh_entries, le16_to_cpu(eh_entries)) + ) +) + +#else + +LTTNG_TRACEPOINT_EVENT(ext4_ext_remove_space_done, + TP_PROTO(struct inode *inode, ext4_lblk_t start, int depth, + ext4_lblk_t partial, unsigned short eh_entries), + + TP_ARGS(inode, start, depth, partial, eh_entries), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_lblk_t, start, start) + ctf_integer(int, depth, depth) + ctf_integer(ext4_lblk_t, partial, partial) + ctf_integer(unsigned short, eh_entries, eh_entries) + ) +) + +#endif + +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) + +LTTNG_TRACEPOINT_EVENT_CLASS(ext4__es_extent, + TP_PROTO(struct inode *inode, struct extent_status *es), + + TP_ARGS(inode, es), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_lblk_t, lblk, es->es_lblk) + ctf_integer(ext4_lblk_t, len, es->es_len) + ctf_integer(ext4_fsblk_t, pblk, ext4_es_pblock(es)) + ctf_integer(char, status, ext4_es_status(es)) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__es_extent, ext4_es_insert_extent, + TP_PROTO(struct inode *inode, struct extent_status *es), + + TP_ARGS(inode, es) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__es_extent, ext4_es_cache_extent, + TP_PROTO(struct inode *inode, struct extent_status *es), + + TP_ARGS(inode, es) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) + +LTTNG_TRACEPOINT_EVENT(ext4_es_insert_extent, + TP_PROTO(struct inode *inode, struct extent_status *es), + + TP_ARGS(inode, es), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_lblk_t, lblk, es->es_lblk) + ctf_integer(ext4_lblk_t, len, es->es_len) + ctf_integer(ext4_fsblk_t, pblk, ext4_es_pblock(es)) + ctf_integer(char, status, ext4_es_status(es) >> 60) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_es_remove_extent, + TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_lblk_t len), + + TP_ARGS(inode, lblk, len), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(loff_t, lblk, lblk) + ctf_integer(loff_t, len, len) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_es_find_delayed_extent_range_enter, + TP_PROTO(struct inode *inode, ext4_lblk_t lblk), + + TP_ARGS(inode, lblk), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_lblk_t, lblk, lblk) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_es_find_delayed_extent_range_exit, + TP_PROTO(struct inode *inode, struct extent_status *es), + + TP_ARGS(inode, es), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_lblk_t, lblk, es->es_lblk) + ctf_integer(ext4_lblk_t, len, es->es_len) + ctf_integer(ext4_fsblk_t, pblk, ext4_es_pblock(es)) + ctf_integer(char, status, ext4_es_status(es) >> 60) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_es_lookup_extent_enter, + TP_PROTO(struct inode *inode, ext4_lblk_t lblk), + + TP_ARGS(inode, lblk), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_lblk_t, lblk, lblk) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_es_lookup_extent_exit, + TP_PROTO(struct inode *inode, struct extent_status *es, + int found), + + TP_ARGS(inode, es, found), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ctf_integer(ext4_lblk_t, lblk, es->es_lblk) + ctf_integer(ext4_lblk_t, len, es->es_len) + ctf_integer(ext4_fsblk_t, pblk, ext4_es_pblock(es)) + ctf_integer(char, status, ext4_es_status(es) >> 60) + ctf_integer(int, found, found) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_es_shrink_enter, + TP_PROTO(struct super_block *sb, int nr_to_scan, int cache_cnt), + + TP_ARGS(sb, nr_to_scan, cache_cnt), + + TP_FIELDS( + ctf_integer(dev_t, dev, sb->s_dev) + ctf_integer(int, nr_to_scan, nr_to_scan) + ctf_integer(int, cache_cnt, cache_cnt) + ) +) + +LTTNG_TRACEPOINT_EVENT(ext4_es_shrink_exit, + TP_PROTO(struct super_block *sb, int shrunk_nr, int cache_cnt), + + TP_ARGS(sb, shrunk_nr, cache_cnt), + + TP_FIELDS( + ctf_integer(dev_t, dev, sb->s_dev) + ctf_integer(int, shrunk_nr, shrunk_nr) + ctf_integer(int, cache_cnt, cache_cnt) + ) +) + +#endif + +#endif /* LTTNG_TRACE_EXT4_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/gpio.h b/include/instrumentation/events/gpio.h new file mode 100644 index 00000000..97e5e847 --- /dev/null +++ b/include/instrumentation/events/gpio.h @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM gpio + +#if !defined(LTTNG_TRACE_GPIO_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_GPIO_H + +#include + +LTTNG_TRACEPOINT_EVENT(gpio_direction, + + TP_PROTO(unsigned gpio, int in, int err), + + TP_ARGS(gpio, in, err), + + TP_FIELDS( + ctf_integer(unsigned, gpio, gpio) + ctf_integer(int, in, in) + ctf_integer(int, err, err) + ) +) + +LTTNG_TRACEPOINT_EVENT(gpio_value, + + TP_PROTO(unsigned gpio, int get, int value), + + TP_ARGS(gpio, get, value), + + TP_FIELDS( + ctf_integer(unsigned, gpio, gpio) + ctf_integer(int, get, get) + ctf_integer(int, value, value) + ) +) + +#endif /* if !defined(LTTNG_TRACE_GPIO_H) || defined(TRACE_HEADER_MULTI_READ) */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/i2c.h b/include/instrumentation/events/i2c.h new file mode 100644 index 00000000..312f6733 --- /dev/null +++ b/include/instrumentation/events/i2c.h @@ -0,0 +1,120 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM i2c + +#if !defined(LTTNG_TRACE_I2C_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_I2C_H + +#include + +/* + * __i2c_transfer() write request + */ +LTTNG_TRACEPOINT_EVENT_CODE(i2c_write, + + TP_PROTO(const struct i2c_adapter *adap, const struct i2c_msg *msg, + int num), + + TP_ARGS(adap, msg, num), + + TP_locvar( + int extract_sensitive_payload; + ), + + TP_code_pre( + tp_locvar->extract_sensitive_payload = + READ_ONCE(extract_sensitive_payload); + ), + + TP_FIELDS( + ctf_integer(int, adapter_nr, adap->nr) + ctf_integer(__u16, msg_nr, num) + ctf_integer(__u16, addr, msg->addr) + ctf_integer(__u16, flags, msg->flags) + ctf_integer(__u16, len, msg->len) + ctf_sequence_hex(__u8, buf, + tp_locvar->extract_sensitive_payload ? + msg->buf : NULL, + __u16, + tp_locvar->extract_sensitive_payload ? + msg->len : 0) + ), + + TP_code_post() +) + +/* + * __i2c_transfer() read request + */ +LTTNG_TRACEPOINT_EVENT(i2c_read, + + TP_PROTO(const struct i2c_adapter *adap, const struct i2c_msg *msg, + int num), + + TP_ARGS(adap, msg, num), + + TP_FIELDS( + ctf_integer(int, adapter_nr, adap->nr) + ctf_integer(__u16, msg_nr, num) + ctf_integer(__u16, addr, msg->addr) + ctf_integer(__u16, flags, msg->flags) + ctf_integer(__u16, len, msg->len) + ) +) + +/* + * __i2c_transfer() read reply + */ +LTTNG_TRACEPOINT_EVENT_CODE(i2c_reply, + + TP_PROTO(const struct i2c_adapter *adap, const struct i2c_msg *msg, + int num), + + TP_ARGS(adap, msg, num), + + TP_locvar( + int extract_sensitive_payload; + ), + + TP_code_pre( + tp_locvar->extract_sensitive_payload = + READ_ONCE(extract_sensitive_payload); + ), + + TP_FIELDS( + ctf_integer(int, adapter_nr, adap->nr) + ctf_integer(__u16, msg_nr, num) + ctf_integer(__u16, addr, msg->addr) + ctf_integer(__u16, flags, msg->flags) + ctf_integer(__u16, len, msg->len) + ctf_sequence_hex(__u8, buf, + tp_locvar->extract_sensitive_payload ? + msg->buf : NULL, + __u16, + tp_locvar->extract_sensitive_payload ? + msg->len : 0) + ), + + TP_code_post() +) + +/* + * __i2c_transfer() result + */ +LTTNG_TRACEPOINT_EVENT(i2c_result, + + TP_PROTO(const struct i2c_adapter *adap, int num, int ret), + + TP_ARGS(adap, num, ret), + + TP_FIELDS( + ctf_integer(int, adapter_nr, adap->nr) + ctf_integer(__u16, nr_msgs, num) + ctf_integer(__s16, ret, ret) + ) +) + +#endif /* LTTNG_TRACE_I2C_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/irq.h b/include/instrumentation/events/irq.h new file mode 100644 index 00000000..a66b8139 --- /dev/null +++ b/include/instrumentation/events/irq.h @@ -0,0 +1,126 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM irq + +#if !defined(LTTNG_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_IRQ_H + +#include + +#ifndef _TRACE_IRQ_DEF_ +#define _TRACE_IRQ_DEF_ + +struct irqaction; +struct softirq_action; + +#endif /* _TRACE_IRQ_DEF_ */ + +/** + * irq_handler_entry - called immediately before the irq action handler + * @irq: irq number + * @action: pointer to struct irqaction + * + * The struct irqaction pointed to by @action contains various + * information about the handler, including the device name, + * @action->name, and the device id, @action->dev_id. When used in + * conjunction with the irq_handler_exit tracepoint, we can figure + * out irq handler latencies. + */ +LTTNG_TRACEPOINT_EVENT(irq_handler_entry, + + TP_PROTO(int irq, struct irqaction *action), + + TP_ARGS(irq, action), + + TP_FIELDS( + ctf_integer(int, irq, irq) + ctf_string(name, action->name) + ) +) + +/** + * irq_handler_exit - called immediately after the irq action handler returns + * @irq: irq number + * @action: pointer to struct irqaction + * @ret: return value + * + * If the @ret value is set to IRQ_HANDLED, then we know that the corresponding + * @action->handler scuccessully handled this irq. Otherwise, the irq might be + * a shared irq line, or the irq was not handled successfully. Can be used in + * conjunction with the irq_handler_entry to understand irq handler latencies. + */ +LTTNG_TRACEPOINT_EVENT(irq_handler_exit, + + TP_PROTO(int irq, struct irqaction *action, int ret), + + TP_ARGS(irq, action, ret), + + TP_FIELDS( + ctf_integer(int, irq, irq) + ctf_integer(int, ret, ret) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(irq_softirq, + + TP_PROTO(unsigned int vec_nr), + + TP_ARGS(vec_nr), + + TP_FIELDS( + ctf_integer(unsigned int, vec, vec_nr) + ) +) + +/** + * softirq_entry - called immediately before the softirq handler + * @vec_nr: softirq vector number + * + * When used in combination with the softirq_exit tracepoint + * we can determine the softirq handler runtine. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(irq_softirq, softirq_entry, + + irq_softirq_entry, + + TP_PROTO(unsigned int vec_nr), + + TP_ARGS(vec_nr) +) + +/** + * softirq_exit - called immediately after the softirq handler returns + * @vec_nr: softirq vector number + * + * When used in combination with the softirq_entry tracepoint + * we can determine the softirq handler runtine. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(irq_softirq, softirq_exit, + + irq_softirq_exit, + + TP_PROTO(unsigned int vec_nr), + + TP_ARGS(vec_nr) +) + +/** + * softirq_raise - called immediately when a softirq is raised + * @vec_nr: softirq vector number + * + * When used in combination with the softirq_entry tracepoint + * we can determine the softirq raise to run latency. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(irq_softirq, softirq_raise, + + irq_softirq_raise, + + TP_PROTO(unsigned int vec_nr), + + TP_ARGS(vec_nr) +) + +#endif /* LTTNG_TRACE_IRQ_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/jbd.h b/include/instrumentation/events/jbd.h new file mode 100644 index 00000000..e9aabd69 --- /dev/null +++ b/include/instrumentation/events/jbd.h @@ -0,0 +1,157 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM jbd + +#if !defined(LTTNG_TRACE_JBD_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_JBD_H + +#include +#include +#include + +LTTNG_TRACEPOINT_EVENT(jbd_checkpoint, + + TP_PROTO(journal_t *journal, int result), + + TP_ARGS(journal, result), + + TP_FIELDS( + ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) + ctf_integer(int, result, result) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(jbd_commit, + + TP_PROTO(journal_t *journal, transaction_t *commit_transaction), + + TP_ARGS(journal, commit_transaction), + + TP_FIELDS( + ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) + ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit) +#endif + ctf_integer(int, transaction, commit_transaction->t_tid) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd_commit, jbd_start_commit, + + TP_PROTO(journal_t *journal, transaction_t *commit_transaction), + + TP_ARGS(journal, commit_transaction) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd_commit, jbd_commit_locking, + + TP_PROTO(journal_t *journal, transaction_t *commit_transaction), + + TP_ARGS(journal, commit_transaction) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd_commit, jbd_commit_flushing, + + TP_PROTO(journal_t *journal, transaction_t *commit_transaction), + + TP_ARGS(journal, commit_transaction) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd_commit, jbd_commit_logging, + + TP_PROTO(journal_t *journal, transaction_t *commit_transaction), + + TP_ARGS(journal, commit_transaction) +) + +LTTNG_TRACEPOINT_EVENT(jbd_drop_transaction, + + TP_PROTO(journal_t *journal, transaction_t *commit_transaction), + + TP_ARGS(journal, commit_transaction), + + TP_FIELDS( + ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) + ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit) +#endif + ctf_integer(int, transaction, commit_transaction->t_tid) + ) +) + +LTTNG_TRACEPOINT_EVENT(jbd_end_commit, + TP_PROTO(journal_t *journal, transaction_t *commit_transaction), + + TP_ARGS(journal, commit_transaction), + + TP_FIELDS( + ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) + ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit) +#endif + ctf_integer(int, transaction, commit_transaction->t_tid) + ctf_integer(int, head, journal->j_tail_sequence) + ) +) + +LTTNG_TRACEPOINT_EVENT(jbd_do_submit_data, + TP_PROTO(journal_t *journal, transaction_t *commit_transaction), + + TP_ARGS(journal, commit_transaction), + + TP_FIELDS( + ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) + ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit) +#endif + ctf_integer(int, transaction, commit_transaction->t_tid) + ) +) + +LTTNG_TRACEPOINT_EVENT(jbd_cleanup_journal_tail, + + TP_PROTO(journal_t *journal, tid_t first_tid, + unsigned long block_nr, unsigned long freed), + + TP_ARGS(journal, first_tid, block_nr, freed), + + TP_FIELDS( + ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) + ctf_integer(tid_t, tail_sequence, journal->j_tail_sequence) + ctf_integer(tid_t, first_tid, first_tid) + ctf_integer(unsigned long, block_nr, block_nr) + ctf_integer(unsigned long, freed, freed) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) +LTTNG_TRACEPOINT_EVENT_MAP(journal_write_superblock, + + jbd_journal_write_superblock, + + TP_PROTO(journal_t *journal, int write_op), + + TP_ARGS(journal, write_op), + + TP_FIELDS( + ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) + ctf_integer(int, write_op, write_op) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(jbd_update_superblock_end, + TP_PROTO(journal_t *journal, int wait), + + TP_ARGS(journal, wait), + + TP_FIELDS( + ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) + ctf_integer(int, wait, wait) + ) +) +#endif + +#endif /* LTTNG_TRACE_JBD_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/jbd2.h b/include/instrumentation/events/jbd2.h new file mode 100644 index 00000000..04968735 --- /dev/null +++ b/include/instrumentation/events/jbd2.h @@ -0,0 +1,177 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM jbd2 + +#if !defined(LTTNG_TRACE_JBD2_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_JBD2_H + +#include +#include +#include + +#ifndef _TRACE_JBD2_DEF +#define _TRACE_JBD2_DEF +struct transaction_chp_stats_s; +struct transaction_run_stats_s; +#endif + +LTTNG_TRACEPOINT_EVENT(jbd2_checkpoint, + + TP_PROTO(journal_t *journal, int result), + + TP_ARGS(journal, result), + + TP_FIELDS( + ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) + ctf_integer(int, result, result) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(jbd2_commit, + + TP_PROTO(journal_t *journal, transaction_t *commit_transaction), + + TP_ARGS(journal, commit_transaction), + + TP_FIELDS( + ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) + ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit) + ctf_integer(int, transaction, commit_transaction->t_tid) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_start_commit, + + TP_PROTO(journal_t *journal, transaction_t *commit_transaction), + + TP_ARGS(journal, commit_transaction) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_commit_locking, + + TP_PROTO(journal_t *journal, transaction_t *commit_transaction), + + TP_ARGS(journal, commit_transaction) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_commit_flushing, + + TP_PROTO(journal_t *journal, transaction_t *commit_transaction), + + TP_ARGS(journal, commit_transaction) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_commit_logging, + + TP_PROTO(journal_t *journal, transaction_t *commit_transaction), + + TP_ARGS(journal, commit_transaction) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) +LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_drop_transaction, + + TP_PROTO(journal_t *journal, transaction_t *commit_transaction), + + TP_ARGS(journal, commit_transaction) +) +#endif + +LTTNG_TRACEPOINT_EVENT(jbd2_end_commit, + TP_PROTO(journal_t *journal, transaction_t *commit_transaction), + + TP_ARGS(journal, commit_transaction), + + TP_FIELDS( + ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) + ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit) + ctf_integer(int, transaction, commit_transaction->t_tid) + ctf_integer(int, head, journal->j_tail_sequence) + ) +) + +LTTNG_TRACEPOINT_EVENT(jbd2_submit_inode_data, + TP_PROTO(struct inode *inode), + + TP_ARGS(inode), + + TP_FIELDS( + ctf_integer(dev_t, dev, inode->i_sb->s_dev) + ctf_integer(ino_t, ino, inode->i_ino) + ) +) + +LTTNG_TRACEPOINT_EVENT(jbd2_run_stats, + TP_PROTO(dev_t dev, unsigned long tid, + struct transaction_run_stats_s *stats), + + TP_ARGS(dev, tid, stats), + + TP_FIELDS( + ctf_integer(dev_t, dev, dev) + ctf_integer(unsigned long, tid, tid) + ctf_integer(unsigned long, wait, stats->rs_wait) + ctf_integer(unsigned long, running, stats->rs_running) + ctf_integer(unsigned long, locked, stats->rs_locked) + ctf_integer(unsigned long, flushing, stats->rs_flushing) + ctf_integer(unsigned long, logging, stats->rs_logging) + ctf_integer(__u32, handle_count, stats->rs_handle_count) + ctf_integer(__u32, blocks, stats->rs_blocks) + ctf_integer(__u32, blocks_logged, stats->rs_blocks_logged) + ) +) + +LTTNG_TRACEPOINT_EVENT(jbd2_checkpoint_stats, + TP_PROTO(dev_t dev, unsigned long tid, + struct transaction_chp_stats_s *stats), + + TP_ARGS(dev, tid, stats), + + TP_FIELDS( + ctf_integer(dev_t, dev, dev) + ctf_integer(unsigned long, tid, tid) + ctf_integer(unsigned long, chp_time, stats->cs_chp_time) + ctf_integer(__u32, forced_to_close, stats->cs_forced_to_close) + ctf_integer(__u32, written, stats->cs_written) + ctf_integer(__u32, dropped, stats->cs_dropped) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) +LTTNG_TRACEPOINT_EVENT(jbd2_update_log_tail, +#else +LTTNG_TRACEPOINT_EVENT(jbd2_cleanup_journal_tail, +#endif + + TP_PROTO(journal_t *journal, tid_t first_tid, + unsigned long block_nr, unsigned long freed), + + TP_ARGS(journal, first_tid, block_nr, freed), + + TP_FIELDS( + ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) + ctf_integer(tid_t, tail_sequence, journal->j_tail_sequence) + ctf_integer(tid_t, first_tid, first_tid) + ctf_integer(unsigned long, block_nr, block_nr) + ctf_integer(unsigned long, freed, freed) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) +LTTNG_TRACEPOINT_EVENT(jbd2_write_superblock, + + TP_PROTO(journal_t *journal, int write_op), + + TP_ARGS(journal, write_op), + + TP_FIELDS( + ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) + ctf_integer(int, write_op, write_op) + ) +) +#endif + +#endif /* LTTNG_TRACE_JBD2_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/kmem.h b/include/instrumentation/events/kmem.h new file mode 100644 index 00000000..8f56cc5a --- /dev/null +++ b/include/instrumentation/events/kmem.h @@ -0,0 +1,338 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM kmem + +#if !defined(LTTNG_TRACE_KMEM_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_KMEM_H + +#include +#include +#include + +LTTNG_TRACEPOINT_EVENT_CLASS(kmem_alloc, + + TP_PROTO(unsigned long call_site, + const void *ptr, + size_t bytes_req, + size_t bytes_alloc, + gfp_t gfp_flags), + + TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags), + + TP_FIELDS( + ctf_integer_hex(unsigned long, call_site, call_site) + ctf_integer_hex(const void *, ptr, ptr) + ctf_integer(size_t, bytes_req, bytes_req) + ctf_integer(size_t, bytes_alloc, bytes_alloc) + ctf_integer(gfp_t, gfp_flags, gfp_flags) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(kmem_alloc, kmalloc, + + kmem_kmalloc, + + TP_PROTO(unsigned long call_site, const void *ptr, + size_t bytes_req, size_t bytes_alloc, gfp_t gfp_flags), + + TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(kmem_alloc, kmem_cache_alloc, + + TP_PROTO(unsigned long call_site, const void *ptr, + size_t bytes_req, size_t bytes_alloc, gfp_t gfp_flags), + + TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(kmem_alloc_node, + + TP_PROTO(unsigned long call_site, + const void *ptr, + size_t bytes_req, + size_t bytes_alloc, + gfp_t gfp_flags, + int node), + + TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node), + + TP_FIELDS( + ctf_integer_hex(unsigned long, call_site, call_site) + ctf_integer_hex(const void *, ptr, ptr) + ctf_integer(size_t, bytes_req, bytes_req) + ctf_integer(size_t, bytes_alloc, bytes_alloc) + ctf_integer(gfp_t, gfp_flags, gfp_flags) + ctf_integer(int, node, node) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(kmem_alloc_node, kmalloc_node, + + kmem_kmalloc_node, + + TP_PROTO(unsigned long call_site, const void *ptr, + size_t bytes_req, size_t bytes_alloc, + gfp_t gfp_flags, int node), + + TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(kmem_alloc_node, kmem_cache_alloc_node, + + TP_PROTO(unsigned long call_site, const void *ptr, + size_t bytes_req, size_t bytes_alloc, + gfp_t gfp_flags, int node), + + TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(kmem_free, + + TP_PROTO(unsigned long call_site, const void *ptr), + + TP_ARGS(call_site, ptr), + + TP_FIELDS( + ctf_integer_hex(unsigned long, call_site, call_site) + ctf_integer_hex(const void *, ptr, ptr) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(kmem_free, kfree, + + kmem_kfree, + + TP_PROTO(unsigned long call_site, const void *ptr), + + TP_ARGS(call_site, ptr) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(kmem_free, kmem_cache_free, + + TP_PROTO(unsigned long call_site, const void *ptr), + + TP_ARGS(call_site, ptr) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) +LTTNG_TRACEPOINT_EVENT_MAP(mm_page_free, kmem_mm_page_free, +#else +LTTNG_TRACEPOINT_EVENT_MAP(mm_page_free_direct, kmem_mm_page_free_direct, +#endif + + TP_PROTO(struct page *page, unsigned int order), + + TP_ARGS(page, order), + + TP_FIELDS( + ctf_integer_hex(struct page *, page, page) + ctf_integer(unsigned long, pfn, page_to_pfn(page)) + ctf_integer(unsigned int, order, order) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) +LTTNG_TRACEPOINT_EVENT_MAP(mm_page_free_batched, kmem_mm_page_free_batched, + + TP_PROTO(struct page *page), + + TP_ARGS(page), + + TP_FIELDS( + ctf_integer_hex(struct page *, page, page) + ctf_integer(unsigned long, pfn, page_to_pfn(page)) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) +LTTNG_TRACEPOINT_EVENT_MAP(mm_page_free_batched, kmem_mm_page_free_batched, + + TP_PROTO(struct page *page, int cold), + + TP_ARGS(page, cold), + + TP_FIELDS( + ctf_integer_hex(struct page *, page, page) + ctf_integer(unsigned long, pfn, page_to_pfn(page)) + ctf_integer(int, cold, cold) + ) +) +#else +LTTNG_TRACEPOINT_EVENT_MAP(mm_pagevec_free, kmem_pagevec_free, + + TP_PROTO(struct page *page, int cold), + + TP_ARGS(page, cold), + + TP_FIELDS( + ctf_integer_hex(struct page *, page, page) + ctf_integer(unsigned long, pfn, page_to_pfn(page)) + ctf_integer(int, cold, cold) + ) +) +#endif + +LTTNG_TRACEPOINT_EVENT_MAP(mm_page_alloc, kmem_mm_page_alloc, + + TP_PROTO(struct page *page, unsigned int order, + gfp_t gfp_flags, int migratetype), + + TP_ARGS(page, order, gfp_flags, migratetype), + + TP_FIELDS( + ctf_integer_hex(struct page *, page, page) + ctf_integer(unsigned long, pfn, + page ? page_to_pfn(page) : -1UL) + ctf_integer(unsigned int, order, order) + ctf_integer(gfp_t, gfp_flags, gfp_flags) + ctf_integer(int, migratetype, migratetype) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(kmem_mm_page, + + TP_PROTO(struct page *page, unsigned int order, int migratetype), + + TP_ARGS(page, order, migratetype), + + TP_FIELDS( + ctf_integer_hex(struct page *, page, page) + ctf_integer(unsigned long, pfn, + page ? page_to_pfn(page) : -1UL) + ctf_integer(unsigned int, order, order) + ctf_integer(int, migratetype, migratetype) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(kmem_mm_page, mm_page_alloc_zone_locked, + + kmem_mm_page_alloc_zone_locked, + + TP_PROTO(struct page *page, unsigned int order, int migratetype), + + TP_ARGS(page, order, migratetype) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(kmem_mm_page, mm_page_pcpu_drain, + + kmem_mm_page_pcpu_drain, + + TP_PROTO(struct page *page, unsigned int order, int migratetype), + + TP_ARGS(page, order, migratetype) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,2) \ + || LTTNG_KERNEL_RANGE(3,14,36, 3,15,0) \ + || LTTNG_KERNEL_RANGE(3,16,35, 3,17,0) \ + || LTTNG_KERNEL_RANGE(3,18,10, 3,19,0) \ + || LTTNG_DEBIAN_KERNEL_RANGE(3,16,7,9,0,0, 3,17,0,0,0,0) \ + || LTTNG_UBUNTU_KERNEL_RANGE(3,13,11,50, 3,14,0,0) \ + || LTTNG_UBUNTU_KERNEL_RANGE(3,16,7,34, 3,17,0,0)) + +LTTNG_TRACEPOINT_EVENT_MAP(mm_page_alloc_extfrag, + + kmem_mm_page_alloc_extfrag, + + TP_PROTO(struct page *page, + int alloc_order, int fallback_order, + int alloc_migratetype, int fallback_migratetype), + + TP_ARGS(page, + alloc_order, fallback_order, + alloc_migratetype, fallback_migratetype), + + TP_FIELDS( + ctf_integer_hex(struct page *, page, page) + ctf_integer(unsigned long, pfn, page_to_pfn(page)) + ctf_integer(int, alloc_order, alloc_order) + ctf_integer(int, fallback_order, fallback_order) + ctf_integer(int, alloc_migratetype, alloc_migratetype) + ctf_integer(int, fallback_migratetype, fallback_migratetype) + ctf_integer(int, change_ownership, + (alloc_migratetype == get_pageblock_migratetype(page))) + ) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,30)) + +LTTNG_TRACEPOINT_EVENT_MAP(mm_page_alloc_extfrag, + + kmem_mm_page_alloc_extfrag, + + TP_PROTO(struct page *page, + int alloc_order, int fallback_order, + int alloc_migratetype, int fallback_migratetype, int new_migratetype), + + TP_ARGS(page, + alloc_order, fallback_order, + alloc_migratetype, fallback_migratetype, new_migratetype), + + TP_FIELDS( + ctf_integer_hex(struct page *, page, page) + ctf_integer(unsigned long, pfn, page_to_pfn(page)) + ctf_integer(int, alloc_order, alloc_order) + ctf_integer(int, fallback_order, fallback_order) + ctf_integer(int, alloc_migratetype, alloc_migratetype) + ctf_integer(int, fallback_migratetype, fallback_migratetype) + ctf_integer(int, change_ownership, (new_migratetype == alloc_migratetype)) + ) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) + +LTTNG_TRACEPOINT_EVENT_MAP(mm_page_alloc_extfrag, + + kmem_mm_page_alloc_extfrag, + + TP_PROTO(struct page *page, + int alloc_order, int fallback_order, + int alloc_migratetype, int fallback_migratetype, + int change_ownership), + + TP_ARGS(page, + alloc_order, fallback_order, + alloc_migratetype, fallback_migratetype, + change_ownership), + + TP_FIELDS( + ctf_integer_hex(struct page *, page, page) + ctf_integer(unsigned long, pfn, page_to_pfn(page)) + ctf_integer(int, alloc_order, alloc_order) + ctf_integer(int, fallback_order, fallback_order) + ctf_integer(int, alloc_migratetype, alloc_migratetype) + ctf_integer(int, fallback_migratetype, fallback_migratetype) + ctf_integer(int, change_ownership, change_ownership) + ) +) + +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ + +LTTNG_TRACEPOINT_EVENT_MAP(mm_page_alloc_extfrag, + + kmem_mm_page_alloc_extfrag, + + TP_PROTO(struct page *page, + int alloc_order, int fallback_order, + int alloc_migratetype, int fallback_migratetype), + + TP_ARGS(page, + alloc_order, fallback_order, + alloc_migratetype, fallback_migratetype), + + TP_FIELDS( + ctf_integer_hex(struct page *, page, page) + ctf_integer(unsigned long, pfn, page_to_pfn(page)) + ctf_integer(int, alloc_order, alloc_order) + ctf_integer(int, fallback_order, fallback_order) + ctf_integer(int, alloc_migratetype, alloc_migratetype) + ctf_integer(int, fallback_migratetype, fallback_migratetype) + ) +) + +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ + +#endif /* LTTNG_TRACE_KMEM_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/kvm.h b/include/instrumentation/events/kvm.h new file mode 100644 index 00000000..b05482ee --- /dev/null +++ b/include/instrumentation/events/kvm.h @@ -0,0 +1,274 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#if !defined(LTTNG_TRACE_KVM_MAIN_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_KVM_MAIN_H + +#include +#include + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM kvm + +LTTNG_TRACEPOINT_EVENT(kvm_userspace_exit, + TP_PROTO(__u32 reason, int errno), + TP_ARGS(reason, errno), + + TP_FIELDS( + ctf_integer(__u32, reason, reason) + ctf_integer(int, errno, errno) + ) +) + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)) +#if defined(__KVM_HAVE_IOAPIC) +#undef __KVM_HAVE_IRQ_LINE +#define __KVM_HAVE_IRQ_LINE +#endif +#endif + +#if defined(__KVM_HAVE_IRQ_LINE) +LTTNG_TRACEPOINT_EVENT(kvm_set_irq, + TP_PROTO(unsigned int gsi, int level, int irq_source_id), + TP_ARGS(gsi, level, irq_source_id), + + TP_FIELDS( + ctf_integer(unsigned int, gsi, gsi) + ctf_integer(int, level, level) + ctf_integer(int, irq_source_id, irq_source_id) + ) +) +#endif + +#if defined(__KVM_HAVE_IOAPIC) + +LTTNG_TRACEPOINT_EVENT(kvm_ioapic_set_irq, + TP_PROTO(__u64 e, int pin, bool coalesced), + TP_ARGS(e, pin, coalesced), + + TP_FIELDS( + ctf_integer(__u64, e, e) + ctf_integer(int, pin, pin) + ctf_integer(bool, coalesced, coalesced) + ) +) + +LTTNG_TRACEPOINT_EVENT(kvm_msi_set_irq, + TP_PROTO(__u64 address, __u64 data), + TP_ARGS(address, data), + + TP_FIELDS( + ctf_integer_hex(__u64, address, address) + ctf_integer(__u64, data, data) + ) +) + +LTTNG_TRACEPOINT_EVENT(kvm_ack_irq, + TP_PROTO(unsigned int irqchip, unsigned int pin), + TP_ARGS(irqchip, pin), + + TP_FIELDS( + ctf_integer(unsigned int, irqchip, irqchip) + ctf_integer(unsigned int, pin, pin) + ) +) + +#endif /* defined(__KVM_HAVE_IOAPIC) */ + +#define KVM_TRACE_MMIO_READ_UNSATISFIED 0 +#define KVM_TRACE_MMIO_READ 1 +#define KVM_TRACE_MMIO_WRITE 2 + +#define kvm_trace_symbol_mmio \ + { KVM_TRACE_MMIO_READ_UNSATISFIED, "unsatisfied-read" }, \ + { KVM_TRACE_MMIO_READ, "read" }, \ + { KVM_TRACE_MMIO_WRITE, "write" } + + +#if (LTTNG_SLE_KERNEL_RANGE(4,4,121,92,92,0, 4,4,122,0,0,0) \ + || LTTNG_SLE_KERNEL_RANGE(4,4,131,94,0,0, 4,5,0,0,0,0)) + +LTTNG_TRACEPOINT_EVENT(kvm_mmio, + TP_PROTO(int type, int len, u64 gpa, u64 val), + TP_ARGS(type, len, gpa, val), + + TP_FIELDS( + ctf_integer(u32, type, type) + ctf_integer(u32, len, len) + ctf_integer(u64, gpa, gpa) + ctf_integer(u64, val, val) + ) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0) \ + || LTTNG_KERNEL_RANGE(4,14,14, 4,15,0) \ + || LTTNG_DEBIAN_KERNEL_RANGE(4,14,13,0,1,0, 4,15,0,0,0,0) \ + || LTTNG_KERNEL_RANGE(4,9,77, 4,10,0) \ + || LTTNG_KERNEL_RANGE(4,4,112, 4,5,0) \ + || LTTNG_KERNEL_RANGE(4,1,50, 4,2,0) \ + || LTTNG_KERNEL_RANGE(3,16,52, 3,17,0) \ + || LTTNG_UBUNTU_KERNEL_RANGE(3,13,11,144, 3,14,0,0) \ + || LTTNG_KERNEL_RANGE(3,2,97, 3,3,0) \ + || LTTNG_UBUNTU_KERNEL_RANGE(4,13,16,38, 4,14,0,0) \ + || LTTNG_DEBIAN_KERNEL_RANGE(4,9,65,0,3,0, 4,10,0,0,0,0) \ + || LTTNG_FEDORA_KERNEL_RANGE(4,14,13,300, 4,15,0,0)) + +LTTNG_TRACEPOINT_EVENT(kvm_mmio, + TP_PROTO(int type, int len, u64 gpa, void *val), + TP_ARGS(type, len, gpa, val), + + TP_FIELDS( + ctf_integer(u32, type, type) + ctf_integer(u32, len, len) + ctf_integer(u64, gpa, gpa) + ctf_sequence_hex(unsigned char, val, val, u32, len) + ) +) + +#else + +LTTNG_TRACEPOINT_EVENT(kvm_mmio, + TP_PROTO(int type, int len, u64 gpa, u64 val), + TP_ARGS(type, len, gpa, val), + + TP_FIELDS( + ctf_integer(u32, type, type) + ctf_integer(u32, len, len) + ctf_integer(u64, gpa, gpa) + ctf_integer(u64, val, val) + ) +) + +#endif + +#define kvm_fpu_load_symbol \ + {0, "unload"}, \ + {1, "load"} + +LTTNG_TRACEPOINT_EVENT(kvm_fpu, + TP_PROTO(int load), + TP_ARGS(load), + + TP_FIELDS( + ctf_integer(u32, load, load) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0) \ + || LTTNG_RHEL_KERNEL_RANGE(3,10,0,327,0,0, 3,11,0,0,0,0)) + +LTTNG_TRACEPOINT_EVENT(kvm_age_page, + TP_PROTO(ulong gfn, int level, struct kvm_memory_slot *slot, int ref), + TP_ARGS(gfn, level, slot, ref), + + TP_FIELDS( + ctf_integer(u64, hva, + ((gfn - slot->base_gfn) << PAGE_SHIFT) + slot->userspace_addr) + ctf_integer(u64, gfn, gfn) + ctf_integer(u8, level, level) + ctf_integer(u8, referenced, ref) + ) +) + +#else + +LTTNG_TRACEPOINT_EVENT(kvm_age_page, + TP_PROTO(ulong hva, struct kvm_memory_slot *slot, int ref), + TP_ARGS(hva, slot, ref), + + TP_FIELDS( + ctf_integer(u64, hva, hva) + ctf_integer(u64, gfn, + slot->base_gfn + ((hva - slot->userspace_addr) >> PAGE_SHIFT)) + ctf_integer(u8, referenced, ref) + ) +) +#endif + +#ifdef CONFIG_KVM_ASYNC_PF +LTTNG_TRACEPOINT_EVENT_CLASS(kvm_async_get_page_class, + + TP_PROTO(u64 gva, u64 gfn), + + TP_ARGS(gva, gfn), + + TP_FIELDS( + ctf_integer(__u64, gva, gva) + ctf_integer(u64, gfn, gfn) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_async_get_page_class, kvm_try_async_get_page, + + TP_PROTO(u64 gva, u64 gfn), + + TP_ARGS(gva, gfn) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_async_get_page_class, kvm_async_pf_doublefault, + + TP_PROTO(u64 gva, u64 gfn), + + TP_ARGS(gva, gfn) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(kvm_async_pf_nopresent_ready, + + TP_PROTO(u64 token, u64 gva), + + TP_ARGS(token, gva), + + TP_FIELDS( + ctf_integer(__u64, token, token) + ctf_integer(__u64, gva, gva) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_async_pf_nopresent_ready, kvm_async_pf_not_present, + + TP_PROTO(u64 token, u64 gva), + + TP_ARGS(token, gva) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_async_pf_nopresent_ready, kvm_async_pf_ready, + + TP_PROTO(u64 token, u64 gva), + + TP_ARGS(token, gva) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) \ + || LTTNG_RHEL_KERNEL_RANGE(3,10,0,229,0,0, 3,11,0,0,0,0)) + +LTTNG_TRACEPOINT_EVENT( + kvm_async_pf_completed, + TP_PROTO(unsigned long address, u64 gva), + TP_ARGS(address, gva), + + TP_FIELDS( + ctf_integer_hex(unsigned long, address, address) + ctf_integer(u64, gva, gva) + ) +) + +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) */ + +LTTNG_TRACEPOINT_EVENT( + kvm_async_pf_completed, + TP_PROTO(unsigned long address, struct page *page, u64 gva), + TP_ARGS(address, page, gva), + + TP_FIELDS( + ctf_integer_hex(unsigned long, address, address) + ctf_integer(pfn_t, pfn, page ? page_to_pfn(page) : 0) + ctf_integer(u64, gva, gva) + ) +) + +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) */ + +#endif + +#endif /* LTTNG_TRACE_KVM_MAIN_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/lock.h b/include/instrumentation/events/lock.h new file mode 100644 index 00000000..af28517e --- /dev/null +++ b/include/instrumentation/events/lock.h @@ -0,0 +1,71 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM lock + +#if !defined(LTTNG_TRACE_LOCK_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_LOCK_H + +#include +#include + +#ifdef CONFIG_LOCKDEP + +LTTNG_TRACEPOINT_EVENT(lock_acquire, + + TP_PROTO(struct lockdep_map *lock, unsigned int subclass, + int trylock, int read, int check, + struct lockdep_map *next_lock, unsigned long ip), + + TP_ARGS(lock, subclass, trylock, read, check, next_lock, ip), + + TP_FIELDS( + ctf_integer(unsigned int, flags, (trylock ? 1 : 0) | (read ? 2 : 0)) + ctf_string(name, lock->name) + ctf_integer_hex(void *, lockdep_addr, lock) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(lock, + + TP_PROTO(struct lockdep_map *lock, unsigned long ip), + + TP_ARGS(lock, ip), + + TP_FIELDS( + ctf_string(name, lock->name) + ctf_integer_hex(void *, lockdep_addr, lock) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(lock, lock_release, + + TP_PROTO(struct lockdep_map *lock, unsigned long ip), + + TP_ARGS(lock, ip) +) + +#ifdef CONFIG_LOCK_STAT + +LTTNG_TRACEPOINT_EVENT_INSTANCE(lock, lock_contended, + + TP_PROTO(struct lockdep_map *lock, unsigned long ip), + + TP_ARGS(lock, ip) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(lock, lock_acquired, + + TP_PROTO(struct lockdep_map *lock, unsigned long ip), + + TP_ARGS(lock, ip) +) + +#endif /* CONFIG_LOCK_STAT */ + +#endif /* CONFIG_LOCKDEP */ + +#endif /* LTTNG_TRACE_LOCK_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/lttng-module/9p.h b/include/instrumentation/events/lttng-module/9p.h deleted file mode 100644 index 0123bbfc..00000000 --- a/include/instrumentation/events/lttng-module/9p.h +++ /dev/null @@ -1,57 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM 9p - -#if !defined(LTTNG_TRACE_9P_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_9P_H - -#include -#include - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) -LTTNG_TRACEPOINT_EVENT(9p_client_req, - - TP_PROTO(struct p9_client *clnt, int8_t type, int tag), - - TP_ARGS(clnt, type, tag), - - TP_FIELDS( - ctf_integer_hex(void *, clnt, clnt) - ctf_integer(u8, type, type) - ctf_integer(u32, tag, tag) - ) -) - -LTTNG_TRACEPOINT_EVENT(9p_client_res, - - TP_PROTO(struct p9_client *clnt, int8_t type, int tag, int err), - - TP_ARGS(clnt, type, tag, err), - - TP_FIELDS( - ctf_integer_hex(void *, clnt, clnt) - ctf_integer(u8, type, type) - ctf_integer(u32, tag, tag) - ctf_integer(u32, err, err) - ) -) - -LTTNG_TRACEPOINT_EVENT(9p_protocol_dump, - - TP_PROTO(struct p9_client *clnt, struct p9_fcall *pdu), - - TP_ARGS(clnt, pdu), - - TP_FIELDS( - ctf_integer_hex(void *, clnt, clnt) - ctf_integer(u8, type, pdu->id) - ctf_integer(u16, tag, pdu->tag) - ctf_array(unsigned char, line, pdu->sdata, P9_PROTO_DUMP_SZ) - ) -) -#endif - -#endif /* LTTNG_TRACE_9P_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/arch/x86/exceptions.h b/include/instrumentation/events/lttng-module/arch/x86/exceptions.h deleted file mode 100644 index eb55138a..00000000 --- a/include/instrumentation/events/lttng-module/arch/x86/exceptions.h +++ /dev/null @@ -1,53 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#if !defined(LTTNG_TRACE_EXCEPTIONS_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_EXCEPTIONS_H - -#include -#include - -#undef TRACE_SYSTEM -#define TRACE_SYSTEM x86_exceptions - -LTTNG_TRACEPOINT_EVENT_CLASS(x86_exceptions_class, - - TP_PROTO(unsigned long address, struct pt_regs *regs, - unsigned long error_code), - - TP_ARGS(address, regs, error_code), - - TP_FIELDS( - ctf_integer_hex(unsigned long, address, address) - ctf_integer_hex(unsigned long, ip, regs->ip) - /* - * Note: we cast error_code from unsigned long - * to unsigned char to save space in the trace. - * Currently, only 5 low bits are used. Should be made - * larger if error codes are added to the kernel. - */ - ctf_integer_hex(unsigned char, error_code, error_code) - ) -) - -#define LTTNG_EXCEPTIONS_TRACEPOINT_EVENT_INSTANCE_MAP(name, map) \ -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(x86_exceptions_class, \ - name, \ - map, \ - TP_PROTO(unsigned long address, struct pt_regs *regs, \ - unsigned long error_code), \ - TP_ARGS(address, regs, error_code) \ -) - -LTTNG_EXCEPTIONS_TRACEPOINT_EVENT_INSTANCE_MAP(page_fault_user, - x86_exceptions_page_fault_user) -LTTNG_EXCEPTIONS_TRACEPOINT_EVENT_INSTANCE_MAP(page_fault_kernel, - x86_exceptions_page_fault_kernel) - -#endif /* LTTNG_TRACE_EXCEPTIONS_H */ - -#undef TRACE_INCLUDE_PATH -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module/arch/x86 -#undef TRACE_INCLUDE_FILE -#define TRACE_INCLUDE_FILE exceptions - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/arch/x86/irq_vectors.h b/include/instrumentation/events/lttng-module/arch/x86/irq_vectors.h deleted file mode 100644 index ff0f45b8..00000000 --- a/include/instrumentation/events/lttng-module/arch/x86/irq_vectors.h +++ /dev/null @@ -1,116 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#if !defined(LTTNG_TRACE_IRQ_VECTORS_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_IRQ_VECTORS_H - -#include -#include - -#undef TRACE_SYSTEM -#define TRACE_SYSTEM x86_irq_vectors - -LTTNG_TRACEPOINT_EVENT_CLASS(x86_irq_vectors_vector_class, - TP_PROTO(int vector), - TP_ARGS(vector), - - TP_FIELDS( - ctf_integer(int, vector, vector) - ) -) - -#define LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(name, map) \ -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(x86_irq_vectors_vector_class, \ - name##_entry, \ - map##_entry, \ - TP_PROTO(int vector), \ - TP_ARGS(vector) \ -) \ -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(x86_irq_vectors_vector_class, \ - name##_exit, \ - map##_exit, \ - TP_PROTO(int vector), \ - TP_ARGS(vector) \ -) - -/* - * local_timer - called when entering/exiting a local timer interrupt - * vector handler - */ -LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(local_timer, - x86_irq_vectors_local_timer) - -/* - * reschedule - called when entering/exiting a reschedule vector handler - */ -LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(reschedule, - x86_irq_vectors_reschedule) - -/* - * spurious_apic - called when entering/exiting a spurious apic vector handler - */ -LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(spurious_apic, - x86_irq_vectors_spurious_apic) - -/* - * error_apic - called when entering/exiting an error apic vector handler - */ -LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(error_apic, - x86_irq_vectors_error_apic) - -/* - * x86_platform_ipi - called when entering/exiting a x86 platform ipi interrupt - * vector handler - */ -LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(x86_platform_ipi, - x86_irq_vectors_ipi) - -/* - * irq_work - called when entering/exiting a irq work interrupt - * vector handler - */ -LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(irq_work, - x86_irq_vectors_irq_work) - -/* - * call_function - called when entering/exiting a call function interrupt - * vector handler - */ -LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(call_function, - x86_irq_vectors_call_function) - -/* - * call_function_single - called when entering/exiting a call function - * single interrupt vector handler - */ -LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(call_function_single, - x86_irq_vectors_call_function_single) - -/* - * threshold_apic - called when entering/exiting a threshold apic interrupt - * vector handler - */ -LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(threshold_apic, - x86_irq_vectors_threshold_apic) - -/* - * deferred_error_apic - called when entering/exiting a deferred apic interrupt - * vector handler - */ -LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(deferred_error_apic, - x86_irq_vectors_deferred_error_apic) - -/* - * thermal_apic - called when entering/exiting a thermal apic interrupt - * vector handler - */ -LTTNG_IRQ_VECTOR_TRACEPOINT_EVENT_INSTANCE_MAP(thermal_apic, - x86_irq_vectors_thermal_apic) - -#endif /* LTTNG_TRACE_IRQ_VECTORS_H */ - -#undef TRACE_INCLUDE_PATH -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module/arch/x86 -#undef TRACE_INCLUDE_FILE -#define TRACE_INCLUDE_FILE irq_vectors - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/arch/x86/kvm/mmutrace.h b/include/instrumentation/events/lttng-module/arch/x86/kvm/mmutrace.h deleted file mode 100644 index 1195ded7..00000000 --- a/include/instrumentation/events/lttng-module/arch/x86/kvm/mmutrace.h +++ /dev/null @@ -1,274 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#if !defined(LTTNG_TRACE_KVM_MMU_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_KVM_MMU_H - -#include -#include - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) -#include -#else /* if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ -#include -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ - -#undef TRACE_SYSTEM -#define TRACE_SYSTEM kvm_mmu - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0) || \ - LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0)) - -#define LTTNG_KVM_MMU_PAGE_FIELDS \ - ctf_integer(__u64, gfn, (sp)->gfn) \ - ctf_integer(__u32, role, (sp)->role.word) \ - ctf_integer(__u32, root_count, (sp)->root_count) \ - ctf_integer(bool, unsync, (sp)->unsync) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) - -#define LTTNG_KVM_MMU_PAGE_FIELDS \ - ctf_integer(unsigned long, mmu_valid_gen, (sp)->mmu_valid_gen) \ - ctf_integer(__u64, gfn, (sp)->gfn) \ - ctf_integer(__u32, role, (sp)->role.word) \ - ctf_integer(__u32, root_count, (sp)->root_count) \ - ctf_integer(bool, unsync, (sp)->unsync) - -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) */ - -#define LTTNG_KVM_MMU_PAGE_FIELDS \ - ctf_integer(__u64, gfn, (sp)->gfn) \ - ctf_integer(__u32, role, (sp)->role.word) \ - ctf_integer(__u32, root_count, (sp)->root_count) \ - ctf_integer(bool, unsync, (sp)->unsync) - -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) */ - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) -/* - * A pagetable walk has started - */ -LTTNG_TRACEPOINT_EVENT( - kvm_mmu_pagetable_walk, - TP_PROTO(u64 addr, u32 pferr), - TP_ARGS(addr, pferr), - - TP_FIELDS( - ctf_integer_hex(__u64, addr, addr) - ctf_integer(__u32, pferr, pferr) - ) -) -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) */ -/* - * A pagetable walk has started - */ -LTTNG_TRACEPOINT_EVENT( - kvm_mmu_pagetable_walk, - TP_PROTO(u64 addr, int write_fault, int user_fault, int fetch_fault), - TP_ARGS(addr, write_fault, user_fault, fetch_fault), - - TP_FIELDS( - ctf_integer_hex(__u64, addr, addr) - ctf_integer(__u32, pferr, - (!!write_fault << 1) | (!!user_fault << 2) - | (!!fetch_fault << 4)) - ) -) -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) */ - -/* We just walked a paging element */ -LTTNG_TRACEPOINT_EVENT( - kvm_mmu_paging_element, - TP_PROTO(u64 pte, int level), - TP_ARGS(pte, level), - - TP_FIELDS( - ctf_integer(__u64, pte, pte) - ctf_integer(__u32, level, level) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(kvm_mmu_set_bit_class, - - TP_PROTO(unsigned long table_gfn, unsigned index, unsigned size), - - TP_ARGS(table_gfn, index, size), - - TP_FIELDS( - ctf_integer(__u64, gpa, - ((u64)table_gfn << PAGE_SHIFT) + index * size) - ) -) - -/* We set a pte accessed bit */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_mmu_set_bit_class, kvm_mmu_set_accessed_bit, - - TP_PROTO(unsigned long table_gfn, unsigned index, unsigned size), - - TP_ARGS(table_gfn, index, size) -) - -/* We set a pte dirty bit */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_mmu_set_bit_class, kvm_mmu_set_dirty_bit, - - TP_PROTO(unsigned long table_gfn, unsigned index, unsigned size), - - TP_ARGS(table_gfn, index, size) -) - -LTTNG_TRACEPOINT_EVENT( - kvm_mmu_walker_error, - TP_PROTO(u32 pferr), - TP_ARGS(pferr), - - TP_FIELDS( - ctf_integer(__u32, pferr, pferr) - ) -) - -LTTNG_TRACEPOINT_EVENT( - kvm_mmu_get_page, - TP_PROTO(struct kvm_mmu_page *sp, bool created), - TP_ARGS(sp, created), - - TP_FIELDS( - LTTNG_KVM_MMU_PAGE_FIELDS - ctf_integer(bool, created, created) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(kvm_mmu_page_class, - - TP_PROTO(struct kvm_mmu_page *sp), - TP_ARGS(sp), - - TP_FIELDS( - LTTNG_KVM_MMU_PAGE_FIELDS - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_mmu_page_class, kvm_mmu_sync_page, - TP_PROTO(struct kvm_mmu_page *sp), - - TP_ARGS(sp) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_mmu_page_class, kvm_mmu_unsync_page, - TP_PROTO(struct kvm_mmu_page *sp), - - TP_ARGS(sp) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_mmu_page_class, kvm_mmu_prepare_zap_page, - TP_PROTO(struct kvm_mmu_page *sp), - - TP_ARGS(sp) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) - -LTTNG_TRACEPOINT_EVENT_MAP( - mark_mmio_spte, - - kvm_mmu_mark_mmio_spte, - - TP_PROTO(u64 *sptep, gfn_t gfn, unsigned access, unsigned int gen), - TP_ARGS(sptep, gfn, access, gen), - - TP_FIELDS( - ctf_integer_hex(void *, sptep, sptep) - ctf_integer(gfn_t, gfn, gfn) - ctf_integer(unsigned, access, access) - ctf_integer(unsigned int, gen, gen) - ) -) - -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) */ - -LTTNG_TRACEPOINT_EVENT_MAP( - mark_mmio_spte, - - kvm_mmu_mark_mmio_spte, - - TP_PROTO(u64 *sptep, gfn_t gfn, unsigned access), - TP_ARGS(sptep, gfn, access), - - TP_FIELDS( - ctf_integer_hex(void *, sptep, sptep) - ctf_integer(gfn_t, gfn, gfn) - ctf_integer(unsigned, access, access) - ) -) - -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) */ - -LTTNG_TRACEPOINT_EVENT_MAP( - handle_mmio_page_fault, - - kvm_mmu_handle_mmio_page_fault, - - TP_PROTO(u64 addr, gfn_t gfn, unsigned access), - TP_ARGS(addr, gfn, access), - - TP_FIELDS( - ctf_integer_hex(u64, addr, addr) - ctf_integer(gfn_t, gfn, gfn) - ctf_integer(unsigned, access, access) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) || \ - LTTNG_KERNEL_RANGE(4,19,103, 4,20,0) || \ - LTTNG_KERNEL_RANGE(5,4,19, 5,5,0) || \ - LTTNG_KERNEL_RANGE(5,5,3, 5,6,0) || \ - LTTNG_UBUNTU_KERNEL_RANGE(4,15,18,92, 4,16,0,0) || \ - LTTNG_UBUNTU_KERNEL_RANGE(5,3,18,43, 5,3,18,45) || \ - LTTNG_UBUNTU_KERNEL_RANGE(5,3,18,46, 5,4,0,0)) -LTTNG_TRACEPOINT_EVENT_MAP( - fast_page_fault, - - kvm_mmu_fast_page_fault, - - TP_PROTO(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, u32 error_code, - u64 *sptep, u64 old_spte, bool retry), - TP_ARGS(vcpu, cr2_or_gpa, error_code, sptep, old_spte, retry), - - TP_FIELDS( - ctf_integer(int, vcpu_id, vcpu->vcpu_id) - ctf_integer(gpa_t, cr2_or_gpa, cr2_or_gpa) - ctf_integer(u32, error_code, error_code) - ctf_integer_hex(u64 *, sptep, sptep) - ctf_integer(u64, old_spte, old_spte) - ctf_integer(u64, new_spte, *sptep) - ctf_integer(bool, retry, retry) - ) -) -#else -LTTNG_TRACEPOINT_EVENT_MAP( - fast_page_fault, - - kvm_mmu_fast_page_fault, - - TP_PROTO(struct kvm_vcpu *vcpu, gva_t gva, u32 error_code, - u64 *sptep, u64 old_spte, bool retry), - TP_ARGS(vcpu, gva, error_code, sptep, old_spte, retry), - - TP_FIELDS( - ctf_integer(int, vcpu_id, vcpu->vcpu_id) - ctf_integer(gva_t, gva, gva) - ctf_integer(u32, error_code, error_code) - ctf_integer_hex(u64 *, sptep, sptep) - ctf_integer(u64, old_spte, old_spte) - ctf_integer(u64, new_spte, *sptep) - ctf_integer(bool, retry, retry) - ) -) -#endif - -#endif /* LTTNG_TRACE_KVM_MMU_H */ - -#undef TRACE_INCLUDE_PATH -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module/arch/x86/kvm -#undef TRACE_INCLUDE_FILE -#define TRACE_INCLUDE_FILE mmutrace - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/arch/x86/kvm/trace.h b/include/instrumentation/events/lttng-module/arch/x86/kvm/trace.h deleted file mode 100644 index 1b3b9ebc..00000000 --- a/include/instrumentation/events/lttng-module/arch/x86/kvm/trace.h +++ /dev/null @@ -1,540 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#if !defined(LTTNG_TRACE_KVM_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_KVM_H - -#include -#include -#include -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) -#include -#endif -#include -#include <../arch/x86/kvm/lapic.h> -#include <../arch/x86/kvm/kvm_cache_regs.h> - -#undef TRACE_SYSTEM -#define TRACE_SYSTEM kvm_x86 - -/* - * Tracepoint for guest mode entry. - */ -LTTNG_TRACEPOINT_EVENT_MAP(kvm_entry, kvm_x86_entry, - TP_PROTO(unsigned int vcpu_id), - TP_ARGS(vcpu_id), - - TP_FIELDS( - ctf_integer(unsigned int, vcpu_id, vcpu_id) - ) -) - -/* - * Tracepoint for hypercall. - */ -LTTNG_TRACEPOINT_EVENT_MAP(kvm_hypercall, kvm_x86_hypercall, - TP_PROTO(unsigned long nr, unsigned long a0, unsigned long a1, - unsigned long a2, unsigned long a3), - TP_ARGS(nr, a0, a1, a2, a3), - - TP_FIELDS( - ctf_integer(unsigned long, nr, nr) - ctf_integer(unsigned long, a0, a0) - ctf_integer(unsigned long, a1, a1) - ctf_integer(unsigned long, a2, a2) - ctf_integer(unsigned long, a3, a3) - ) -) - -/* - * Tracepoint for hypercall. - */ -LTTNG_TRACEPOINT_EVENT_MAP(kvm_hv_hypercall, kvm_x86_hv_hypercall, - TP_PROTO(__u16 code, bool fast, __u16 rep_cnt, __u16 rep_idx, - __u64 ingpa, __u64 outgpa), - TP_ARGS(code, fast, rep_cnt, rep_idx, ingpa, outgpa), - - TP_FIELDS( - ctf_integer(__u16, rep_cnt, rep_cnt) - ctf_integer(__u16, rep_idx, rep_idx) - ctf_integer(__u64, ingpa, ingpa) - ctf_integer(__u64, outgpa, outgpa) - ctf_integer(__u16, code, code) - ctf_integer(bool, fast, fast) - ) -) - -/* - * Tracepoint for PIO. - */ -LTTNG_TRACEPOINT_EVENT_MAP(kvm_pio, kvm_x86_pio, - TP_PROTO(unsigned int rw, unsigned int port, unsigned int size, - unsigned int count), - TP_ARGS(rw, port, size, count), - - TP_FIELDS( - ctf_integer(unsigned int, rw, rw) - ctf_integer(unsigned int, port, port) - ctf_integer(unsigned int, size, size) - ctf_integer(unsigned int, count, count) - ) -) - -/* - * Tracepoint for cpuid. - */ -LTTNG_TRACEPOINT_EVENT_MAP(kvm_cpuid, kvm_x86_cpuid, - TP_PROTO(unsigned int function, unsigned long rax, unsigned long rbx, - unsigned long rcx, unsigned long rdx), - TP_ARGS(function, rax, rbx, rcx, rdx), - - TP_FIELDS( - ctf_integer(unsigned int, function, function) - ctf_integer(unsigned long, rax, rax) - ctf_integer(unsigned long, rbx, rbx) - ctf_integer(unsigned long, rcx, rcx) - ctf_integer(unsigned long, rdx, rdx) - ) -) - -/* - * Tracepoint for apic access. - */ -LTTNG_TRACEPOINT_EVENT_MAP(kvm_apic, kvm_x86_apic, - TP_PROTO(unsigned int rw, unsigned int reg, unsigned int val), - TP_ARGS(rw, reg, val), - - TP_FIELDS( - ctf_integer(unsigned int, rw, rw) - ctf_integer(unsigned int, reg, reg) - ctf_integer(unsigned int, val, val) - ) -) - -#define trace_kvm_apic_read(reg, val) trace_kvm_apic(0, reg, val) -#define trace_kvm_apic_write(reg, val) trace_kvm_apic(1, reg, val) - -/* - * Tracepoint for kvm guest exit: - */ -LTTNG_TRACEPOINT_EVENT_CODE_MAP(kvm_exit, kvm_x86_exit, - TP_PROTO(unsigned int exit_reason, struct kvm_vcpu *vcpu, u32 isa), - TP_ARGS(exit_reason, vcpu, isa), - - TP_locvar( - u64 info1, info2; - ), - - TP_code_pre( -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) - kvm_x86_ops.get_exit_info(vcpu, &tp_locvar->info1, - &tp_locvar->info2); -#else - kvm_x86_ops->get_exit_info(vcpu, &tp_locvar->info1, - &tp_locvar->info2); -#endif - ), - - TP_FIELDS( - ctf_integer(unsigned int, exit_reason, exit_reason) - ctf_integer(unsigned long, guest_rip, kvm_rip_read(vcpu)) - ctf_integer(u32, isa, isa) - ctf_integer(u64, info1, tp_locvar->info1) - ctf_integer(u64, info2, tp_locvar->info2) - ), - - TP_code_post() -) - -/* - * Tracepoint for kvm interrupt injection: - */ -LTTNG_TRACEPOINT_EVENT_MAP(kvm_inj_virq, kvm_x86_inj_virq, - TP_PROTO(unsigned int irq), - TP_ARGS(irq), - - TP_FIELDS( - ctf_integer(unsigned int, irq, irq) - ) -) - -/* - * Tracepoint for kvm interrupt injection: - */ -LTTNG_TRACEPOINT_EVENT_MAP(kvm_inj_exception, kvm_x86_inj_exception, - TP_PROTO(unsigned exception, bool has_error, unsigned error_code), - TP_ARGS(exception, has_error, error_code), - - TP_FIELDS( - ctf_integer(u8, exception, exception) - ctf_integer(u8, has_error, has_error) - ctf_integer(u32, error_code, error_code) - ) -) - -/* - * Tracepoint for page fault. - */ -LTTNG_TRACEPOINT_EVENT_MAP(kvm_page_fault, kvm_x86_page_fault, - TP_PROTO(unsigned long fault_address, unsigned int error_code), - TP_ARGS(fault_address, error_code), - - TP_FIELDS( - ctf_integer_hex(unsigned long, fault_address, fault_address) - ctf_integer(unsigned int, error_code, error_code) - ) -) - -/* - * Tracepoint for guest MSR access. - */ -LTTNG_TRACEPOINT_EVENT_MAP(kvm_msr, kvm_x86_msr, - TP_PROTO(unsigned write, u32 ecx, u64 data, bool exception), - TP_ARGS(write, ecx, data, exception), - - TP_FIELDS( - ctf_integer(unsigned, write, write) - ctf_integer(u32, ecx, ecx) - ctf_integer(u64, data, data) - ctf_integer(u8, exception, exception) - ) -) - -#define trace_kvm_msr_read(ecx, data) trace_kvm_msr(0, ecx, data, false) -#define trace_kvm_msr_write(ecx, data) trace_kvm_msr(1, ecx, data, false) -#define trace_kvm_msr_read_ex(ecx) trace_kvm_msr(0, ecx, 0, true) -#define trace_kvm_msr_write_ex(ecx, data) trace_kvm_msr(1, ecx, data, true) - -/* - * Tracepoint for guest CR access. - */ -LTTNG_TRACEPOINT_EVENT_MAP(kvm_cr, kvm_x86_cr, - TP_PROTO(unsigned int rw, unsigned int cr, unsigned long val), - TP_ARGS(rw, cr, val), - - TP_FIELDS( - ctf_integer(unsigned int, rw, rw) - ctf_integer(unsigned int, cr, cr) - ctf_integer(unsigned long, val, val) - ) -) - -#define trace_kvm_cr_read(cr, val) trace_kvm_cr(0, cr, val) -#define trace_kvm_cr_write(cr, val) trace_kvm_cr(1, cr, val) - -LTTNG_TRACEPOINT_EVENT_MAP(kvm_pic_set_irq, kvm_x86_pic_set_irq, - TP_PROTO(__u8 chip, __u8 pin, __u8 elcr, __u8 imr, bool coalesced), - TP_ARGS(chip, pin, elcr, imr, coalesced), - - TP_FIELDS( - ctf_integer(__u8, chip, chip) - ctf_integer(__u8, pin, pin) - ctf_integer(__u8, elcr, elcr) - ctf_integer(__u8, imr, imr) - ctf_integer(bool, coalesced, coalesced) - ) -) - -LTTNG_TRACEPOINT_EVENT_MAP(kvm_apic_ipi, kvm_x86_apic_ipi, - TP_PROTO(__u32 icr_low, __u32 dest_id), - TP_ARGS(icr_low, dest_id), - - TP_FIELDS( - ctf_integer(__u32, icr_low, icr_low) - ctf_integer(__u32, dest_id, dest_id) - ) -) - -LTTNG_TRACEPOINT_EVENT_MAP(kvm_apic_accept_irq, kvm_x86_apic_accept_irq, - TP_PROTO(__u32 apicid, __u16 dm, __u8 tm, __u8 vec, bool coalesced), - TP_ARGS(apicid, dm, tm, vec, coalesced), - - TP_FIELDS( - ctf_integer(__u32, apicid, apicid) - ctf_integer(__u16, dm, dm) - ctf_integer(__u8, tm, tm) - ctf_integer(__u8, vec, vec) - ctf_integer(bool, coalesced, coalesced) - ) -) - -LTTNG_TRACEPOINT_EVENT_MAP(kvm_eoi, kvm_x86_eoi, - TP_PROTO(struct kvm_lapic *apic, int vector), - TP_ARGS(apic, vector), - - TP_FIELDS( - ctf_integer(__u32, apicid, apic->vcpu->vcpu_id) - ctf_integer(int, vector, vector) - ) -) - -LTTNG_TRACEPOINT_EVENT_MAP(kvm_pv_eoi, kvm_x86_pv_eoi, - TP_PROTO(struct kvm_lapic *apic, int vector), - TP_ARGS(apic, vector), - - TP_FIELDS( - ctf_integer(__u32, apicid, apic->vcpu->vcpu_id) - ctf_integer(int, vector, vector) - ) -) - -/* - * Tracepoint for nested VMRUN - */ -LTTNG_TRACEPOINT_EVENT_MAP(kvm_nested_vmrun, kvm_x86_nested_vmrun, - TP_PROTO(__u64 rip, __u64 vmcb, __u64 nested_rip, __u32 int_ctl, - __u32 event_inj, bool npt), - TP_ARGS(rip, vmcb, nested_rip, int_ctl, event_inj, npt), - - TP_FIELDS( - ctf_integer(__u64, rip, rip) - ctf_integer(__u64, vmcb, vmcb) - ctf_integer(__u64, nested_rip, nested_rip) - ctf_integer(__u32, int_ctl, int_ctl) - ctf_integer(__u32, event_inj, event_inj) - ctf_integer(bool, npt, npt) - ) -) - -LTTNG_TRACEPOINT_EVENT_MAP(kvm_nested_intercepts, kvm_x86_nested_intercepts, - TP_PROTO(__u16 cr_read, __u16 cr_write, __u32 exceptions, __u64 intercept), - TP_ARGS(cr_read, cr_write, exceptions, intercept), - - TP_FIELDS( - ctf_integer(__u16, cr_read, cr_read) - ctf_integer(__u16, cr_write, cr_write) - ctf_integer(__u32, exceptions, exceptions) - ctf_integer(__u64, intercept, intercept) - ) -) -/* - * Tracepoint for #VMEXIT while nested - */ -LTTNG_TRACEPOINT_EVENT_MAP(kvm_nested_vmexit, kvm_x86_nested_vmexit, - TP_PROTO(__u64 rip, __u32 exit_code, - __u64 exit_info1, __u64 exit_info2, - __u32 exit_int_info, __u32 exit_int_info_err, __u32 isa), - TP_ARGS(rip, exit_code, exit_info1, exit_info2, - exit_int_info, exit_int_info_err, isa), - - TP_FIELDS( - ctf_integer(__u64, rip, rip) - ctf_integer(__u32, exit_code, exit_code) - ctf_integer(__u64, exit_info1, exit_info1) - ctf_integer(__u64, exit_info2, exit_info2) - ctf_integer(__u32, exit_int_info, exit_int_info) - ctf_integer(__u32, exit_int_info_err, exit_int_info_err) - ctf_integer(__u32, isa, isa) - ) -) - -/* - * Tracepoint for #VMEXIT reinjected to the guest - */ -LTTNG_TRACEPOINT_EVENT_MAP(kvm_nested_vmexit_inject, kvm_x86_nested_vmexit_inject, - TP_PROTO(__u32 exit_code, - __u64 exit_info1, __u64 exit_info2, - __u32 exit_int_info, __u32 exit_int_info_err, __u32 isa), - TP_ARGS(exit_code, exit_info1, exit_info2, - exit_int_info, exit_int_info_err, isa), - - TP_FIELDS( - ctf_integer(__u32, exit_code, exit_code) - ctf_integer(__u64, exit_info1, exit_info1) - ctf_integer(__u64, exit_info2, exit_info2) - ctf_integer(__u32, exit_int_info, exit_int_info) - ctf_integer(__u32, exit_int_info_err, exit_int_info_err) - ctf_integer(__u32, isa, isa) - ) -) - -/* - * Tracepoint for nested #vmexit because of interrupt pending - */ -LTTNG_TRACEPOINT_EVENT_MAP(kvm_nested_intr_vmexit, kvm_x86_nested_intr_vmexit, - TP_PROTO(__u64 rip), - TP_ARGS(rip), - - TP_FIELDS( - ctf_integer(__u64, rip, rip) - ) -) - -/* - * Tracepoint for nested #vmexit because of interrupt pending - */ -LTTNG_TRACEPOINT_EVENT_MAP(kvm_invlpga, kvm_x86_invlpga, - TP_PROTO(__u64 rip, int asid, u64 address), - TP_ARGS(rip, asid, address), - - TP_FIELDS( - ctf_integer(__u64, rip, rip) - ctf_integer(int, asid, asid) - ctf_integer_hex(__u64, address, address) - ) -) - -/* - * Tracepoint for nested #vmexit because of interrupt pending - */ -LTTNG_TRACEPOINT_EVENT_MAP(kvm_skinit, kvm_x86_skinit, - TP_PROTO(__u64 rip, __u32 slb), - TP_ARGS(rip, slb), - - TP_FIELDS( - ctf_integer(__u64, rip, rip) - ctf_integer(__u32, slb, slb) - ) -) - -#define KVM_EMUL_INSN_F_CR0_PE (1 << 0) -#define KVM_EMUL_INSN_F_EFL_VM (1 << 1) -#define KVM_EMUL_INSN_F_CS_D (1 << 2) -#define KVM_EMUL_INSN_F_CS_L (1 << 3) - -#define kvm_trace_symbol_emul_flags \ - { 0, "real" }, \ - { KVM_EMUL_INSN_F_CR0_PE \ - | KVM_EMUL_INSN_F_EFL_VM, "vm16" }, \ - { KVM_EMUL_INSN_F_CR0_PE, "prot16" }, \ - { KVM_EMUL_INSN_F_CR0_PE \ - | KVM_EMUL_INSN_F_CS_D, "prot32" }, \ - { KVM_EMUL_INSN_F_CR0_PE \ - | KVM_EMUL_INSN_F_CS_L, "prot64" } - -#define kei_decode_mode(mode) ({ \ - u8 flags = 0xff; \ - switch (mode) { \ - case X86EMUL_MODE_REAL: \ - flags = 0; \ - break; \ - case X86EMUL_MODE_VM86: \ - flags = KVM_EMUL_INSN_F_EFL_VM; \ - break; \ - case X86EMUL_MODE_PROT16: \ - flags = KVM_EMUL_INSN_F_CR0_PE; \ - break; \ - case X86EMUL_MODE_PROT32: \ - flags = KVM_EMUL_INSN_F_CR0_PE \ - | KVM_EMUL_INSN_F_CS_D; \ - break; \ - case X86EMUL_MODE_PROT64: \ - flags = KVM_EMUL_INSN_F_CR0_PE \ - | KVM_EMUL_INSN_F_CS_L; \ - break; \ - } \ - flags; \ - }) - -LTTNG_TRACEPOINT_EVENT_MAP(kvm_emulate_insn, kvm_x86_emulate_insn, - TP_PROTO(struct kvm_vcpu *vcpu, __u8 failed), - TP_ARGS(vcpu, failed), - - TP_FIELDS( -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)) - ctf_integer(__u64, rip, vcpu->arch.emulate_ctxt.decode.fetch.start) - ctf_integer(__u32, csbase, kvm_x86_ops->get_segment_base(vcpu, VCPU_SREG_CS)) - ctf_integer(__u8, len, vcpu->arch.emulate_ctxt.decode.eip - - vcpu->arch.emulate_ctxt.decode.fetch.start) - ctf_array(__u8, insn, vcpu->arch.emulate_ctxt.decode.fetch.data, 15) - ctf_integer(__u8, flags, kei_decode_mode(vcpu->arch.emulate_ctxt.mode)) -#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)) - ctf_integer(__u64, rip, vcpu->arch.emulate_ctxt.fetch.start) - ctf_integer(__u32, csbase, kvm_x86_ops->get_segment_base(vcpu, VCPU_SREG_CS)) - ctf_integer(__u8, len, vcpu->arch.emulate_ctxt._eip - - vcpu->arch.emulate_ctxt.fetch.start) - ctf_array(__u8, insn, vcpu->arch.emulate_ctxt.fetch.data, 15) - ctf_integer(__u8, flags, kei_decode_mode(vcpu->arch.emulate_ctxt.mode)) -#elif (LINUX_VERSION_CODE < KERNEL_VERSION(5,7,0)) - ctf_integer(__u64, rip, vcpu->arch.emulate_ctxt._eip - - (vcpu->arch.emulate_ctxt.fetch.ptr - - vcpu->arch.emulate_ctxt.fetch.data)) - ctf_integer(__u32, csbase, kvm_x86_ops->get_segment_base(vcpu, VCPU_SREG_CS)) - ctf_integer(__u8, len, vcpu->arch.emulate_ctxt.fetch.ptr - - vcpu->arch.emulate_ctxt.fetch.data) - ctf_array(__u8, insn, vcpu->arch.emulate_ctxt.fetch.data, 15) - ctf_integer(__u8, flags, kei_decode_mode(vcpu->arch.emulate_ctxt.mode)) -#else - ctf_integer(__u64, rip, vcpu->arch.emulate_ctxt->_eip - - (vcpu->arch.emulate_ctxt->fetch.ptr - - vcpu->arch.emulate_ctxt->fetch.data)) - ctf_integer(__u32, csbase, kvm_x86_ops.get_segment_base(vcpu, VCPU_SREG_CS)) - ctf_integer(__u8, len, vcpu->arch.emulate_ctxt->fetch.ptr - - vcpu->arch.emulate_ctxt->fetch.data) - ctf_array(__u8, insn, vcpu->arch.emulate_ctxt->fetch.data, 15) - ctf_integer(__u8, flags, kei_decode_mode(vcpu->arch.emulate_ctxt->mode)) -#endif - ctf_integer(__u8, failed, failed) - ) -) - -#define trace_kvm_emulate_insn_start(vcpu) trace_kvm_emulate_insn(vcpu, 0) -#define trace_kvm_emulate_insn_failed(vcpu) trace_kvm_emulate_insn(vcpu, 1) - -LTTNG_TRACEPOINT_EVENT_MAP( - vcpu_match_mmio, kvm_x86_vcpu_match_mmio, - TP_PROTO(gva_t gva, gpa_t gpa, bool write, bool gpa_match), - TP_ARGS(gva, gpa, write, gpa_match), - - TP_FIELDS( - ctf_integer(gva_t, gva, gva) - ctf_integer(gpa_t, gpa, gpa) - ctf_integer(bool, write, write) - ctf_integer(bool, gpa_match, gpa_match) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) -LTTNG_TRACEPOINT_EVENT_MAP(kvm_write_tsc_offset, kvm_x86_write_tsc_offset, - TP_PROTO(unsigned int vcpu_id, __u64 previous_tsc_offset, - __u64 next_tsc_offset), - TP_ARGS(vcpu_id, previous_tsc_offset, next_tsc_offset), - - TP_FIELDS( - ctf_integer(unsigned int, vcpu_id, vcpu_id) - ctf_integer(__u64, previous_tsc_offset, previous_tsc_offset) - ctf_integer(__u64, next_tsc_offset, next_tsc_offset) - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) -#ifdef CONFIG_X86_64 - -LTTNG_TRACEPOINT_EVENT_MAP(kvm_update_master_clock, kvm_x86_update_master_clock, - TP_PROTO(bool use_master_clock, unsigned int host_clock, bool offset_matched), - TP_ARGS(use_master_clock, host_clock, offset_matched), - - TP_FIELDS( - ctf_integer(bool, use_master_clock, use_master_clock) - ctf_integer(unsigned int, host_clock, host_clock) - ctf_integer(bool, offset_matched, offset_matched) - ) -) - -LTTNG_TRACEPOINT_EVENT_MAP(kvm_track_tsc, kvm_x86_track_tsc, - TP_PROTO(unsigned int vcpu_id, unsigned int nr_matched, - unsigned int online_vcpus, bool use_master_clock, - unsigned int host_clock), - TP_ARGS(vcpu_id, nr_matched, online_vcpus, use_master_clock, - host_clock), - - TP_FIELDS( - ctf_integer(unsigned int, vcpu_id, vcpu_id) - ctf_integer(unsigned int, nr_vcpus_matched_tsc, nr_matched) - ctf_integer(unsigned int, online_vcpus, online_vcpus) - ctf_integer(bool, use_master_clock, use_master_clock) - ctf_integer(unsigned int, host_clock, host_clock) - ) -) - -#endif /* CONFIG_X86_64 */ -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) */ - -#endif /* LTTNG_TRACE_KVM_H */ - -#undef TRACE_INCLUDE_PATH -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module/arch/x86/kvm -#undef TRACE_INCLUDE_FILE -#define TRACE_INCLUDE_FILE trace - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/asoc.h b/include/instrumentation/events/lttng-module/asoc.h deleted file mode 100644 index 7d86af87..00000000 --- a/include/instrumentation/events/lttng-module/asoc.h +++ /dev/null @@ -1,414 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM asoc - -#if !defined(LTTNG_TRACE_ASOC_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_ASOC_H - -#include -#include -#include - -#define DAPM_DIRECT "(direct)" - -#ifndef _TRACE_ASOC_DEF -#define _TRACE_ASOC_DEF -struct snd_soc_jack; -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)) -struct snd_soc_codec; -#endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) && \ - LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)) -struct snd_soc_platform; -#endif -struct snd_soc_card; -struct snd_soc_dapm_widget; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) -struct snd_soc_dapm_path; -#endif -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0) \ - || LTTNG_RHEL_KERNEL_RANGE(3,10,0,514,0,0, 3,11,0,0,0,0)) -#define CODEC_NAME_FIELD component.name -#define CODEC_ID_FIELD component.id -#else -#define CODEC_NAME_FIELD name -#define CODEC_ID_FIELD id -#endif - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)) -/* - * Log register events - */ -LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_reg, - - TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, - unsigned int val), - - TP_ARGS(codec, reg, val), - - TP_FIELDS( - ctf_string(name, codec->CODEC_NAME_FIELD) - ctf_integer(int, id, codec->CODEC_ID_FIELD) - ctf_integer(unsigned int, reg, reg) - ctf_integer(unsigned int, val, val) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_reg, snd_soc_reg_write, - - asoc_snd_soc_reg_write, - - TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, - unsigned int val), - - TP_ARGS(codec, reg, val) - -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_reg, snd_soc_reg_read, - - asoc_snd_soc_reg_read, - - TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, - unsigned int val), - - TP_ARGS(codec, reg, val) - -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) && \ - LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_preg, - - TP_PROTO(struct snd_soc_platform *platform, unsigned int reg, - unsigned int val), - - TP_ARGS(platform, reg, val), - - TP_FIELDS( - ctf_string(name, platform->CODEC_NAME_FIELD) - ctf_integer(int, id, platform->CODEC_ID_FIELD) - ctf_integer(unsigned int, reg, reg) - ctf_integer(unsigned int, val, val) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_preg, snd_soc_preg_write, - - asoc_snd_soc_preg_write, - - TP_PROTO(struct snd_soc_platform *platform, unsigned int reg, - unsigned int val), - - TP_ARGS(platform, reg, val) - -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_preg, snd_soc_preg_read, - - asoc_snd_soc_preg_read, - - TP_PROTO(struct snd_soc_platform *platform, unsigned int reg, - unsigned int val), - - TP_ARGS(platform, reg, val) - -) -#endif - -LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_card, - - TP_PROTO(struct snd_soc_card *card, int val), - - TP_ARGS(card, val), - - TP_FIELDS( - ctf_string(name, card->name) - ctf_integer(int, val, val) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_card, snd_soc_bias_level_start, - - asoc_snd_soc_bias_level_start, - - TP_PROTO(struct snd_soc_card *card, int val), - - TP_ARGS(card, val) - -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_card, snd_soc_bias_level_done, - - asoc_snd_soc_bias_level_done, - - TP_PROTO(struct snd_soc_card *card, int val), - - TP_ARGS(card, val) - -) - -LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_basic, - - TP_PROTO(struct snd_soc_card *card), - - TP_ARGS(card), - - TP_FIELDS( - ctf_string(name, card->name) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic, snd_soc_dapm_start, - - asoc_snd_soc_dapm_start, - - TP_PROTO(struct snd_soc_card *card), - - TP_ARGS(card) - -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic, snd_soc_dapm_done, - - asoc_snd_soc_dapm_done, - - TP_PROTO(struct snd_soc_card *card), - - TP_ARGS(card) - -) - -LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_widget, - - TP_PROTO(struct snd_soc_dapm_widget *w, int val), - - TP_ARGS(w, val), - - TP_FIELDS( - ctf_string(name, w->name) - ctf_integer(int, val, val) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_widget, snd_soc_dapm_widget_power, - - asoc_snd_soc_dapm_widget_power, - - TP_PROTO(struct snd_soc_dapm_widget *w, int val), - - TP_ARGS(w, val) - -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_widget, snd_soc_dapm_widget_event_start, - - asoc_snd_soc_dapm_widget_event_start, - - TP_PROTO(struct snd_soc_dapm_widget *w, int val), - - TP_ARGS(w, val) - -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_widget, snd_soc_dapm_widget_event_done, - - asoc_snd_soc_dapm_widget_event_done, - - TP_PROTO(struct snd_soc_dapm_widget *w, int val), - - TP_ARGS(w, val) - -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) -LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_walk_done, - - asoc_snd_soc_dapm_walk_done, - - TP_PROTO(struct snd_soc_card *card), - - TP_ARGS(card), - - TP_FIELDS( - ctf_string(name, card->name) - ctf_integer(int, power_checks, card->dapm_stats.power_checks) - ctf_integer(int, path_checks, card->dapm_stats.path_checks) - ctf_integer(int, neighbour_checks, card->dapm_stats.neighbour_checks) - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) -LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_path, - - asoc_snd_soc_dapm_path, - - TP_PROTO(struct snd_soc_dapm_widget *widget, - enum snd_soc_dapm_direction dir, - struct snd_soc_dapm_path *path), - - TP_ARGS(widget, dir, path), - - TP_FIELDS( - ctf_string(wname, widget->name) - ctf_string(pname, path->name ? path->name : DAPM_DIRECT) - ctf_string(pnname, path->node[dir]->name) - ctf_integer(int, path_node, (long) path->node[dir]) - ctf_integer(int, path_connect, path->connect) - ctf_integer(int, path_dir, dir) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) -LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_output_path, - - asoc_snd_soc_dapm_output_path, - - TP_PROTO(struct snd_soc_dapm_widget *widget, - struct snd_soc_dapm_path *path), - - TP_ARGS(widget, path), - - TP_FIELDS( - ctf_string(wname, widget->name) - ctf_string(pname, path->name ? path->name : DAPM_DIRECT) - ctf_string(psname, path->sink->name) - ctf_integer(int, path_sink, (long) path->sink) - ctf_integer(int, path_connect, path->connect) - ) -) - -LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_input_path, - - asoc_snd_soc_dapm_input_path, - - TP_PROTO(struct snd_soc_dapm_widget *widget, - struct snd_soc_dapm_path *path), - - TP_ARGS(widget, path), - - TP_FIELDS( - ctf_string(wname, widget->name) - ctf_string(pname,path->name ? path->name : DAPM_DIRECT) - ctf_string(psname, path->source->name) - ctf_integer(int, path_source, (long) path->source) - ctf_integer(int, path_connect, path->connect) - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) -LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_connected, - - asoc_snd_soc_dapm_connected, - - TP_PROTO(int paths, int stream), - - TP_ARGS(paths, stream), - - TP_FIELDS( - ctf_integer(int, paths, paths) - ctf_integer(int, stream, stream) - ) -) -#endif - -LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_irq, - - asoc_snd_soc_jack_irq, - - TP_PROTO(const char *name), - - TP_ARGS(name), - - TP_FIELDS( - ctf_string(name, name) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) -LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_report, - - asoc_snd_soc_jack_report, - - TP_PROTO(struct snd_soc_jack *jack, int mask, int val), - - TP_ARGS(jack, mask, val), - - TP_FIELDS( - ctf_string(name, jack->jack->id) - ctf_integer(int, mask, mask) - ctf_integer(int, val, val) - ) -) - -LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_notify, - - asoc_snd_soc_jack_notify, - - TP_PROTO(struct snd_soc_jack *jack, int val), - - TP_ARGS(jack, val), - - TP_FIELDS( - ctf_string(name, jack->jack->id) - ctf_integer(int, val, val) - ) -) -#else -LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_report, - - asoc_snd_soc_jack_report, - - TP_PROTO(struct snd_soc_jack *jack, int mask, int val), - - TP_ARGS(jack, mask, val), - - TP_FIELDS( - ctf_string(name, jack->jack->name) - ctf_integer(int, mask, mask) - ctf_integer(int, val, val) - ) -) - -LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_notify, - - asoc_snd_soc_jack_notify, - - TP_PROTO(struct snd_soc_jack *jack, int val), - - TP_ARGS(jack, val), - - TP_FIELDS( - ctf_string(name, jack->jack->name) - ctf_integer(int, val, val) - ) -) -#endif - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)) -LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_cache_sync, - - asoc_snd_soc_cache_sync, - - TP_PROTO(struct snd_soc_codec *codec, const char *type, - const char *status), - - TP_ARGS(codec, type, status), - - TP_FIELDS( - ctf_string(name, codec->CODEC_NAME_FIELD) - ctf_string(status, status) - ctf_string(type, type) - ctf_integer(int, id, codec->CODEC_ID_FIELD) - ) -) -#endif - -#endif /* LTTNG_TRACE_ASOC_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/block.h b/include/instrumentation/events/lttng-module/block.h deleted file mode 100644 index 3b087d66..00000000 --- a/include/instrumentation/events/lttng-module/block.h +++ /dev/null @@ -1,1054 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM block - -#if !defined(LTTNG_TRACE_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_BLOCK_H - -#include -#include -#include -#include -#include - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) -#include -#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ - -#ifndef _TRACE_BLOCK_DEF_ -#define _TRACE_BLOCK_DEF_ - -enum { - RWBS_FLAG_WRITE = (1 << 0), - RWBS_FLAG_DISCARD = (1 << 1), - RWBS_FLAG_READ = (1 << 2), - RWBS_FLAG_RAHEAD = (1 << 3), - RWBS_FLAG_BARRIER = (1 << 4), - RWBS_FLAG_SYNC = (1 << 5), - RWBS_FLAG_META = (1 << 6), - RWBS_FLAG_SECURE = (1 << 7), - RWBS_FLAG_FLUSH = (1 << 8), - RWBS_FLAG_FUA = (1 << 9), - RWBS_FLAG_PREFLUSH = (1 << 10), -}; - -#endif /* _TRACE_BLOCK_DEF_ */ - -LTTNG_TRACEPOINT_ENUM(block_rq_type, - TP_ENUM_VALUES( - ctf_enum_value("RWBS_FLAG_WRITE", RWBS_FLAG_WRITE) - ctf_enum_value("RWBS_FLAG_DISCARD", RWBS_FLAG_DISCARD) - ctf_enum_value("RWBS_FLAG_READ", RWBS_FLAG_READ) - ctf_enum_value("RWBS_FLAG_RAHEAD", RWBS_FLAG_RAHEAD) - ctf_enum_value("RWBS_FLAG_BARRIER", RWBS_FLAG_BARRIER) - ctf_enum_value("RWBS_FLAG_SYNC", RWBS_FLAG_SYNC) - ctf_enum_value("RWBS_FLAG_META", RWBS_FLAG_META) - ctf_enum_value("RWBS_FLAG_SECURE", RWBS_FLAG_SECURE) - ctf_enum_value("RWBS_FLAG_FLUSH", RWBS_FLAG_FLUSH) - ctf_enum_value("RWBS_FLAG_FUA", RWBS_FLAG_FUA) - ctf_enum_value("RWBS_FLAG_PREFLUSH", RWBS_FLAG_PREFLUSH) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,103,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,114,94,0,0, 4,4,114,95,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,120,94,0,0, 4,4,120,95,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,126,94,0,0, 4,5,0,0,0,0)) - -#define lttng_req_op(rq) req_op(rq) -#define lttng_req_rw(rq) ((rq)->cmd_flags) -#define lttng_bio_op(bio) bio_op(bio) -#define lttng_bio_rw(bio) ((bio)->bi_opf) - -#define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \ - ctf_enum(block_rq_type, type, rwbs, \ - (((op) == REQ_OP_WRITE || (op) == REQ_OP_WRITE_SAME) ? RWBS_FLAG_WRITE : \ - ( (op) == REQ_OP_DISCARD ? RWBS_FLAG_DISCARD : \ - ( (op) == REQ_OP_SECURE_ERASE ? (RWBS_FLAG_DISCARD | RWBS_FLAG_SECURE) : \ - ( (op) == REQ_OP_FLUSH ? RWBS_FLAG_FLUSH : \ - ( (op) == REQ_OP_READ ? RWBS_FLAG_READ : \ - ( 0 )))))) \ - | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \ - | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \ - | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \ - | ((rw) & REQ_PREFLUSH ? RWBS_FLAG_PREFLUSH : 0) \ - | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0)) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) - -#define lttng_req_op(rq) -#define lttng_req_rw(rq) ((rq)->cmd_flags) -#define lttng_bio_op(bio) -#define lttng_bio_rw(bio) ((bio)->bi_rw) - -#define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \ - ctf_enum(block_rq_type, type, rwbs, ((rw) & WRITE ? RWBS_FLAG_WRITE : \ - ( (rw) & REQ_DISCARD ? RWBS_FLAG_DISCARD : \ - ( (bytes) ? RWBS_FLAG_READ : \ - ( 0 )))) \ - | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \ - | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \ - | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \ - | ((rw) & REQ_SECURE ? RWBS_FLAG_SECURE : 0) \ - | ((rw) & REQ_FLUSH ? RWBS_FLAG_FLUSH : 0) \ - | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0)) - -#else - -#define lttng_req_op(rq) -#define lttng_req_rw(rq) ((rq)->cmd_flags) -#define lttng_bio_op(bio) -#define lttng_bio_rw(bio) ((bio)->bi_rw) - -#define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \ - ctf_enum(block_rq_type, type, rwbs, ((rw) & WRITE ? RWBS_FLAG_WRITE : \ - ( (rw) & REQ_DISCARD ? RWBS_FLAG_DISCARD : \ - ( (bytes) ? RWBS_FLAG_READ : \ - ( 0 )))) \ - | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \ - | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \ - | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \ - | ((rw) & REQ_SECURE ? RWBS_FLAG_SECURE : 0)) - -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(block_buffer, - - TP_PROTO(struct buffer_head *bh), - - TP_ARGS(bh), - - TP_FIELDS ( - ctf_integer(dev_t, dev, bh->b_bdev->bd_dev) - ctf_integer(sector_t, sector, bh->b_blocknr) - ctf_integer(size_t, size, bh->b_size) - ) -) - -/** - * block_touch_buffer - mark a buffer accessed - * @bh: buffer_head being touched - * - * Called from touch_buffer(). - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(block_buffer, block_touch_buffer, - - TP_PROTO(struct buffer_head *bh), - - TP_ARGS(bh) -) - -/** - * block_dirty_buffer - mark a buffer dirty - * @bh: buffer_head being dirtied - * - * Called from mark_buffer_dirty(). - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(block_buffer, block_dirty_buffer, - - TP_PROTO(struct buffer_head *bh), - - TP_ARGS(bh) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) -/* block_rq_with_error event class removed in kernel 4.12 */ -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) -LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq_with_error, - - TP_PROTO(struct request_queue *q, struct request *rq), - - TP_ARGS(q, rq), - - TP_locvar( - sector_t sector; - unsigned int nr_sector; - unsigned char *cmd; - size_t cmd_len; - ), - - TP_code_pre( - if (blk_rq_is_scsi(rq)) { - struct scsi_request *scsi_rq = scsi_req(rq); - tp_locvar->sector = 0; - tp_locvar->nr_sector = 0; - tp_locvar->cmd = scsi_rq->cmd; - tp_locvar->cmd_len = scsi_rq->cmd_len; - } else { - tp_locvar->sector = blk_rq_pos(rq); - tp_locvar->nr_sector = blk_rq_sectors(rq); - tp_locvar->cmd = NULL; - tp_locvar->cmd_len = 0; - } - ), - - TP_FIELDS( - ctf_integer(dev_t, dev, - rq->rq_disk ? disk_devt(rq->rq_disk) : 0) - ctf_integer(sector_t, sector, tp_locvar->sector) - ctf_integer(unsigned int, nr_sector, tp_locvar->nr_sector) - ctf_integer(int, errors, rq->errors) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq)) - ctf_sequence_hex(unsigned char, cmd, - tp_locvar->cmd, size_t, tp_locvar->cmd_len) - ), - - TP_code_post() -) -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ -LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq_with_error, - - TP_PROTO(struct request_queue *q, struct request *rq), - - TP_ARGS(q, rq), - - TP_locvar( - sector_t sector; - unsigned int nr_sector; - unsigned char *cmd; - size_t cmd_len; - ), - - TP_code_pre( - - if (rq->cmd_type == REQ_TYPE_BLOCK_PC) { - tp_locvar->sector = 0; - tp_locvar->nr_sector = 0; - tp_locvar->cmd = rq->cmd; - tp_locvar->cmd_len = rq->cmd_len; - } else { - tp_locvar->sector = blk_rq_pos(rq); - tp_locvar->nr_sector = blk_rq_sectors(rq); - tp_locvar->cmd = NULL; - tp_locvar->cmd_len = 0; - } - ), - - TP_FIELDS( - ctf_integer(dev_t, dev, - rq->rq_disk ? disk_devt(rq->rq_disk) : 0) - ctf_integer(sector_t, sector, tp_locvar->sector) - ctf_integer(unsigned int, nr_sector, tp_locvar->nr_sector) - ctf_integer(int, errors, rq->errors) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq)) - ctf_sequence_hex(unsigned char, cmd, - tp_locvar->cmd, size_t, tp_locvar->cmd_len) - ), - - TP_code_post() -) -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0)) -/** - * block_rq_abort - abort block operation request - * @q: queue containing the block operation request - * @rq: block IO operation request - * - * Called immediately after pending block IO operation request @rq in - * queue @q is aborted. The fields in the operation request @rq - * can be examined to determine which device and sectors the pending - * operation would access. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq_with_error, block_rq_abort, - - TP_PROTO(struct request_queue *q, struct request *rq), - - TP_ARGS(q, rq) -) -#endif - -/** - * block_rq_requeue - place block IO request back on a queue - * @q: queue holding operation - * @rq: block IO operation request - * - * The block operation request @rq is being placed back into queue - * @q. For some reason the request was not completed and needs to be - * put back in the queue. - */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) -LTTNG_TRACEPOINT_EVENT(block_rq_requeue, - - TP_PROTO(struct request_queue *q, struct request *rq), - - TP_ARGS(q, rq), - - TP_FIELDS( - ctf_integer(dev_t, dev, - rq->rq_disk ? disk_devt(rq->rq_disk) : 0) - ctf_integer(sector_t, sector, blk_rq_trace_sector(rq)) - ctf_integer(unsigned int, nr_sector, blk_rq_trace_nr_sectors(rq)) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq)) - ) -) -#else -LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq_with_error, block_rq_requeue, - - TP_PROTO(struct request_queue *q, struct request *rq), - - TP_ARGS(q, rq) -) -#endif - -/** - * block_rq_complete - block IO operation completed by device driver - * @q: queue containing the block operation request - * @rq: block operations request - * @nr_bytes: number of completed bytes - * - * The block_rq_complete tracepoint event indicates that some portion - * of operation request has been completed by the device driver. If - * the @rq->bio is %NULL, then there is absolutely no additional work to - * do for the request. If @rq->bio is non-NULL then there is - * additional work required to complete the request. - */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) -LTTNG_TRACEPOINT_EVENT(block_rq_complete, - - TP_PROTO(struct request *rq, int error, unsigned int nr_bytes), - - TP_ARGS(rq, error, nr_bytes), - - TP_FIELDS( - ctf_integer(dev_t, dev, - rq->rq_disk ? disk_devt(rq->rq_disk) : 0) - ctf_integer(sector_t, sector, blk_rq_pos(rq)) - ctf_integer(unsigned int, nr_sector, nr_bytes >> 9) - ctf_integer(int, error, error) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_req_op(rq), lttng_req_rw(rq), nr_bytes) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) -LTTNG_TRACEPOINT_EVENT_CODE(block_rq_complete, - - TP_PROTO(struct request_queue *q, struct request *rq, - unsigned int nr_bytes), - - TP_ARGS(q, rq, nr_bytes), - - TP_locvar( - unsigned char *cmd; - size_t cmd_len; - ), - - TP_code_pre( - if (blk_rq_is_scsi(rq)) { - struct scsi_request *scsi_rq = scsi_req(rq); - tp_locvar->cmd = scsi_rq->cmd; - tp_locvar->cmd_len = scsi_rq->cmd_len; - } else { - tp_locvar->cmd = NULL; - tp_locvar->cmd_len = 0; - } - ), - - TP_FIELDS( - ctf_integer(dev_t, dev, - rq->rq_disk ? disk_devt(rq->rq_disk) : 0) - ctf_integer(sector_t, sector, blk_rq_pos(rq)) - ctf_integer(unsigned int, nr_sector, nr_bytes >> 9) - ctf_integer(int, errors, rq->errors) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_req_op(rq), lttng_req_rw(rq), nr_bytes) - ctf_sequence_hex(unsigned char, cmd, - tp_locvar->cmd, size_t, tp_locvar->cmd_len) - ), - - TP_code_post() -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,5) \ - || LTTNG_KERNEL_RANGE(3,12,21, 3,13,0) \ - || LTTNG_KERNEL_RANGE(3,10,41, 3,11,0) \ - || LTTNG_KERNEL_RANGE(3,4,91, 3,5,0) \ - || LTTNG_KERNEL_RANGE(3,2,58, 3,3,0) \ - || LTTNG_UBUNTU_KERNEL_RANGE(3,13,11,28, 3,14,0,0) \ - || LTTNG_RHEL_KERNEL_RANGE(3,10,0,229,0,0, 3,11,0,0,0,0)) - -LTTNG_TRACEPOINT_EVENT_CODE(block_rq_complete, - - TP_PROTO(struct request_queue *q, struct request *rq, - unsigned int nr_bytes), - - TP_ARGS(q, rq, nr_bytes), - - TP_locvar( - unsigned char *cmd; - size_t cmd_len; - ), - - TP_code_pre( - if (rq->cmd_type == REQ_TYPE_BLOCK_PC) { - tp_locvar->cmd = rq->cmd; - tp_locvar->cmd_len = rq->cmd_len; - } else { - tp_locvar->cmd = NULL; - tp_locvar->cmd_len = 0; - } - ), - - TP_FIELDS( - ctf_integer(dev_t, dev, - rq->rq_disk ? disk_devt(rq->rq_disk) : 0) - ctf_integer(sector_t, sector, blk_rq_pos(rq)) - ctf_integer(unsigned int, nr_sector, nr_bytes >> 9) - ctf_integer(int, errors, rq->errors) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_req_op(rq), lttng_req_rw(rq), nr_bytes) - ctf_sequence_hex(unsigned char, cmd, - tp_locvar->cmd, size_t, tp_locvar->cmd_len) - ), - - TP_code_post() -) - -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */ - -/** - * block_rq_complete - block IO operation completed by device driver - * @q: queue containing the block operation request - * @rq: block operations request - * - * The block_rq_complete tracepoint event indicates that some portion - * of operation request has been completed by the device driver. If - * the @rq->bio is %NULL, then there is absolutely no additional work to - * do for the request. If @rq->bio is non-NULL then there is - * additional work required to complete the request. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq_with_error, block_rq_complete, - - TP_PROTO(struct request_queue *q, struct request *rq), - - TP_ARGS(q, rq) -) - -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */ - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(block_rq, - - TP_PROTO(struct request_queue *q, struct request *rq), - - TP_ARGS(q, rq), - - TP_FIELDS( - ctf_integer(dev_t, dev, - rq->rq_disk ? disk_devt(rq->rq_disk) : 0) - ctf_integer(sector_t, sector, blk_rq_trace_sector(rq)) - ctf_integer(unsigned int, nr_sector, blk_rq_trace_nr_sectors(rq)) - ctf_integer(unsigned int, bytes, blk_rq_bytes(rq)) - ctf_integer(pid_t, tid, current->pid) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq)) - ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) -LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq, - - TP_PROTO(struct request_queue *q, struct request *rq), - - TP_ARGS(q, rq), - - TP_locvar( - sector_t sector; - unsigned int nr_sector; - unsigned int bytes; - unsigned char *cmd; - size_t cmd_len; - ), - - TP_code_pre( - if (blk_rq_is_scsi(rq)) { - struct scsi_request *scsi_rq = scsi_req(rq); - tp_locvar->sector = 0; - tp_locvar->nr_sector = 0; - tp_locvar->bytes = scsi_rq->resid_len; - tp_locvar->cmd = scsi_rq->cmd; - tp_locvar->cmd_len = scsi_rq->cmd_len; - } else { - tp_locvar->sector = blk_rq_pos(rq); - tp_locvar->nr_sector = blk_rq_sectors(rq); - tp_locvar->bytes = 0; - tp_locvar->cmd = NULL; - tp_locvar->cmd_len = 0; - } - ), - - TP_FIELDS( - ctf_integer(dev_t, dev, - rq->rq_disk ? disk_devt(rq->rq_disk) : 0) - ctf_integer(sector_t, sector, tp_locvar->sector) - ctf_integer(unsigned int, nr_sector, tp_locvar->nr_sector) - ctf_integer(unsigned int, bytes, tp_locvar->bytes) - ctf_integer(pid_t, tid, current->pid) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq)) - ctf_sequence_hex(unsigned char, cmd, - tp_locvar->cmd, size_t, tp_locvar->cmd_len) - ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) - ), - - TP_code_post() -) -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ -LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq, - - TP_PROTO(struct request_queue *q, struct request *rq), - - TP_ARGS(q, rq), - - TP_locvar( - sector_t sector; - unsigned int nr_sector; - unsigned int bytes; - unsigned char *cmd; - size_t cmd_len; - ), - - TP_code_pre( - if (rq->cmd_type == REQ_TYPE_BLOCK_PC) { - tp_locvar->sector = 0; - tp_locvar->nr_sector = 0; - tp_locvar->bytes = blk_rq_bytes(rq); - tp_locvar->cmd = rq->cmd; - tp_locvar->cmd_len = rq->cmd_len; - } else { - tp_locvar->sector = blk_rq_pos(rq); - tp_locvar->nr_sector = blk_rq_sectors(rq); - tp_locvar->bytes = 0; - tp_locvar->cmd = NULL; - tp_locvar->cmd_len = 0; - } - ), - - TP_FIELDS( - ctf_integer(dev_t, dev, - rq->rq_disk ? disk_devt(rq->rq_disk) : 0) - ctf_integer(sector_t, sector, tp_locvar->sector) - ctf_integer(unsigned int, nr_sector, tp_locvar->nr_sector) - ctf_integer(unsigned int, bytes, tp_locvar->bytes) - ctf_integer(pid_t, tid, current->pid) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq)) - ctf_sequence_hex(unsigned char, cmd, - tp_locvar->cmd, size_t, tp_locvar->cmd_len) - ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) - ), - - TP_code_post() -) -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ - -/** - * block_rq_insert - insert block operation request into queue - * @q: target queue - * @rq: block IO operation request - * - * Called immediately before block operation request @rq is inserted - * into queue @q. The fields in the operation request @rq struct can - * be examined to determine which device and sectors the pending - * operation would access. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq, block_rq_insert, - - TP_PROTO(struct request_queue *q, struct request *rq), - - TP_ARGS(q, rq) -) - -/** - * block_rq_issue - issue pending block IO request operation to device driver - * @q: queue holding operation - * @rq: block IO operation operation request - * - * Called when block operation request @rq from queue @q is sent to a - * device driver for processing. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq, block_rq_issue, - - TP_PROTO(struct request_queue *q, struct request *rq), - - TP_ARGS(q, rq) -) - -/** - * block_bio_bounce - used bounce buffer when processing block operation - * @q: queue holding the block operation - * @bio: block operation - * - * A bounce buffer was used to handle the block operation @bio in @q. - * This occurs when hardware limitations prevent a direct transfer of - * data between the @bio data memory area and the IO device. Use of a - * bounce buffer requires extra copying of data and decreases - * performance. - */ -LTTNG_TRACEPOINT_EVENT(block_bio_bounce, - - TP_PROTO(struct request_queue *q, struct bio *bio), - - TP_ARGS(q, bio), - - TP_FIELDS( -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) - ctf_integer(dev_t, dev, bio_dev(bio)) -#else - ctf_integer(dev_t, dev, bio->bi_bdev ? bio->bi_bdev->bd_dev : 0) -#endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) - ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) - ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_bio_op(bio), lttng_bio_rw(bio), - bio->bi_iter.bi_size) -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ - ctf_integer(sector_t, sector, bio->bi_sector) - ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_bio_op(bio), lttng_bio_rw(bio), - bio->bi_size) -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ - ctf_integer(pid_t, tid, current->pid) - ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) - ) -) - -/** - * block_bio_complete - completed all work on the block operation - * @q: queue holding the block operation - * @bio: block operation completed - * @error: io error value - * - * This tracepoint indicates there is no further work to do on this - * block IO operation @bio. - */ -LTTNG_TRACEPOINT_EVENT(block_bio_complete, - - TP_PROTO(struct request_queue *q, struct bio *bio, int error), - - TP_ARGS(q, bio, error), - - TP_FIELDS( -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) - ctf_integer(dev_t, dev, bio_dev(bio)) -#else - ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) -#endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) - ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) - ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) - ctf_integer(int, error, error) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_bio_op(bio), lttng_bio_rw(bio), - bio->bi_iter.bi_size) -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ - ctf_integer(sector_t, sector, bio->bi_sector) - ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) - ctf_integer(int, error, error) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(block_bio_merge, - - TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio), - - TP_ARGS(q, rq, bio), - - TP_FIELDS( -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) - ctf_integer(dev_t, dev, bio_dev(bio)) -#else - ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) -#endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) - ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) - ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_bio_op(bio), lttng_bio_rw(bio), - bio->bi_iter.bi_size) -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ - ctf_integer(sector_t, sector, bio->bi_sector) - ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ - ctf_integer(pid_t, tid, current->pid) - ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) - ) -) - -/** - * block_bio_backmerge - merging block operation to the end of an existing operation - * @q: queue holding operation - * @bio: new block operation to merge - * - * Merging block request @bio to the end of an existing block request - * in queue @q. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio_merge, block_bio_backmerge, - - TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio), - - TP_ARGS(q, rq, bio) -) - -/** - * block_bio_frontmerge - merging block operation to the beginning of an existing operation - * @q: queue holding operation - * @bio: new block operation to merge - * - * Merging block IO operation @bio to the beginning of an existing block - * operation in queue @q. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio_merge, block_bio_frontmerge, - - TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio), - - TP_ARGS(q, rq, bio) -) - -/** - * block_bio_queue - putting new block IO operation in queue - * @q: queue holding operation - * @bio: new block operation - * - * About to place the block IO operation @bio into queue @q. - */ -LTTNG_TRACEPOINT_EVENT(block_bio_queue, - - TP_PROTO(struct request_queue *q, struct bio *bio), - - TP_ARGS(q, bio), - - TP_FIELDS( -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) - ctf_integer(dev_t, dev, bio_dev(bio)) -#else - ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) -#endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) - ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) - ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_bio_op(bio), lttng_bio_rw(bio), - bio->bi_iter.bi_size) -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ - ctf_integer(sector_t, sector, bio->bi_sector) - ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ - ctf_integer(pid_t, tid, current->pid) - ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) - ) -) -#else /* if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) */ -LTTNG_TRACEPOINT_EVENT_CLASS(block_bio, - - TP_PROTO(struct request_queue *q, struct bio *bio), - - TP_ARGS(q, bio), - - TP_FIELDS( - ctf_integer(dev_t, dev, bio->bi_bdev ? bio->bi_bdev->bd_dev : 0) - ctf_integer(sector_t, sector, bio->bi_sector) - ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) - ctf_integer(pid_t, tid, current->pid) - ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) - ) -) - -/** - * block_bio_backmerge - merging block operation to the end of an existing operation - * @q: queue holding operation - * @bio: new block operation to merge - * - * Merging block request @bio to the end of an existing block request - * in queue @q. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_backmerge, - - TP_PROTO(struct request_queue *q, struct bio *bio), - - TP_ARGS(q, bio) -) - -/** - * block_bio_frontmerge - merging block operation to the beginning of an existing operation - * @q: queue holding operation - * @bio: new block operation to merge - * - * Merging block IO operation @bio to the beginning of an existing block - * operation in queue @q. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_frontmerge, - - TP_PROTO(struct request_queue *q, struct bio *bio), - - TP_ARGS(q, bio) -) - -/** - * block_bio_queue - putting new block IO operation in queue - * @q: queue holding operation - * @bio: new block operation - * - * About to place the block IO operation @bio into queue @q. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_queue, - - TP_PROTO(struct request_queue *q, struct bio *bio), - - TP_ARGS(q, bio) -) -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) */ - -LTTNG_TRACEPOINT_EVENT_CLASS(block_get_rq, - - TP_PROTO(struct request_queue *q, struct bio *bio, int rw), - - TP_ARGS(q, bio, rw), - - TP_FIELDS( -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) - ctf_integer(dev_t, dev, bio ? bio_dev(bio) : 0) -#else - ctf_integer(dev_t, dev, bio ? bio->bi_bdev->bd_dev : 0) -#endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) - ctf_integer(sector_t, sector, bio ? bio->bi_iter.bi_sector : 0) - ctf_integer(unsigned int, nr_sector, - bio ? bio_sectors(bio) : 0) - blk_rwbs_ctf_integer(unsigned int, rwbs, - bio ? lttng_bio_op(bio) : 0, - bio ? lttng_bio_rw(bio) : 0, - bio ? bio->bi_iter.bi_size : 0) -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ - ctf_integer(sector_t, sector, bio ? bio->bi_sector : 0) - ctf_integer(unsigned int, nr_sector, - bio ? bio->bi_size >> 9 : 0) - blk_rwbs_ctf_integer(unsigned int, rwbs, - bio ? lttng_bio_op(bio) : 0, - bio ? lttng_bio_rw(bio) : 0, - bio ? bio->bi_size : 0) -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ - ctf_integer(pid_t, tid, current->pid) - ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) - ) -) - -/** - * block_getrq - get a free request entry in queue for block IO operations - * @q: queue for operations - * @bio: pending block IO operation (can be %NULL) - * @rw: low bit indicates a read (%0) or a write (%1) - * - * A request struct for queue @q has been allocated to handle the - * block IO operation @bio. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(block_get_rq, block_getrq, - - TP_PROTO(struct request_queue *q, struct bio *bio, int rw), - - TP_ARGS(q, bio, rw) -) - -/** - * block_sleeprq - waiting to get a free request entry in queue for block IO operation - * @q: queue for operation - * @bio: pending block IO operation (can be %NULL) - * @rw: low bit indicates a read (%0) or a write (%1) - * - * In the case where a request struct cannot be provided for queue @q - * the process needs to wait for an request struct to become - * available. This tracepoint event is generated each time the - * process goes to sleep waiting for request struct become available. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(block_get_rq, block_sleeprq, - - TP_PROTO(struct request_queue *q, struct bio *bio, int rw), - - TP_ARGS(q, bio, rw) -) - -/** - * block_plug - keep operations requests in request queue - * @q: request queue to plug - * - * Plug the request queue @q. Do not allow block operation requests - * to be sent to the device driver. Instead, accumulate requests in - * the queue to improve throughput performance of the block device. - */ -LTTNG_TRACEPOINT_EVENT(block_plug, - - TP_PROTO(struct request_queue *q), - - TP_ARGS(q), - - TP_FIELDS( - ctf_integer(pid_t, tid, current->pid) - ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(block_unplug, - - TP_PROTO(struct request_queue *q, unsigned int depth, bool explicit), - - TP_ARGS(q, depth, explicit), - - TP_FIELDS( - ctf_integer(int, nr_rq, depth) - ctf_integer(pid_t, tid, current->pid) - ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) - ) -) - -/** - * block_unplug - release of operations requests in request queue - * @q: request queue to unplug - * @depth: number of requests just added to the queue - * @explicit: whether this was an explicit unplug, or one from schedule() - * - * Unplug request queue @q because device driver is scheduled to work - * on elements in the request queue. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(block_unplug, block_unplug, - - TP_PROTO(struct request_queue *q, unsigned int depth, bool explicit), - - TP_ARGS(q, depth, explicit) -) - -/** - * block_split - split a single bio struct into two bio structs - * @q: queue containing the bio - * @bio: block operation being split - * @new_sector: The starting sector for the new bio - * - * The bio request @bio in request queue @q needs to be split into two - * bio requests. The newly created @bio request starts at - * @new_sector. This split may be required due to hardware limitation - * such as operation crossing device boundaries in a RAID system. - */ -LTTNG_TRACEPOINT_EVENT(block_split, - - TP_PROTO(struct request_queue *q, struct bio *bio, - unsigned int new_sector), - - TP_ARGS(q, bio, new_sector), - - TP_FIELDS( -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) - ctf_integer(dev_t, dev, bio_dev(bio)) -#else - ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) -#endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) - ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_bio_op(bio), lttng_bio_rw(bio), - bio->bi_iter.bi_size) -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ - ctf_integer(sector_t, sector, bio->bi_sector) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ - ctf_integer(sector_t, new_sector, new_sector) - ctf_integer(pid_t, tid, current->pid) - ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) - ) -) - -/** - * block_bio_remap - map request for a logical device to the raw device - * @q: queue holding the operation - * @bio: revised operation - * @dev: device for the operation - * @from: original sector for the operation - * - * An operation for a logical device has been mapped to the - * raw block device. - */ -LTTNG_TRACEPOINT_EVENT(block_bio_remap, - - TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev, - sector_t from), - - TP_ARGS(q, bio, dev, from), - - TP_FIELDS( -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) - ctf_integer(dev_t, dev, bio_dev(bio)) -#else - ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) -#endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) - ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) - ctf_integer(unsigned int, nr_sector, bio_sectors(bio)) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_bio_op(bio), lttng_bio_rw(bio), - bio->bi_iter.bi_size) -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ - ctf_integer(sector_t, sector, bio->bi_sector) - ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ - ctf_integer(dev_t, old_dev, dev) - ctf_integer(sector_t, old_sector, from) - ) -) - -/** - * block_rq_remap - map request for a block operation request - * @q: queue holding the operation - * @rq: block IO operation request - * @dev: device for the operation - * @from: original sector for the operation - * - * The block operation request @rq in @q has been remapped. The block - * operation request @rq holds the current information and @from hold - * the original sector. - */ -LTTNG_TRACEPOINT_EVENT(block_rq_remap, - - TP_PROTO(struct request_queue *q, struct request *rq, dev_t dev, - sector_t from), - - TP_ARGS(q, rq, dev, from), - - TP_FIELDS( - ctf_integer(dev_t, dev, disk_devt(rq->rq_disk)) - ctf_integer(sector_t, sector, blk_rq_pos(rq)) - ctf_integer(unsigned int, nr_sector, blk_rq_sectors(rq)) - ctf_integer(dev_t, old_dev, dev) - ctf_integer(sector_t, old_sector, from) - blk_rwbs_ctf_integer(unsigned int, rwbs, - lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq)) - ) -) - -#undef __print_rwbs_flags -#undef blk_fill_rwbs - -#endif /* LTTNG_TRACE_BLOCK_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/btrfs.h b/include/instrumentation/events/lttng-module/btrfs.h deleted file mode 100644 index f38444bf..00000000 --- a/include/instrumentation/events/lttng-module/btrfs.h +++ /dev/null @@ -1,2385 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM btrfs - -#if !defined(LTTNG_TRACE_BTRFS_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_BTRFS_H - -#include -#include -#include - -#ifndef _TRACE_BTRFS_DEF_ -#define _TRACE_BTRFS_DEF_ -struct btrfs_root; -struct btrfs_fs_info; -struct btrfs_inode; -struct extent_map; -struct btrfs_ordered_extent; -struct btrfs_delayed_ref_node; -struct btrfs_delayed_tree_ref; -struct btrfs_delayed_data_ref; -struct btrfs_delayed_ref_head; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) -struct btrfs_block_group; -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) -struct btrfs_block_group_cache; -#endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) -struct btrfs_free_cluster; -#endif -struct map_lookup; -struct extent_buffer; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) -struct extent_state; -#endif -#endif - -#define BTRFS_UUID_SIZE 16 - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)) -#define lttng_fs_info_fsid fs_info->fs_devices->fsid -#else -#define lttng_fs_info_fsid fs_info->fsid -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) -LTTNG_TRACEPOINT_EVENT(btrfs_transaction_commit, - - TP_PROTO(const struct btrfs_root *root), - - TP_ARGS(root), - - TP_FIELDS( - ctf_integer(u64, generation, root->fs_info->generation) - ctf_integer(u64, root_objectid, root->root_key.objectid) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__inode, - - TP_PROTO(const struct inode *inode), - - TP_ARGS(inode), - - TP_FIELDS( - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(blkcnt_t, blocks, inode->i_blocks) - ctf_integer(u64, disk_i_size, BTRFS_I(inode)->disk_i_size) - ctf_integer(u64, generation, BTRFS_I(inode)->generation) - ctf_integer(u64, last_trans, BTRFS_I(inode)->last_trans) - ctf_integer(u64, logged_trans, BTRFS_I(inode)->logged_trans) - ctf_integer(u64, root_objectid, - BTRFS_I(inode)->root->root_key.objectid) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_new, - - TP_PROTO(const struct inode *inode), - - TP_ARGS(inode) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_request, - - TP_PROTO(const struct inode *inode), - - TP_ARGS(inode) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_evict, - - TP_PROTO(const struct inode *inode), - - TP_ARGS(inode) -) -#else -LTTNG_TRACEPOINT_EVENT(btrfs_transaction_commit, - - TP_PROTO(struct btrfs_root *root), - - TP_ARGS(root), - - TP_FIELDS( - ctf_integer(u64, generation, root->fs_info->generation) - ctf_integer(u64, root_objectid, root->root_key.objectid) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__inode, - - TP_PROTO(struct inode *inode), - - TP_ARGS(inode), - - TP_FIELDS( - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(blkcnt_t, blocks, inode->i_blocks) - ctf_integer(u64, disk_i_size, BTRFS_I(inode)->disk_i_size) - ctf_integer(u64, generation, BTRFS_I(inode)->generation) - ctf_integer(u64, last_trans, BTRFS_I(inode)->last_trans) - ctf_integer(u64, logged_trans, BTRFS_I(inode)->logged_trans) - ctf_integer(u64, root_objectid, - BTRFS_I(inode)->root->root_key.objectid) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_new, - - TP_PROTO(struct inode *inode), - - TP_ARGS(inode) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_request, - - TP_PROTO(struct inode *inode), - - TP_ARGS(inode) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_evict, - - TP_PROTO(struct inode *inode), - - TP_ARGS(inode) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) - -LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, - - TP_PROTO(const struct btrfs_root *root, const struct btrfs_inode *inode, - const struct extent_map *map), - - TP_ARGS(root, inode, map), - - TP_FIELDS( - ctf_integer(u64, root_objectid, root->root_key.objectid) - ctf_integer(u64, ino, btrfs_ino(inode)) - ctf_integer(u64, start, map->start) - ctf_integer(u64, len, map->len) - ctf_integer(u64, orig_start, map->orig_start) - ctf_integer(u64, block_start, map->block_start) - ctf_integer(u64, block_len, map->block_len) - ctf_integer(unsigned long, flags, map->flags) - ctf_integer(int, refs, refcount_read(&map->refs)) - ctf_integer(unsigned int, compress_type, map->compress_type) - ) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) - -LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, - - TP_PROTO(struct btrfs_root *root, struct btrfs_inode *inode, - struct extent_map *map), - - TP_ARGS(root, inode, map), - - TP_FIELDS( - ctf_integer(u64, root_objectid, root->root_key.objectid) - ctf_integer(u64, ino, btrfs_ino(inode)) - ctf_integer(u64, start, map->start) - ctf_integer(u64, len, map->len) - ctf_integer(u64, orig_start, map->orig_start) - ctf_integer(u64, block_start, map->block_start) - ctf_integer(u64, block_len, map->block_len) - ctf_integer(unsigned long, flags, map->flags) - ctf_integer(int, refs, refcount_read(&map->refs)) - ctf_integer(unsigned int, compress_type, map->compress_type) - ) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) - -LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, - - TP_PROTO(struct btrfs_root *root, struct btrfs_inode *inode, - struct extent_map *map), - - TP_ARGS(root, inode, map), - - TP_FIELDS( - ctf_integer(u64, root_objectid, root->root_key.objectid) - ctf_integer(u64, ino, btrfs_ino(inode)) - ctf_integer(u64, start, map->start) - ctf_integer(u64, len, map->len) - ctf_integer(u64, orig_start, map->orig_start) - ctf_integer(u64, block_start, map->block_start) - ctf_integer(u64, block_len, map->block_len) - ctf_integer(unsigned long, flags, map->flags) - ctf_integer(int, refs, atomic_read(&map->refs)) - ctf_integer(unsigned int, compress_type, map->compress_type) - ) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) - -LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, - - TP_PROTO(struct btrfs_root *root, struct inode *inode, - struct extent_map *map), - - TP_ARGS(root, inode, map), - - TP_FIELDS( - ctf_integer(u64, root_objectid, root->root_key.objectid) - ctf_integer(u64, ino, btrfs_ino(inode)) - ctf_integer(u64, start, map->start) - ctf_integer(u64, len, map->len) - ctf_integer(u64, orig_start, map->orig_start) - ctf_integer(u64, block_start, map->block_start) - ctf_integer(u64, block_len, map->block_len) - ctf_integer(unsigned long, flags, map->flags) - ctf_integer(int, refs, atomic_read(&map->refs)) - ctf_integer(unsigned int, compress_type, map->compress_type) - ) -) - -#elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) - -LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, - - TP_PROTO(const struct btrfs_root *root, const struct extent_map *map), - - TP_ARGS(root, map), - - TP_FIELDS( - ctf_integer(u64, root_objectid, root->root_key.objectid) - ctf_integer(u64, start, map->start) - ctf_integer(u64, len, map->len) - ctf_integer(u64, orig_start, map->orig_start) - ctf_integer(u64, block_start, map->block_start) - ctf_integer(u64, block_len, map->block_len) - ctf_integer(unsigned long, flags, map->flags) - ctf_integer(int, refs, atomic_read(&map->refs)) - ctf_integer(unsigned int, compress_type, map->compress_type) - ) -) - -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ - -LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, - - TP_PROTO(struct btrfs_root *root, struct extent_map *map), - - TP_ARGS(root, map), - - TP_FIELDS( - ctf_integer(u64, root_objectid, root->root_key.objectid) - ctf_integer(u64, start, map->start) - ctf_integer(u64, len, map->len) - ctf_integer(u64, orig_start, map->orig_start) - ctf_integer(u64, block_start, map->block_start) - ctf_integer(u64, block_len, map->block_len) - ctf_integer(unsigned long, flags, map->flags) - ctf_integer(int, refs, atomic_read(&map->refs)) - ctf_integer(unsigned int, compress_type, map->compress_type) - ) -) - -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) -LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist, - - TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct extent_map *existing, const struct extent_map *map, - u64 start, u64 len), - - TP_ARGS(fs_info, existing, map, start, len), - - TP_FIELDS( - ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, e_start, existing->start) - ctf_integer(u64, e_len, existing->len) - ctf_integer(u64, map_start, map->start) - ctf_integer(u64, map_len, map->len) - ctf_integer(u64, start, start) - ctf_integer(u64, len, len) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0)) -LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist, - - TP_PROTO(struct btrfs_fs_info *fs_info, - const struct extent_map *existing, const struct extent_map *map, - u64 start, u64 len), - - TP_ARGS(fs_info, existing, map, start, len), - - TP_FIELDS( - ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, e_start, existing->start) - ctf_integer(u64, e_len, existing->len) - ctf_integer(u64, map_start, map->start) - ctf_integer(u64, map_len, map->len) - ctf_integer(u64, start, start) - ctf_integer(u64, len, len) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) -LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist, - - TP_PROTO(const struct extent_map *existing, const struct extent_map *map, u64 start, u64 len), - - TP_ARGS(existing, map, start, len), - - TP_FIELDS( - ctf_integer(u64, e_start, existing->start) - ctf_integer(u64, e_len, existing->len) - ctf_integer(u64, map_start, map->start) - ctf_integer(u64, map_len, map->len) - ctf_integer(u64, start, start) - ctf_integer(u64, len, len) - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent, - - TP_PROTO(const struct inode *inode, - const struct btrfs_ordered_extent *ordered), - - TP_ARGS(inode, ordered), - - TP_FIELDS( - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(u64, file_offset, ordered->file_offset) - ctf_integer(u64, start, ordered->disk_bytenr) - ctf_integer(u64, len, ordered->num_bytes) - ctf_integer(u64, disk_len, ordered->disk_num_bytes) - ctf_integer(u64, bytes_left, ordered->bytes_left) - ctf_integer(unsigned long, flags, ordered->flags) - ctf_integer(int, compress_type, ordered->compress_type) - ctf_integer(int, refs, refcount_read(&ordered->refs)) - ctf_integer(u64, root_objectid, - BTRFS_I(inode)->root->root_key.objectid) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent, - - TP_PROTO(const struct inode *inode, - const struct btrfs_ordered_extent *ordered), - - TP_ARGS(inode, ordered), - - TP_FIELDS( - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(u64, file_offset, ordered->file_offset) - ctf_integer(u64, start, ordered->start) - ctf_integer(u64, len, ordered->len) - ctf_integer(u64, disk_len, ordered->disk_len) - ctf_integer(u64, bytes_left, ordered->bytes_left) - ctf_integer(unsigned long, flags, ordered->flags) - ctf_integer(int, compress_type, ordered->compress_type) - ctf_integer(int, refs, refcount_read(&ordered->refs)) - ctf_integer(u64, root_objectid, - BTRFS_I(inode)->root->root_key.objectid) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent, - - TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), - - TP_ARGS(inode, ordered), - - TP_FIELDS( - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(u64, file_offset, ordered->file_offset) - ctf_integer(u64, start, ordered->start) - ctf_integer(u64, len, ordered->len) - ctf_integer(u64, disk_len, ordered->disk_len) - ctf_integer(u64, bytes_left, ordered->bytes_left) - ctf_integer(unsigned long, flags, ordered->flags) - ctf_integer(int, compress_type, ordered->compress_type) - ctf_integer(int, refs, refcount_read(&ordered->refs)) - ctf_integer(u64, root_objectid, - BTRFS_I(inode)->root->root_key.objectid) - ) -) -#elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent, - - TP_PROTO(const struct inode *inode, const struct btrfs_ordered_extent *ordered), - - TP_ARGS(inode, ordered), - - TP_FIELDS( - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(u64, file_offset, ordered->file_offset) - ctf_integer(u64, start, ordered->start) - ctf_integer(u64, len, ordered->len) - ctf_integer(u64, disk_len, ordered->disk_len) - ctf_integer(u64, bytes_left, ordered->bytes_left) - ctf_integer(unsigned long, flags, ordered->flags) - ctf_integer(int, compress_type, ordered->compress_type) - ctf_integer(int, refs, atomic_read(&ordered->refs)) - ctf_integer(u64, root_objectid, - BTRFS_I(inode)->root->root_key.objectid) - ) -) -#else -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent, - - TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), - - TP_ARGS(inode, ordered), - - TP_FIELDS( - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(u64, file_offset, ordered->file_offset) - ctf_integer(u64, start, ordered->start) - ctf_integer(u64, len, ordered->len) - ctf_integer(u64, disk_len, ordered->disk_len) - ctf_integer(u64, bytes_left, ordered->bytes_left) - ctf_integer(unsigned long, flags, ordered->flags) - ctf_integer(int, compress_type, ordered->compress_type) - ctf_integer(int, refs, atomic_read(&ordered->refs)) - ctf_integer(u64, root_objectid, - BTRFS_I(inode)->root->root_key.objectid) - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add, - - TP_PROTO(const struct inode *inode, - const struct btrfs_ordered_extent *ordered), - - TP_ARGS(inode, ordered) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_remove, - - TP_PROTO(const struct inode *inode, - const struct btrfs_ordered_extent *ordered), - - TP_ARGS(inode, ordered) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_start, - - TP_PROTO(const struct inode *inode, - const struct btrfs_ordered_extent *ordered), - - TP_ARGS(inode, ordered) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put, - - TP_PROTO(const struct inode *inode, - const struct btrfs_ordered_extent *ordered), - - TP_ARGS(inode, ordered) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage, - - TP_PROTO(const struct page *page, const struct inode *inode, - const struct writeback_control *wbc), - - TP_ARGS(page, inode, wbc), - - TP_FIELDS( - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(pgoff_t, index, page->index) - ctf_integer(long, nr_to_write, wbc->nr_to_write) - ctf_integer(long, pages_skipped, wbc->pages_skipped) - ctf_integer(loff_t, range_start, wbc->range_start) - ctf_integer(loff_t, range_end, wbc->range_end) - ctf_integer(char, for_kupdate, wbc->for_kupdate) - ctf_integer(char, for_reclaim, wbc->for_reclaim) - ctf_integer(char, range_cyclic, wbc->range_cyclic) - ctf_integer(pgoff_t, writeback_index, - inode->i_mapping->writeback_index) - ctf_integer(u64, root_objectid, - BTRFS_I(inode)->root->root_key.objectid) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs__writepage, - - __extent_writepage, - - btrfs__extent_writepage, - - TP_PROTO(const struct page *page, const struct inode *inode, - const struct writeback_control *wbc), - - TP_ARGS(page, inode, wbc) -) - -LTTNG_TRACEPOINT_EVENT(btrfs_writepage_end_io_hook, - - TP_PROTO(const struct page *page, u64 start, u64 end, int uptodate), - - TP_ARGS(page, start, end, uptodate), - - TP_FIELDS( - ctf_integer(ino_t, ino, page->mapping->host->i_ino) - ctf_integer(pgoff_t, index, page->index) - ctf_integer(u64, start, start) - ctf_integer(u64, end, end) - ctf_integer(int, uptodate, uptodate) - ctf_integer(u64, root_objectid, - BTRFS_I(page->mapping->host)->root->root_key.objectid) - ) -) - -LTTNG_TRACEPOINT_EVENT(btrfs_sync_file, - - TP_PROTO(const struct file *file, int datasync), - - TP_ARGS(file, datasync), - - TP_FIELDS( - ctf_integer(ino_t, ino, file->f_path.dentry->d_inode->i_ino) - ctf_integer(ino_t, parent, file->f_path.dentry->d_parent->d_inode->i_ino) - ctf_integer(int, datasync, datasync) - ctf_integer(u64, root_objectid, - BTRFS_I(file->f_path.dentry->d_inode)->root->root_key.objectid) - ) -) -#else -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add, - - TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), - - TP_ARGS(inode, ordered) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_remove, - - TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), - - TP_ARGS(inode, ordered) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_start, - - TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), - - TP_ARGS(inode, ordered) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put, - - TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered), - - TP_ARGS(inode, ordered) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage, - - TP_PROTO(struct page *page, struct inode *inode, - struct writeback_control *wbc), - - TP_ARGS(page, inode, wbc), - - TP_FIELDS( - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(pgoff_t, index, page->index) - ctf_integer(long, nr_to_write, wbc->nr_to_write) - ctf_integer(long, pages_skipped, wbc->pages_skipped) - ctf_integer(loff_t, range_start, wbc->range_start) - ctf_integer(loff_t, range_end, wbc->range_end) -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)) - ctf_integer(char, nonblocking, wbc->nonblocking) -#endif - ctf_integer(char, for_kupdate, wbc->for_kupdate) - ctf_integer(char, for_reclaim, wbc->for_reclaim) - ctf_integer(char, range_cyclic, wbc->range_cyclic) - ctf_integer(pgoff_t, writeback_index, - inode->i_mapping->writeback_index) - ctf_integer(u64, root_objectid, - BTRFS_I(inode)->root->root_key.objectid) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs__writepage, - - __extent_writepage, - - btrfs__extent_writepage, - - TP_PROTO(struct page *page, struct inode *inode, - struct writeback_control *wbc), - - TP_ARGS(page, inode, wbc) -) - -LTTNG_TRACEPOINT_EVENT(btrfs_writepage_end_io_hook, - - TP_PROTO(struct page *page, u64 start, u64 end, int uptodate), - - TP_ARGS(page, start, end, uptodate), - - TP_FIELDS( - ctf_integer(ino_t, ino, page->mapping->host->i_ino) - ctf_integer(pgoff_t, index, page->index) - ctf_integer(u64, start, start) - ctf_integer(u64, end, end) - ctf_integer(int, uptodate, uptodate) - ctf_integer(u64, root_objectid, - BTRFS_I(page->mapping->host)->root->root_key.objectid) - ) -) - -LTTNG_TRACEPOINT_EVENT(btrfs_sync_file, - - TP_PROTO(struct file *file, int datasync), - - TP_ARGS(file, datasync), - - TP_FIELDS( - ctf_integer(ino_t, ino, file->f_path.dentry->d_inode->i_ino) - ctf_integer(ino_t, parent, file->f_path.dentry->d_parent->d_inode->i_ino) - ctf_integer(int, datasync, datasync) - ctf_integer(u64, root_objectid, - BTRFS_I(file->f_path.dentry->d_inode)->root->root_key.objectid) - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,103,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,114,94,0,0, 4,4,114,95,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,120,94,0,0, 4,4,120,95,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,126,94,0,0, 4,5,0,0,0,0)) -LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs, - - TP_PROTO(const struct btrfs_fs_info *fs_info, int wait), - - TP_ARGS(fs_info, wait), - - TP_FIELDS( - ctf_integer(int, wait, wait) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) -LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs, - - TP_PROTO(struct btrfs_fs_info *fs_info, int wait), - - TP_ARGS(fs_info, wait), - - TP_FIELDS( - ctf_integer(int, wait, wait) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs, - - TP_PROTO(int wait), - - TP_ARGS(wait), - - TP_FIELDS( - ctf_integer(int, wait, wait) - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) -LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group, - - TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_block_group *block_group, int create), - - TP_ARGS(fs_info, block_group, create), - - TP_FIELDS( - ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, offset, block_group->start) - ctf_integer(u64, size, block_group->length) - ctf_integer(u64, flags, block_group->flags) - ctf_integer(u64, bytes_used, block_group->used) - ctf_integer(u64, bytes_super, block_group->bytes_super) - ctf_integer(int, create, create) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) -LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group, - - TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_block_group_cache *block_group, int create), - - TP_ARGS(fs_info, block_group, create), - - TP_FIELDS( - ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, offset, block_group->key.objectid) - ctf_integer(u64, size, block_group->key.offset) - ctf_integer(u64, flags, block_group->flags) - ctf_integer(u64, bytes_used, btrfs_block_group_used(&block_group->item)) - ctf_integer(u64, bytes_super, block_group->bytes_super) - ctf_integer(int, create, create) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group, - - TP_PROTO(struct btrfs_fs_info *fs_info, - struct btrfs_block_group_cache *block_group, int create), - - TP_ARGS(fs_info, block_group, create), - - TP_FIELDS( - ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, offset, block_group->key.objectid) - ctf_integer(u64, size, block_group->key.offset) - ctf_integer(u64, flags, block_group->flags) - ctf_integer(u64, bytes_used, btrfs_block_group_used(&block_group->item)) - ctf_integer(u64, bytes_super, block_group->bytes_super) - ctf_integer(int, create, create) - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,103,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,114,94,0,0, 4,4,114,95,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,120,94,0,0, 4,4,120,95,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,126,94,0,0, 4,5,0,0,0,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref, - - TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_tree_ref *full_ref, - int action), - - TP_ARGS(fs_info, ref, full_ref, action), - - TP_FIELDS( - ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, bytenr, ref->bytenr) - ctf_integer(u64, num_bytes, ref->num_bytes) - ctf_integer(int, action, action) - ctf_integer(u64, parent, full_ref->parent) - ctf_integer(u64, ref_root, full_ref->root) - ctf_integer(int, level, full_ref->level) - ctf_integer(int, type, ref->type) - ctf_integer(u64, seq, ref->seq) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, - - add_delayed_tree_ref, - - btrfs_add_delayed_tree_ref, - - TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_tree_ref *full_ref, - int action), - - TP_ARGS(fs_info, ref, full_ref, action) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, - - run_delayed_tree_ref, - - btrfs_run_delayed_tree_ref, - - TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_tree_ref *full_ref, - int action), - - TP_ARGS(fs_info, ref, full_ref, action) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref, - - TP_PROTO(struct btrfs_fs_info *fs_info, - struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_tree_ref *full_ref, - int action), - - TP_ARGS(fs_info, ref, full_ref, action), - - TP_FIELDS( - ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, bytenr, ref->bytenr) - ctf_integer(u64, num_bytes, ref->num_bytes) - ctf_integer(int, action, action) - ctf_integer(u64, parent, full_ref->parent) - ctf_integer(u64, ref_root, full_ref->root) - ctf_integer(int, level, full_ref->level) - ctf_integer(int, type, ref->type) - ctf_integer(u64, seq, ref->seq) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, - - add_delayed_tree_ref, - - btrfs_add_delayed_tree_ref, - - TP_PROTO(struct btrfs_fs_info *fs_info, - struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_tree_ref *full_ref, - int action), - - TP_ARGS(fs_info, ref, full_ref, action) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, - - run_delayed_tree_ref, - - btrfs_run_delayed_tree_ref, - - TP_PROTO(struct btrfs_fs_info *fs_info, - struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_tree_ref *full_ref, - int action), - - TP_ARGS(fs_info, ref, full_ref, action) -) -#elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,92,0,0, 4,5,0,0,0,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref, - - TP_PROTO(const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_tree_ref *full_ref, - int action), - - TP_ARGS(ref, full_ref, action), - - TP_FIELDS( - ctf_integer(u64, bytenr, ref->bytenr) - ctf_integer(u64, num_bytes, ref->num_bytes) - ctf_integer(int, action, action) - ctf_integer(u64, parent, full_ref->parent) - ctf_integer(u64, ref_root, full_ref->root) - ctf_integer(int, level, full_ref->level) - ctf_integer(int, type, ref->type) - ctf_integer(u64, seq, ref->seq) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, - - add_delayed_tree_ref, - - btrfs_add_delayed_tree_ref, - - TP_PROTO(const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_tree_ref *full_ref, - int action), - - TP_ARGS(ref, full_ref, action) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, - - run_delayed_tree_ref, - - btrfs_run_delayed_tree_ref, - - TP_PROTO(const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_tree_ref *full_ref, - int action), - - TP_ARGS(ref, full_ref, action) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref, - - TP_PROTO(struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_tree_ref *full_ref, - int action), - - TP_ARGS(ref, full_ref, action), - - TP_FIELDS( - ctf_integer(u64, bytenr, ref->bytenr) - ctf_integer(u64, num_bytes, ref->num_bytes) - ctf_integer(int, action, action) - ctf_integer(u64, parent, full_ref->parent) - ctf_integer(u64, ref_root, full_ref->root) - ctf_integer(int, level, full_ref->level) - ctf_integer(int, type, ref->type) - ctf_integer(u64, seq, ref->seq) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, - - add_delayed_tree_ref, - - btrfs_add_delayed_tree_ref, - - TP_PROTO(struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_tree_ref *full_ref, - int action), - - TP_ARGS(ref, full_ref, action) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref, - - run_delayed_tree_ref, - - btrfs_run_delayed_tree_ref, - - TP_PROTO(struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_tree_ref *full_ref, - int action), - - TP_ARGS(ref, full_ref, action) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)) -LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref, - - TP_PROTO(struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_tree_ref *full_ref, - int action), - - TP_ARGS(ref, full_ref, action), - - TP_FIELDS( - ctf_integer(u64, bytenr, ref->bytenr) - ctf_integer(u64, num_bytes, ref->num_bytes) - ctf_integer(int, action, action) - ctf_integer(u64, parent, full_ref->parent) - ctf_integer(u64, ref_root, full_ref->root) - ctf_integer(int, level, full_ref->level) - ctf_integer(int, type, ref->type) - ctf_integer(u64, seq, ref->seq) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref, - - TP_PROTO(struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_tree_ref *full_ref, - int action), - - TP_ARGS(ref, full_ref, action), - - TP_FIELDS( - ctf_integer(u64, bytenr, ref->bytenr) - ctf_integer(u64, num_bytes, ref->num_bytes) - ctf_integer(int, action, action) - ctf_integer(u64, parent, full_ref->parent) - ctf_integer(u64, ref_root, full_ref->root) - ctf_integer(int, level, full_ref->level) - ctf_integer(int, type, ref->type) - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,103,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,114,94,0,0, 4,4,114,95,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,120,94,0,0, 4,4,120,95,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,126,94,0,0, 4,5,0,0,0,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref, - - TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_data_ref *full_ref, - int action), - - TP_ARGS(fs_info, ref, full_ref, action), - - TP_FIELDS( - ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, bytenr, ref->bytenr) - ctf_integer(u64, num_bytes, ref->num_bytes) - ctf_integer(int, action, action) - ctf_integer(u64, parent, full_ref->parent) - ctf_integer(u64, ref_root, full_ref->root) - ctf_integer(u64, owner, full_ref->objectid) - ctf_integer(u64, offset, full_ref->offset) - ctf_integer(int, type, ref->type) - ctf_integer(u64, seq, ref->seq) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, - - add_delayed_data_ref, - - btrfs_add_delayed_data_ref, - - TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_data_ref *full_ref, - int action), - - TP_ARGS(fs_info, ref, full_ref, action) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, - - run_delayed_data_ref, - - btrfs_run_delayed_data_ref, - - TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_data_ref *full_ref, - int action), - - TP_ARGS(fs_info, ref, full_ref, action) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref, - - TP_PROTO(struct btrfs_fs_info *fs_info, - struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_data_ref *full_ref, - int action), - - TP_ARGS(fs_info, ref, full_ref, action), - - TP_FIELDS( - ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, bytenr, ref->bytenr) - ctf_integer(u64, num_bytes, ref->num_bytes) - ctf_integer(int, action, action) - ctf_integer(u64, parent, full_ref->parent) - ctf_integer(u64, ref_root, full_ref->root) - ctf_integer(u64, owner, full_ref->objectid) - ctf_integer(u64, offset, full_ref->offset) - ctf_integer(int, type, ref->type) - ctf_integer(u64, seq, ref->seq) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, - - add_delayed_data_ref, - - btrfs_add_delayed_data_ref, - - TP_PROTO(struct btrfs_fs_info *fs_info, - struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_data_ref *full_ref, - int action), - - TP_ARGS(fs_info, ref, full_ref, action) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, - - run_delayed_data_ref, - - btrfs_run_delayed_data_ref, - - TP_PROTO(struct btrfs_fs_info *fs_info, - struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_data_ref *full_ref, - int action), - - TP_ARGS(fs_info, ref, full_ref, action) -) -#elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,92,0,0, 4,5,0,0,0,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref, - - TP_PROTO(const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_data_ref *full_ref, - int action), - - TP_ARGS(ref, full_ref, action), - - TP_FIELDS( - ctf_integer(u64, bytenr, ref->bytenr) - ctf_integer(u64, num_bytes, ref->num_bytes) - ctf_integer(int, action, action) - ctf_integer(u64, parent, full_ref->parent) - ctf_integer(u64, ref_root, full_ref->root) - ctf_integer(u64, owner, full_ref->objectid) - ctf_integer(u64, offset, full_ref->offset) - ctf_integer(int, type, ref->type) - ctf_integer(u64, seq, ref->seq) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, - - add_delayed_data_ref, - - btrfs_add_delayed_data_ref, - - TP_PROTO(const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_data_ref *full_ref, - int action), - - TP_ARGS(fs_info, ref, full_ref, action) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, - - run_delayed_data_ref, - - btrfs_run_delayed_data_ref, - - TP_PROTO(const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_data_ref *full_ref, - int action), - - TP_ARGS(fs_info, ref, full_ref, action) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref, - - TP_PROTO(struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_data_ref *full_ref, - int action), - - TP_ARGS(ref, full_ref, action), - - TP_FIELDS( - ctf_integer(u64, bytenr, ref->bytenr) - ctf_integer(u64, num_bytes, ref->num_bytes) - ctf_integer(int, action, action) - ctf_integer(u64, parent, full_ref->parent) - ctf_integer(u64, ref_root, full_ref->root) - ctf_integer(u64, owner, full_ref->objectid) - ctf_integer(u64, offset, full_ref->offset) - ctf_integer(int, type, ref->type) - ctf_integer(u64, seq, ref->seq) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, - - add_delayed_data_ref, - - btrfs_add_delayed_data_ref, - - TP_PROTO(struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_data_ref *full_ref, - int action), - - TP_ARGS(fs_info, ref, full_ref, action) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref, - - run_delayed_data_ref, - - btrfs_run_delayed_data_ref, - - TP_PROTO(struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_data_ref *full_ref, - int action), - - TP_ARGS(fs_info, ref, full_ref, action) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)) -LTTNG_TRACEPOINT_EVENT(btrfs_delayed_data_ref, - - TP_PROTO(struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_data_ref *full_ref, - int action), - - TP_ARGS(ref, full_ref, action), - - TP_FIELDS( - ctf_integer(u64, bytenr, ref->bytenr) - ctf_integer(u64, num_bytes, ref->num_bytes) - ctf_integer(int, action, action) - ctf_integer(u64, parent, full_ref->parent) - ctf_integer(u64, ref_root, full_ref->root) - ctf_integer(u64, owner, full_ref->objectid) - ctf_integer(u64, offset, full_ref->offset) - ctf_integer(int, type, ref->type) - ctf_integer(u64, seq, ref->seq) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(btrfs_delayed_data_ref, - - TP_PROTO(struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_data_ref *full_ref, - int action), - - TP_ARGS(ref, full_ref, action), - - TP_FIELDS( - ctf_integer(u64, bytenr, ref->bytenr) - ctf_integer(u64, num_bytes, ref->num_bytes) - ctf_integer(int, action, action) - ctf_integer(u64, parent, full_ref->parent) - ctf_integer(u64, ref_root, full_ref->root) - ctf_integer(u64, owner, full_ref->objectid) - ctf_integer(u64, offset, full_ref->offset) - ctf_integer(int, type, ref->type) - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, - - TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_delayed_ref_head *head_ref, - int action), - - TP_ARGS(fs_info, head_ref, action), - - TP_FIELDS( - ctf_integer(u64, bytenr, head_ref->bytenr) - ctf_integer(u64, num_bytes, head_ref->num_bytes) - ctf_integer(int, action, action) - ctf_integer(int, is_data, head_ref->is_data) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, - - add_delayed_ref_head, - - btrfs_add_delayed_ref_head, - - TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_delayed_ref_head *head_ref, - int action), - - TP_ARGS(fs_info, head_ref, action) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, - - run_delayed_ref_head, - - btrfs_run_delayed_ref_head, - - TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_delayed_ref_head *head_ref, - int action), - - TP_ARGS(fs_info, head_ref, action) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,103,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,114,94,0,0, 4,4,114,95,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,120,94,0,0, 4,4,120,95,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,126,94,0,0, 4,5,0,0,0,0)) - -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, - - TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_ref_head *head_ref, - int action), - - TP_ARGS(fs_info, ref, head_ref, action), - - TP_FIELDS( - ctf_integer(u64, bytenr, ref->bytenr) - ctf_integer(u64, num_bytes, ref->num_bytes) - ctf_integer(int, action, action) - ctf_integer(int, is_data, head_ref->is_data) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, - - add_delayed_ref_head, - - btrfs_add_delayed_ref_head, - - TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_ref_head *head_ref, - int action), - - TP_ARGS(fs_info, ref, head_ref, action) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, - - run_delayed_ref_head, - - btrfs_run_delayed_ref_head, - - TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_ref_head *head_ref, - int action), - - TP_ARGS(fs_info, ref, head_ref, action) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, - - TP_PROTO(struct btrfs_fs_info *fs_info, - struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_ref_head *head_ref, - int action), - - TP_ARGS(fs_info, ref, head_ref, action), - - TP_FIELDS( - ctf_integer(u64, bytenr, ref->bytenr) - ctf_integer(u64, num_bytes, ref->num_bytes) - ctf_integer(int, action, action) - ctf_integer(int, is_data, head_ref->is_data) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, - - add_delayed_ref_head, - - btrfs_add_delayed_ref_head, - - TP_PROTO(struct btrfs_fs_info *fs_info, - struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_ref_head *head_ref, - int action), - - TP_ARGS(fs_info, ref, head_ref, action) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, - - run_delayed_ref_head, - - btrfs_run_delayed_ref_head, - - TP_PROTO(struct btrfs_fs_info *fs_info, - struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_ref_head *head_ref, - int action), - - TP_ARGS(fs_info, ref, head_ref, action) -) - -#elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,92,0,0, 4,5,0,0,0,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, - - TP_PROTO(const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_ref_head *head_ref, - int action), - - TP_ARGS(ref, head_ref, action), - - TP_FIELDS( - ctf_integer(u64, bytenr, ref->bytenr) - ctf_integer(u64, num_bytes, ref->num_bytes) - ctf_integer(int, action, action) - ctf_integer(int, is_data, head_ref->is_data) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, - - add_delayed_ref_head, - - btrfs_add_delayed_ref_head, - - TP_PROTO(const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_ref_head *head_ref, - int action), - - TP_ARGS(ref, head_ref, action) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, - - run_delayed_ref_head, - - btrfs_run_delayed_ref_head, - - TP_PROTO(const struct btrfs_delayed_ref_node *ref, - const struct btrfs_delayed_ref_head *head_ref, - int action), - - TP_ARGS(ref, head_ref, action) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head, - - TP_PROTO(struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_ref_head *head_ref, - int action), - - TP_ARGS(ref, head_ref, action), - - TP_FIELDS( - ctf_integer(u64, bytenr, ref->bytenr) - ctf_integer(u64, num_bytes, ref->num_bytes) - ctf_integer(int, action, action) - ctf_integer(int, is_data, head_ref->is_data) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, - - add_delayed_ref_head, - - btrfs_add_delayed_ref_head, - - TP_PROTO(struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_ref_head *head_ref, - int action), - - TP_ARGS(ref, head_ref, action) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head, - - run_delayed_ref_head, - - btrfs_run_delayed_ref_head, - - TP_PROTO(struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_ref_head *head_ref, - int action), - - TP_ARGS(ref, head_ref, action) -) - -#else -LTTNG_TRACEPOINT_EVENT(btrfs_delayed_ref_head, - - TP_PROTO(struct btrfs_delayed_ref_node *ref, - struct btrfs_delayed_ref_head *head_ref, - int action), - - TP_ARGS(ref, head_ref, action), - - TP_FIELDS( - ctf_integer(u64, bytenr, ref->bytenr) - ctf_integer(u64, num_bytes, ref->num_bytes) - ctf_integer(int, action, action) - ctf_integer(int, is_data, head_ref->is_data) - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) - -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk, - - TP_PROTO(const struct btrfs_fs_info *fs_info, const struct map_lookup *map, - u64 offset, u64 size), - - TP_ARGS(fs_info, map, offset, size), - - TP_FIELDS( - ctf_integer(int, num_stripes, map->num_stripes) - ctf_integer(u64, type, map->type) - ctf_integer(int, sub_stripes, map->sub_stripes) - ctf_integer(u64, offset, offset) - ctf_integer(u64, size, size) - ctf_integer(u64, root_objectid, fs_info->chunk_root->root_key.objectid) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc, - - TP_PROTO(const struct btrfs_fs_info *fs_info, const struct map_lookup *map, - u64 offset, u64 size), - - TP_ARGS(fs_info, map, offset, size) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free, - - TP_PROTO(const struct btrfs_fs_info *fs_info, const struct map_lookup *map, - u64 offset, u64 size), - - TP_ARGS(fs_info, map, offset, size) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) - -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk, - - TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map, - u64 offset, u64 size), - - TP_ARGS(fs_info, map, offset, size), - - TP_FIELDS( - ctf_integer(int, num_stripes, map->num_stripes) - ctf_integer(u64, type, map->type) - ctf_integer(int, sub_stripes, map->sub_stripes) - ctf_integer(u64, offset, offset) - ctf_integer(u64, size, size) - ctf_integer(u64, root_objectid, fs_info->chunk_root->root_key.objectid) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc, - - TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map, - u64 offset, u64 size), - - TP_ARGS(fs_info, map, offset, size) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free, - - TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map, - u64 offset, u64 size), - - TP_ARGS(fs_info, map, offset, size) -) - -#elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) - -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk, - - TP_PROTO(const struct btrfs_root *root, const struct map_lookup *map, - u64 offset, u64 size), - - TP_ARGS(root, map, offset, size), - - TP_FIELDS( - ctf_integer(int, num_stripes, map->num_stripes) - ctf_integer(u64, type, map->type) - ctf_integer(int, sub_stripes, map->sub_stripes) - ctf_integer(u64, offset, offset) - ctf_integer(u64, size, size) - ctf_integer(u64, root_objectid, root->root_key.objectid) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc, - - TP_PROTO(const struct btrfs_root *root, const struct map_lookup *map, - u64 offset, u64 size), - - TP_ARGS(root, map, offset, size) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free, - - TP_PROTO(const struct btrfs_root *root, const struct map_lookup *map, - u64 offset, u64 size), - - TP_ARGS(root, map, offset, size) -) - -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ - -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk, - - TP_PROTO(struct btrfs_root *root, struct map_lookup *map, - u64 offset, u64 size), - - TP_ARGS(root, map, offset, size), - - TP_FIELDS( - ctf_integer(int, num_stripes, map->num_stripes) - ctf_integer(u64, type, map->type) - ctf_integer(int, sub_stripes, map->sub_stripes) - ctf_integer(u64, offset, offset) - ctf_integer(u64, size, size) - ctf_integer(u64, root_objectid, root->root_key.objectid) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc, - - TP_PROTO(struct btrfs_root *root, struct map_lookup *map, - u64 offset, u64 size), - - TP_ARGS(root, map, offset, size) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free, - - TP_PROTO(struct btrfs_root *root, struct map_lookup *map, - u64 offset, u64 size), - - TP_ARGS(root, map, offset, size) -) - -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) -LTTNG_TRACEPOINT_EVENT(btrfs_cow_block, - - TP_PROTO(const struct btrfs_root *root, const struct extent_buffer *buf, - const struct extent_buffer *cow), - - TP_ARGS(root, buf, cow), - - TP_FIELDS( - ctf_integer(u64, root_objectid, root->root_key.objectid) - ctf_integer(u64, buf_start, buf->start) - ctf_integer(int, refs, atomic_read(&buf->refs)) - ctf_integer(u64, cow_start, cow->start) - ctf_integer(int, buf_level, btrfs_header_level(buf)) - ctf_integer(int, cow_level, btrfs_header_level(cow)) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(btrfs_cow_block, - - TP_PROTO(struct btrfs_root *root, struct extent_buffer *buf, - struct extent_buffer *cow), - - TP_ARGS(root, buf, cow), - - TP_FIELDS( - ctf_integer(u64, root_objectid, root->root_key.objectid) - ctf_integer(u64, buf_start, buf->start) - ctf_integer(int, refs, atomic_read(&buf->refs)) - ctf_integer(u64, cow_start, cow->start) - ctf_integer(int, buf_level, btrfs_header_level(buf)) - ctf_integer(int, cow_level, btrfs_header_level(cow)) - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) -LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation, - - TP_PROTO(const struct btrfs_fs_info *fs_info, const char *type, u64 val, - u64 bytes, int reserve), - - TP_ARGS(fs_info, type, val, bytes, reserve), - - TP_FIELDS( - ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_string(type, type) - ctf_integer(u64, val, val) - ctf_integer(u64, bytes, bytes) - ctf_integer(int, reserve, reserve) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) -LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation, - - TP_PROTO(const struct btrfs_fs_info *fs_info, char *type, u64 val, - u64 bytes, int reserve), - - TP_ARGS(fs_info, type, val, bytes, reserve), - - TP_FIELDS( - ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_string(type, type) - ctf_integer(u64, val, val) - ctf_integer(u64, bytes, bytes) - ctf_integer(int, reserve, reserve) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) -LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation, - - TP_PROTO(struct btrfs_fs_info *fs_info, char *type, u64 val, - u64 bytes, int reserve), - - TP_ARGS(fs_info, type, val, bytes, reserve), - - TP_FIELDS( - ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_string(type, type) - ctf_integer(u64, val, val) - ctf_integer(u64, bytes, bytes) - ctf_integer(int, reserve, reserve) - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) - -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, - - TP_PROTO(const struct btrfs_fs_info *fs_info, u64 start, u64 len), - - TP_ARGS(fs_info, start, len), - - TP_FIELDS( - ctf_integer(u64, start, start) - ctf_integer(u64, len, len) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc, - - TP_PROTO(const struct btrfs_fs_info *fs_info, u64 start, u64 len), - - TP_ARGS(fs_info, start, len) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free, - - TP_PROTO(const struct btrfs_fs_info *fs_info, u64 start, u64 len), - - TP_ARGS(fs_info, start, len) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) - -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, - - TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len), - - TP_ARGS(fs_info, start, len), - - TP_FIELDS( - ctf_integer(u64, start, start) - ctf_integer(u64, len, len) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc, - - TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len), - - TP_ARGS(fs_info, start, len) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free, - - TP_PROTO(struct btrfs_fs_info *fs_info, u64 start, u64 len), - - TP_ARGS(fs_info, start, len) -) - -#elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) - -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, - - TP_PROTO(const struct btrfs_root *root, u64 start, u64 len), - - TP_ARGS(root, start, len), - - TP_FIELDS( - ctf_integer(u64, root_objectid, root->root_key.objectid) - ctf_integer(u64, start, start) - ctf_integer(u64, len, len) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc, - - TP_PROTO(const struct btrfs_root *root, u64 start, u64 len), - - TP_ARGS(root, start, len) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free, - - TP_PROTO(const struct btrfs_root *root, u64 start, u64 len), - - TP_ARGS(root, start, len) -) - -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ - -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent, - - TP_PROTO(struct btrfs_root *root, u64 start, u64 len), - - TP_ARGS(root, start, len), - - TP_FIELDS( - ctf_integer(u64, root_objectid, root->root_key.objectid) - ctf_integer(u64, start, start) - ctf_integer(u64, len, len) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc, - - TP_PROTO(struct btrfs_root *root, u64 start, u64 len), - - TP_ARGS(root, start, len) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free, - - TP_PROTO(struct btrfs_root *root, u64 start, u64 len), - - TP_ARGS(root, start, len) -) - -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) -LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, - - btrfs_find_free_extent, - - TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size, - u64 data), - - TP_ARGS(fs_info, num_bytes, empty_size, data), - - TP_FIELDS( - ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, num_bytes, num_bytes) - ctf_integer(u64, empty_size, empty_size) - ctf_integer(u64, data, data) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, - - TP_PROTO(const struct btrfs_block_group *block_group, u64 start, - u64 len), - - TP_ARGS(block_group, start, len), - - TP_FIELDS( - ctf_array(u8, fsid, block_group->lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, bg_objectid, block_group->start) - ctf_integer(u64, flags, block_group->flags) - ctf_integer(u64, start, start) - ctf_integer(u64, len, len) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, - - TP_PROTO(const struct btrfs_block_group *block_group, u64 start, - u64 len), - - TP_ARGS(block_group, start, len) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, - - TP_PROTO(const struct btrfs_block_group *block_group, u64 start, - u64 len), - - TP_ARGS(block_group, start, len) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0)) -LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, - - btrfs_find_free_extent, - - TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size, - u64 data), - - TP_ARGS(fs_info, num_bytes, empty_size, data), - - TP_FIELDS( - ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, num_bytes, num_bytes) - ctf_integer(u64, empty_size, empty_size) - ctf_integer(u64, data, data) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, - - TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start, - u64 len), - - TP_ARGS(block_group, start, len), - - TP_FIELDS( - ctf_array(u8, fsid, block_group->lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, bg_objectid, block_group->key.objectid) - ctf_integer(u64, flags, block_group->flags) - ctf_integer(u64, start, start) - ctf_integer(u64, len, len) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, - - TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start, - u64 len), - - TP_ARGS(block_group, start, len) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, - - TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start, - u64 len), - - TP_ARGS(block_group, start, len) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) -LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, - - btrfs_find_free_extent, - - TP_PROTO(const struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size, - u64 data), - - TP_ARGS(fs_info, num_bytes, empty_size, data), - - TP_FIELDS( - ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, num_bytes, num_bytes) - ctf_integer(u64, empty_size, empty_size) - ctf_integer(u64, data, data) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, - - TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_block_group_cache *block_group, u64 start, - u64 len), - - TP_ARGS(fs_info, block_group, start, len), - - TP_FIELDS( - ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, bg_objectid, block_group->key.objectid) - ctf_integer(u64, flags, block_group->flags) - ctf_integer(u64, start, start) - ctf_integer(u64, len, len) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, - - TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_block_group_cache *block_group, u64 start, - u64 len), - - TP_ARGS(fs_info, block_group, start, len) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, - - TP_PROTO(const struct btrfs_fs_info *fs_info, - const struct btrfs_block_group_cache *block_group, u64 start, - u64 len), - - TP_ARGS(fs_info, block_group, start, len) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) - -LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, - - btrfs_find_free_extent, - - TP_PROTO(struct btrfs_fs_info *fs_info, u64 num_bytes, u64 empty_size, - u64 data), - - TP_ARGS(fs_info, num_bytes, empty_size, data), - - TP_FIELDS( - ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE) - ctf_integer(u64, num_bytes, num_bytes) - ctf_integer(u64, empty_size, empty_size) - ctf_integer(u64, data, data) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, - - TP_PROTO(struct btrfs_fs_info *fs_info, - struct btrfs_block_group_cache *block_group, u64 start, - u64 len), - - TP_ARGS(fs_info, block_group, start, len), - - TP_FIELDS( - ctf_integer(u64, bg_objectid, block_group->key.objectid) - ctf_integer(u64, flags, block_group->flags) - ctf_integer(u64, start, start) - ctf_integer(u64, len, len) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, - - TP_PROTO(struct btrfs_fs_info *fs_info, - struct btrfs_block_group_cache *block_group, u64 start, - u64 len), - - TP_ARGS(fs_info, block_group, start, len) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, - - TP_PROTO(struct btrfs_fs_info *fs_info, - struct btrfs_block_group_cache *block_group, u64 start, - u64 len), - - TP_ARGS(fs_info, block_group, start, len) -) -#elif (LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) - -LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, - - btrfs_find_free_extent, - - TP_PROTO(const struct btrfs_root *root, u64 num_bytes, u64 empty_size, - u64 data), - - TP_ARGS(root, num_bytes, empty_size, data), - - TP_FIELDS( - ctf_integer(u64, root_objectid, root->root_key.objectid) - ctf_integer(u64, num_bytes, num_bytes) - ctf_integer(u64, empty_size, empty_size) - ctf_integer(u64, data, data) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, - - TP_PROTO(const struct btrfs_root *root, - const struct btrfs_block_group_cache *block_group, u64 start, - u64 len), - - TP_ARGS(root, block_group, start, len), - - TP_FIELDS( - ctf_integer(u64, root_objectid, root->root_key.objectid) - ctf_integer(u64, bg_objectid, block_group->key.objectid) - ctf_integer(u64, flags, block_group->flags) - ctf_integer(u64, start, start) - ctf_integer(u64, len, len) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, - - TP_PROTO(const struct btrfs_root *root, - const struct btrfs_block_group_cache *block_group, u64 start, - u64 len), - - TP_ARGS(root, block_group, start, len) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, - - TP_PROTO(const struct btrfs_root *root, - const struct btrfs_block_group_cache *block_group, u64 start, - u64 len), - - TP_ARGS(root, block_group, start, len) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) - -LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent, - - btrfs_find_free_extent, - - TP_PROTO(struct btrfs_root *root, u64 num_bytes, u64 empty_size, - u64 data), - - TP_ARGS(root, num_bytes, empty_size, data), - - TP_FIELDS( - ctf_integer(u64, root_objectid, root->root_key.objectid) - ctf_integer(u64, num_bytes, num_bytes) - ctf_integer(u64, empty_size, empty_size) - ctf_integer(u64, data, data) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent, - - TP_PROTO(struct btrfs_root *root, - struct btrfs_block_group_cache *block_group, u64 start, - u64 len), - - TP_ARGS(root, block_group, start, len), - - TP_FIELDS( - ctf_integer(u64, root_objectid, root->root_key.objectid) - ctf_integer(u64, bg_objectid, block_group->key.objectid) - ctf_integer(u64, flags, block_group->flags) - ctf_integer(u64, start, start) - ctf_integer(u64, len, len) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent, - - TP_PROTO(struct btrfs_root *root, - struct btrfs_block_group_cache *block_group, u64 start, - u64 len), - - TP_ARGS(root, block_group, start, len) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster, - - TP_PROTO(struct btrfs_root *root, - struct btrfs_block_group_cache *block_group, u64 start, - u64 len), - - TP_ARGS(root, block_group, start, len) -) - -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) -LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster, - - TP_PROTO(const struct btrfs_block_group *block_group, u64 start, - u64 bytes, u64 empty_size, u64 min_bytes), - - TP_ARGS(block_group, start, bytes, empty_size, min_bytes), - - TP_FIELDS( - ctf_integer(u64, bg_objectid, block_group->start) - ctf_integer(u64, flags, block_group->flags) - ctf_integer(u64, start, start) - ctf_integer(u64, bytes, bytes) - ctf_integer(u64, empty_size, empty_size) - ctf_integer(u64, min_bytes, min_bytes) - ) -) - -LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup, - - TP_PROTO(const struct btrfs_block_group *block_group), - - TP_ARGS(block_group), - - TP_FIELDS( - ctf_integer(u64, bg_objectid, block_group->start) - ) -) - -LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster, - - TP_PROTO(const struct btrfs_block_group *block_group, - const struct btrfs_free_cluster *cluster, u64 size, int bitmap), - - TP_ARGS(block_group, cluster, size, bitmap), - - TP_FIELDS( - ctf_integer(u64, bg_objectid, block_group->start) - ctf_integer(u64, flags, block_group->flags) - ctf_integer(u64, start, cluster->window_start) - ctf_integer(u64, max_size, cluster->max_size) - ctf_integer(u64, size, size) - ctf_integer(int, bitmap, bitmap) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) -LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster, - - TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start, - u64 bytes, u64 empty_size, u64 min_bytes), - - TP_ARGS(block_group, start, bytes, empty_size, min_bytes), - - TP_FIELDS( - ctf_integer(u64, bg_objectid, block_group->key.objectid) - ctf_integer(u64, flags, block_group->flags) - ctf_integer(u64, start, start) - ctf_integer(u64, bytes, bytes) - ctf_integer(u64, empty_size, empty_size) - ctf_integer(u64, min_bytes, min_bytes) - ) -) - -LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup, - - TP_PROTO(const struct btrfs_block_group_cache *block_group), - - TP_ARGS(block_group), - - TP_FIELDS( - ctf_integer(u64, bg_objectid, block_group->key.objectid) - ) -) - -LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster, - - TP_PROTO(const struct btrfs_block_group_cache *block_group, - const struct btrfs_free_cluster *cluster, u64 size, int bitmap), - - TP_ARGS(block_group, cluster, size, bitmap), - - TP_FIELDS( - ctf_integer(u64, bg_objectid, block_group->key.objectid) - ctf_integer(u64, flags, block_group->flags) - ctf_integer(u64, start, cluster->window_start) - ctf_integer(u64, max_size, cluster->max_size) - ctf_integer(u64, size, size) - ctf_integer(int, bitmap, bitmap) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) -LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster, - - TP_PROTO(struct btrfs_block_group_cache *block_group, u64 start, - u64 bytes, u64 empty_size, u64 min_bytes), - - TP_ARGS(block_group, start, bytes, empty_size, min_bytes), - - TP_FIELDS( - ctf_integer(u64, bg_objectid, block_group->key.objectid) - ctf_integer(u64, flags, block_group->flags) - ctf_integer(u64, start, start) - ctf_integer(u64, bytes, bytes) - ctf_integer(u64, empty_size, empty_size) - ctf_integer(u64, min_bytes, min_bytes) - ) -) - -LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup, - - TP_PROTO(struct btrfs_block_group_cache *block_group), - - TP_ARGS(block_group), - - TP_FIELDS( - ctf_integer(u64, bg_objectid, block_group->key.objectid) - ) -) - -LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster, - - TP_PROTO(struct btrfs_block_group_cache *block_group, - struct btrfs_free_cluster *cluster, u64 size, int bitmap), - - TP_ARGS(block_group, cluster, size, bitmap), - - TP_FIELDS( - ctf_integer(u64, bg_objectid, block_group->key.objectid) - ctf_integer(u64, flags, block_group->flags) - ctf_integer(u64, start, cluster->window_start) - ctf_integer(u64, max_size, cluster->max_size) - ctf_integer(u64, size, size) - ctf_integer(int, bitmap, bitmap) - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \ - LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0)) -LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state, - - btrfs_alloc_extent_state, - - TP_PROTO(const struct extent_state *state, gfp_t mask, unsigned long IP), - - TP_ARGS(state, mask, IP), - - TP_FIELDS( - ctf_integer_hex(const struct extent_state *, state, state) - ctf_integer(gfp_t, mask, mask) - ctf_integer_hex(unsigned long, ip, IP) - ) -) - -LTTNG_TRACEPOINT_EVENT_MAP(free_extent_state, - - btrfs_free_extent_state, - - TP_PROTO(const struct extent_state *state, unsigned long IP), - - TP_ARGS(state, IP), - - TP_FIELDS( - ctf_integer_hex(const struct extent_state *, state, state) - ctf_integer_hex(unsigned long, ip, IP) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) -LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state, - - btrfs_alloc_extent_state, - - TP_PROTO(struct extent_state *state, gfp_t mask, unsigned long IP), - - TP_ARGS(state, mask, IP), - - TP_FIELDS( - ctf_integer_hex(struct extent_state *, state, state) - ctf_integer(gfp_t, mask, mask) - ctf_integer_hex(unsigned long, ip, IP) - ) -) - -LTTNG_TRACEPOINT_EVENT_MAP(free_extent_state, - - btrfs_free_extent_state, - - TP_PROTO(struct extent_state *state, unsigned long IP), - - TP_ARGS(state, IP), - - TP_FIELDS( - ctf_integer_hex(struct extent_state *, state, state) - ctf_integer_hex(unsigned long, ip, IP) - ) -) -#endif - -#endif /* LTTNG_TRACE_BTRFS_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/compaction.h b/include/instrumentation/events/lttng-module/compaction.h deleted file mode 100644 index 72925c14..00000000 --- a/include/instrumentation/events/lttng-module/compaction.h +++ /dev/null @@ -1,158 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM compaction - -#if !defined(LTTNG_TRACE_COMPACTION_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_COMPACTION_H - -#include -#include -#include - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0) - -LTTNG_TRACEPOINT_EVENT_CLASS(compaction_isolate_template, - - TP_PROTO(unsigned long start_pfn, - unsigned long end_pfn, - unsigned long nr_scanned, - unsigned long nr_taken), - - TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken), - - TP_FIELDS( - ctf_integer(unsigned long, start_pfn, start_pfn) - ctf_integer(unsigned long, end_pfn, end_pfn) - ctf_integer(unsigned long, nr_scanned, nr_scanned) - ctf_integer(unsigned long, nr_taken, nr_taken) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(compaction_isolate_template, - - mm_compaction_isolate_migratepages, - - compaction_isolate_migratepages, - - TP_PROTO(unsigned long start_pfn, - unsigned long end_pfn, - unsigned long nr_scanned, - unsigned long nr_taken), - - TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(compaction_isolate_template, - - mm_compaction_isolate_freepages, - - compaction_isolate_freepages, - - TP_PROTO(unsigned long start_pfn, - unsigned long end_pfn, - unsigned long nr_scanned, - unsigned long nr_taken), - - TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken) -) - -#else /* #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0) */ - -LTTNG_TRACEPOINT_EVENT_CLASS(compaction_isolate_template, - - TP_PROTO(unsigned long nr_scanned, - unsigned long nr_taken), - - TP_ARGS(nr_scanned, nr_taken), - - TP_FIELDS( - ctf_integer(unsigned long, nr_scanned, nr_scanned) - ctf_integer(unsigned long, nr_taken, nr_taken) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(compaction_isolate_template, - - mm_compaction_isolate_migratepages, - - compaction_isolate_migratepages, - - TP_PROTO(unsigned long nr_scanned, - unsigned long nr_taken), - - TP_ARGS(nr_scanned, nr_taken) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(compaction_isolate_template, - - mm_compaction_isolate_freepages, - - compaction_isolate_freepages, - - TP_PROTO(unsigned long nr_scanned, - unsigned long nr_taken), - - TP_ARGS(nr_scanned, nr_taken) -) - -#endif /* #else #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0) */ - -#if LTTNG_KERNEL_RANGE(3,12,30, 3,13,0) || \ - LTTNG_KERNEL_RANGE(3,14,25, 3,15,0) || \ - (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) -LTTNG_TRACEPOINT_EVENT_CODE_MAP(mm_compaction_migratepages, - - compaction_migratepages, - - TP_PROTO(unsigned long nr_all, - int migrate_rc, - struct list_head *migratepages), - - TP_ARGS(nr_all, migrate_rc, migratepages), - - TP_locvar( - unsigned long nr_failed; - ), - - TP_code_pre( - tp_locvar->nr_failed = 0; - - { - struct list_head *page_lru; - - if (migrate_rc >= 0) - tp_locvar->nr_failed = migrate_rc; - else - list_for_each(page_lru, migratepages) - tp_locvar->nr_failed++; - } - ), - - TP_FIELDS( - ctf_integer(unsigned long, nr_migrated, nr_all - tp_locvar->nr_failed) - ctf_integer(unsigned long, nr_failed, tp_locvar->nr_failed) - ), - - TP_code_post() -) -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */ -LTTNG_TRACEPOINT_EVENT_MAP(mm_compaction_migratepages, - - compaction_migratepages, - - TP_PROTO(unsigned long nr_migrated, - unsigned long nr_failed), - - TP_ARGS(nr_migrated, nr_failed), - - TP_FIELDS( - ctf_integer(unsigned long, nr_migrated, nr_migrated) - ctf_integer(unsigned long, nr_failed, nr_failed) - ) -) -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) */ - -#endif /* LTTNG_TRACE_COMPACTION_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/ext3.h b/include/instrumentation/events/lttng-module/ext3.h deleted file mode 100644 index 8852a1ee..00000000 --- a/include/instrumentation/events/lttng-module/ext3.h +++ /dev/null @@ -1,522 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM ext3 - -#if !defined(LTTNG_TRACE_EXT3_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_EXT3_H - -#include -#include - -LTTNG_TRACEPOINT_EVENT(ext3_free_inode, - TP_PROTO(struct inode *inode), - - TP_ARGS(inode), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(umode_t, mode, inode->i_mode) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - ctf_integer(uid_t, uid, i_uid_read(inode)) - ctf_integer(gid_t, gid, i_gid_read(inode)) -#else - ctf_integer(uid_t, uid, inode->i_uid) - ctf_integer(gid_t, gid, inode->i_gid) -#endif - ctf_integer(blkcnt_t, blocks, inode->i_blocks) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_request_inode, - TP_PROTO(struct inode *dir, int mode), - - TP_ARGS(dir, mode), - - TP_FIELDS( - ctf_integer(dev_t, dev, dir->i_sb->s_dev) - ctf_integer(ino_t, dir, dir->i_ino) - ctf_integer(umode_t, mode, mode) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_allocate_inode, - TP_PROTO(struct inode *inode, struct inode *dir, int mode), - - TP_ARGS(inode, dir, mode), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ino_t, dir, dir->i_ino) - ctf_integer(umode_t, mode, mode) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_evict_inode, - TP_PROTO(struct inode *inode), - - TP_ARGS(inode), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(int, nlink, inode->i_nlink) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_drop_inode, - TP_PROTO(struct inode *inode, int drop), - - TP_ARGS(inode, drop), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(int, drop, drop) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_mark_inode_dirty, - TP_PROTO(struct inode *inode, unsigned long IP), - - TP_ARGS(inode, IP), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer_hex(unsigned long, ip, IP) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_write_begin, - TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, - unsigned int flags), - - TP_ARGS(inode, pos, len, flags), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(loff_t, pos, pos) - ctf_integer(unsigned int, len, len) - ctf_integer(unsigned int, flags, flags) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(ext3__write_end, - TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, - unsigned int copied), - - TP_ARGS(inode, pos, len, copied), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(loff_t, pos, pos) - ctf_integer(unsigned int, len, len) - ctf_integer(unsigned int, copied, copied) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext3__write_end, ext3_ordered_write_end, - - TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, - unsigned int copied), - - TP_ARGS(inode, pos, len, copied) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext3__write_end, ext3_writeback_write_end, - - TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, - unsigned int copied), - - TP_ARGS(inode, pos, len, copied) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext3__write_end, ext3_journalled_write_end, - - TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, - unsigned int copied), - - TP_ARGS(inode, pos, len, copied) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(ext3__page_op, - TP_PROTO(struct page *page), - - TP_ARGS(page), - - TP_FIELDS( - ctf_integer(dev_t, dev, page->mapping->host->i_sb->s_dev) - ctf_integer(ino_t, ino, page->mapping->host->i_ino) - ctf_integer(pgoff_t, index, page->index) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext3__page_op, ext3_ordered_writepage, - - TP_PROTO(struct page *page), - - TP_ARGS(page) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext3__page_op, ext3_writeback_writepage, - - TP_PROTO(struct page *page), - - TP_ARGS(page) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext3__page_op, ext3_journalled_writepage, - - TP_PROTO(struct page *page), - - TP_ARGS(page) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext3__page_op, ext3_readpage, - - TP_PROTO(struct page *page), - - TP_ARGS(page) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext3__page_op, ext3_releasepage, - - TP_PROTO(struct page *page), - - TP_ARGS(page) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) - -LTTNG_TRACEPOINT_EVENT(ext3_invalidatepage, - TP_PROTO(struct page *page, unsigned int offset, unsigned int length), - - TP_ARGS(page, offset, length), - - TP_FIELDS( - ctf_integer(pgoff_t, index, page->index) - ctf_integer(unsigned int, offset, offset) - ctf_integer(unsigned int, length, length) - ctf_integer(ino_t, ino, page->mapping->host->i_ino) - ctf_integer(dev_t, dev, page->mapping->host->i_sb->s_dev) - ) -) - -#else - -LTTNG_TRACEPOINT_EVENT(ext3_invalidatepage, - TP_PROTO(struct page *page, unsigned long offset), - - TP_ARGS(page, offset), - - TP_FIELDS( - ctf_integer(pgoff_t, index, page->index) - ctf_integer(unsigned long, offset, offset) - ctf_integer(ino_t, ino, page->mapping->host->i_ino) - ctf_integer(dev_t, dev, page->mapping->host->i_sb->s_dev) - ) -) - -#endif - -LTTNG_TRACEPOINT_EVENT(ext3_discard_blocks, - TP_PROTO(struct super_block *sb, unsigned long blk, - unsigned long count), - - TP_ARGS(sb, blk, count), - - TP_FIELDS( - ctf_integer(dev_t, dev, sb->s_dev) - ctf_integer(unsigned long, blk, blk) - ctf_integer(unsigned long, count, count) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_request_blocks, - TP_PROTO(struct inode *inode, unsigned long goal, - unsigned long count), - - TP_ARGS(inode, goal, count), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(unsigned long, count, count) - ctf_integer(unsigned long, goal, goal) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_allocate_blocks, - TP_PROTO(struct inode *inode, unsigned long goal, - unsigned long count, unsigned long block), - - TP_ARGS(inode, goal, count, block), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(unsigned long, block, block) - ctf_integer(unsigned long, count, count) - ctf_integer(unsigned long, goal, goal) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_free_blocks, - TP_PROTO(struct inode *inode, unsigned long block, - unsigned long count), - - TP_ARGS(inode, block, count), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(umode_t, mode, inode->i_mode) - ctf_integer(unsigned long, block, block) - ctf_integer(unsigned long, count, count) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_sync_file_enter, - TP_PROTO(struct file *file, int datasync), - - TP_ARGS(file, datasync), - - TP_FIELDS( - ctf_integer(dev_t, dev, file->f_path.dentry->d_inode->i_sb->s_dev) - ctf_integer(ino_t, ino, file->f_path.dentry->d_inode->i_ino) - ctf_integer(ino_t, parent, file->f_path.dentry->d_parent->d_inode->i_ino) - ctf_integer(int, datasync, datasync) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_sync_file_exit, - TP_PROTO(struct inode *inode, int ret), - - TP_ARGS(inode, ret), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(int, ret, ret) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_sync_fs, - TP_PROTO(struct super_block *sb, int wait), - - TP_ARGS(sb, wait), - - TP_FIELDS( - ctf_integer(dev_t, dev, sb->s_dev) - ctf_integer(int, wait, wait) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_rsv_window_add, - TP_PROTO(struct super_block *sb, - struct ext3_reserve_window_node *rsv_node), - - TP_ARGS(sb, rsv_node), - - TP_FIELDS( - ctf_integer(unsigned long, start, rsv_node->rsv_window._rsv_start) - ctf_integer(unsigned long, end, rsv_node->rsv_window._rsv_end) - ctf_integer(dev_t, dev, sb->s_dev) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_discard_reservation, - TP_PROTO(struct inode *inode, - struct ext3_reserve_window_node *rsv_node), - - TP_ARGS(inode, rsv_node), - - TP_FIELDS( - ctf_integer(unsigned long, start, rsv_node->rsv_window._rsv_start) - ctf_integer(unsigned long, end, rsv_node->rsv_window._rsv_end) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_alloc_new_reservation, - TP_PROTO(struct super_block *sb, unsigned long goal), - - TP_ARGS(sb, goal), - - TP_FIELDS( - ctf_integer(dev_t, dev, sb->s_dev) - ctf_integer(unsigned long, goal, goal) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_reserved, - TP_PROTO(struct super_block *sb, unsigned long block, - struct ext3_reserve_window_node *rsv_node), - - TP_ARGS(sb, block, rsv_node), - - TP_FIELDS( - ctf_integer(unsigned long, block, block) - ctf_integer(unsigned long, start, rsv_node->rsv_window._rsv_start) - ctf_integer(unsigned long, end, rsv_node->rsv_window._rsv_end) - ctf_integer(dev_t, dev, sb->s_dev) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_forget, - TP_PROTO(struct inode *inode, int is_metadata, unsigned long block), - - TP_ARGS(inode, is_metadata, block), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(umode_t, mode, inode->i_mode) - ctf_integer(int, is_metadata, is_metadata) - ctf_integer(unsigned long, block, block) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_read_block_bitmap, - TP_PROTO(struct super_block *sb, unsigned int group), - - TP_ARGS(sb, group), - - TP_FIELDS( - ctf_integer(dev_t, dev, sb->s_dev) - ctf_integer(__u32, group, group) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_direct_IO_enter, - TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw), - - TP_ARGS(inode, offset, len, rw), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(loff_t, pos, offset) - ctf_integer(unsigned long, len, len) - ctf_integer(int, rw, rw) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_direct_IO_exit, - TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, - int rw, int ret), - - TP_ARGS(inode, offset, len, rw, ret), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(loff_t, pos, offset) - ctf_integer(unsigned long, len, len) - ctf_integer(int, rw, rw) - ctf_integer(int, ret, ret) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_unlink_enter, - TP_PROTO(struct inode *parent, struct dentry *dentry), - - TP_ARGS(parent, dentry), - - TP_FIELDS( - ctf_integer(ino_t, parent, parent->i_ino) - ctf_integer(ino_t, ino, dentry->d_inode->i_ino) - ctf_integer(loff_t, size, dentry->d_inode->i_size) - ctf_integer(dev_t, dev, dentry->d_inode->i_sb->s_dev) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_unlink_exit, - TP_PROTO(struct dentry *dentry, int ret), - - TP_ARGS(dentry, ret), - - TP_FIELDS( - ctf_integer(dev_t, dev, dentry->d_inode->i_sb->s_dev) - ctf_integer(ino_t, ino, dentry->d_inode->i_ino) - ctf_integer(int, ret, ret) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(ext3__truncate, - TP_PROTO(struct inode *inode), - - TP_ARGS(inode), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(blkcnt_t, blocks, inode->i_blocks) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext3__truncate, ext3_truncate_enter, - - TP_PROTO(struct inode *inode), - - TP_ARGS(inode) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext3__truncate, ext3_truncate_exit, - - TP_PROTO(struct inode *inode), - - TP_ARGS(inode) -) - -LTTNG_TRACEPOINT_EVENT(ext3_get_blocks_enter, - TP_PROTO(struct inode *inode, unsigned long lblk, - unsigned long len, int create), - - TP_ARGS(inode, lblk, len, create), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(unsigned long, lblk, lblk) - ctf_integer(unsigned long, len, len) - ctf_integer(int, create, create) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_get_blocks_exit, - TP_PROTO(struct inode *inode, unsigned long lblk, - unsigned long pblk, unsigned long len, int ret), - - TP_ARGS(inode, lblk, pblk, len, ret), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(unsigned long, lblk, lblk) - ctf_integer(unsigned long, pblk, pblk) - ctf_integer(unsigned long, len, len) - ctf_integer(int, ret, ret) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext3_load_inode, - TP_PROTO(struct inode *inode), - - TP_ARGS(inode), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ) -) - -#endif /* LTTNG_TRACE_EXT3_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/ext4.h b/include/instrumentation/events/lttng-module/ext4.h deleted file mode 100644 index e57aff8b..00000000 --- a/include/instrumentation/events/lttng-module/ext4.h +++ /dev/null @@ -1,1871 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM ext4 - -#if !defined(LTTNG_TRACE_EXT4_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_EXT4_H - -#include -#include -#include - -#ifndef _TRACE_EXT4_DEF_ -#define _TRACE_EXT4_DEF_ -struct ext4_allocation_context; -struct ext4_allocation_request; -struct ext4_prealloc_space; -struct ext4_inode_info; -struct mpage_da_data; -struct ext4_map_blocks; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) -struct ext4_extent; -#endif -#endif - -#define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode)) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) -#define TP_MODE_T __u16 -#else -#define TP_MODE_T umode_t -#endif - -LTTNG_TRACEPOINT_EVENT(ext4_free_inode, - TP_PROTO(struct inode *inode), - - TP_ARGS(inode), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - ctf_integer(uid_t, uid, i_uid_read(inode)) - ctf_integer(gid_t, gid, i_gid_read(inode)) -#else - ctf_integer(uid_t, uid, inode->i_uid) - ctf_integer(gid_t, gid, inode->i_gid) -#endif - ctf_integer(__u64, blocks, inode->i_blocks) - ctf_integer(TP_MODE_T, mode, inode->i_mode) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_request_inode, - TP_PROTO(struct inode *dir, int mode), - - TP_ARGS(dir, mode), - - TP_FIELDS( - ctf_integer(dev_t, dev, dir->i_sb->s_dev) - ctf_integer(ino_t, dir, dir->i_ino) - ctf_integer(TP_MODE_T, mode, mode) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_allocate_inode, - TP_PROTO(struct inode *inode, struct inode *dir, int mode), - - TP_ARGS(inode, dir, mode), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ino_t, dir, dir->i_ino) - ctf_integer(TP_MODE_T, mode, mode) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_evict_inode, - TP_PROTO(struct inode *inode), - - TP_ARGS(inode), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(int, nlink, inode->i_nlink) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_drop_inode, - TP_PROTO(struct inode *inode, int drop), - - TP_ARGS(inode, drop), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(int, drop, drop) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_mark_inode_dirty, - TP_PROTO(struct inode *inode, unsigned long IP), - - TP_ARGS(inode, IP), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer_hex(unsigned long, ip, IP) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_begin_ordered_truncate, - TP_PROTO(struct inode *inode, loff_t new_size), - - TP_ARGS(inode, new_size), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(loff_t, new_size, new_size) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(ext4__write_begin, - - TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, - unsigned int flags), - - TP_ARGS(inode, pos, len, flags), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(loff_t, pos, pos) - ctf_integer(unsigned int, len, len) - ctf_integer(unsigned int, flags, flags) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__write_begin, ext4_write_begin, - - TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, - unsigned int flags), - - TP_ARGS(inode, pos, len, flags) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__write_begin, ext4_da_write_begin, - - TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, - unsigned int flags), - - TP_ARGS(inode, pos, len, flags) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(ext4__write_end, - TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, - unsigned int copied), - - TP_ARGS(inode, pos, len, copied), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(loff_t, pos, pos) - ctf_integer(unsigned int, len, len) - ctf_integer(unsigned int, copied, copied) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__write_end, ext4_ordered_write_end, - - TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, - unsigned int copied), - - TP_ARGS(inode, pos, len, copied) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__write_end, ext4_writeback_write_end, - - TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, - unsigned int copied), - - TP_ARGS(inode, pos, len, copied) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__write_end, ext4_journalled_write_end, - - TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, - unsigned int copied), - - TP_ARGS(inode, pos, len, copied) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__write_end, ext4_da_write_end, - - TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, - unsigned int copied), - - TP_ARGS(inode, pos, len, copied) -) - -LTTNG_TRACEPOINT_EVENT(ext4_da_writepages, - TP_PROTO(struct inode *inode, struct writeback_control *wbc), - - TP_ARGS(inode, wbc), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(long, nr_to_write, wbc->nr_to_write) - ctf_integer(long, pages_skipped, wbc->pages_skipped) - ctf_integer(loff_t, range_start, wbc->range_start) - ctf_integer(loff_t, range_end, wbc->range_end) - ctf_integer(pgoff_t, writeback_index, inode->i_mapping->writeback_index) - ctf_integer(int, sync_mode, wbc->sync_mode) - ctf_integer(char, for_kupdate, wbc->for_kupdate) - ctf_integer(char, range_cyclic, wbc->range_cyclic) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) - -LTTNG_TRACEPOINT_EVENT(ext4_da_write_pages, - TP_PROTO(struct inode *inode, pgoff_t first_page, - struct writeback_control *wbc), - - TP_ARGS(inode, first_page, wbc), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(pgoff_t, first_page, first_page) - ctf_integer(long, nr_to_write, wbc->nr_to_write) - ctf_integer(int, sync_mode, wbc->sync_mode) - ) -) - -#else - -LTTNG_TRACEPOINT_EVENT(ext4_da_write_pages, - TP_PROTO(struct inode *inode, struct mpage_da_data *mpd), - - TP_ARGS(inode, mpd), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(__u64, b_blocknr, mpd->b_blocknr) - ctf_integer(__u32, b_size, mpd->b_size) - ctf_integer(__u32, b_state, mpd->b_state) - ctf_integer(unsigned long, first_page, mpd->first_page) - ctf_integer(int, io_done, mpd->io_done) - ctf_integer(int, pages_written, mpd->pages_written) - ctf_integer(int, sync_mode, mpd->wbc->sync_mode) - ) -) - -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) - -LTTNG_TRACEPOINT_EVENT(ext4_da_write_pages_extent, - TP_PROTO(struct inode *inode, struct ext4_map_blocks *map), - - TP_ARGS(inode, map), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(__u64, lblk, map->m_lblk) - ctf_integer(__u32, len, map->m_len) - ctf_integer(__u32, flags, map->m_flags) - ) -) - -#endif - -LTTNG_TRACEPOINT_EVENT(ext4_da_writepages_result, - TP_PROTO(struct inode *inode, struct writeback_control *wbc, - int ret, int pages_written), - - TP_ARGS(inode, wbc, ret, pages_written), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(int, ret, ret) - ctf_integer(int, pages_written, pages_written) - ctf_integer(long, pages_skipped, wbc->pages_skipped) - ctf_integer(pgoff_t, writeback_index, inode->i_mapping->writeback_index) - ctf_integer(int, sync_mode, wbc->sync_mode) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(ext4__page_op, - TP_PROTO(struct page *page), - - TP_ARGS(page), - - TP_FIELDS( - ctf_integer(dev_t, dev, page->mapping->host->i_sb->s_dev) - ctf_integer(ino_t, ino, page->mapping->host->i_ino) - ctf_integer(pgoff_t, index, page->index) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__page_op, ext4_writepage, - - TP_PROTO(struct page *page), - - TP_ARGS(page) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__page_op, ext4_readpage, - - TP_PROTO(struct page *page), - - TP_ARGS(page) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__page_op, ext4_releasepage, - - TP_PROTO(struct page *page), - - TP_ARGS(page) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) - -LTTNG_TRACEPOINT_EVENT_CLASS(ext4_invalidatepage_op, - TP_PROTO(struct page *page, unsigned int offset, unsigned int length), - - TP_ARGS(page, offset, length), - - TP_FIELDS( - ctf_integer(dev_t, dev, page->mapping->host->i_sb->s_dev) - ctf_integer(ino_t, ino, page->mapping->host->i_ino) - ctf_integer(pgoff_t, index, page->index) - ctf_integer(unsigned int, offset, offset) - ctf_integer(unsigned int, length, length) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4_invalidatepage_op, ext4_invalidatepage, - TP_PROTO(struct page *page, unsigned int offset, unsigned int length), - - TP_ARGS(page, offset, length) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4_invalidatepage_op, ext4_journalled_invalidatepage, - TP_PROTO(struct page *page, unsigned int offset, unsigned int length), - - TP_ARGS(page, offset, length) -) - -#else - -LTTNG_TRACEPOINT_EVENT(ext4_invalidatepage, - TP_PROTO(struct page *page, unsigned long offset), - - TP_ARGS(page, offset), - - TP_FIELDS( - ctf_integer(dev_t, dev, page->mapping->host->i_sb->s_dev) - ctf_integer(ino_t, ino, page->mapping->host->i_ino) - ctf_integer(pgoff_t, index, page->index) - ctf_integer(unsigned long, offset, offset) - - ) -) - -#endif - -LTTNG_TRACEPOINT_EVENT(ext4_discard_blocks, - TP_PROTO(struct super_block *sb, unsigned long long blk, - unsigned long long count), - - TP_ARGS(sb, blk, count), - - TP_FIELDS( - ctf_integer(dev_t, dev, sb->s_dev) - ctf_integer(__u64, blk, blk) - ctf_integer(__u64, count, count) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(ext4__mb_new_pa, - TP_PROTO(struct ext4_allocation_context *ac, - struct ext4_prealloc_space *pa), - - TP_ARGS(ac, pa), - - TP_FIELDS( - ctf_integer(dev_t, dev, ac->ac_sb->s_dev) - ctf_integer(ino_t, ino, ac->ac_inode->i_ino) - ctf_integer(__u64, pa_pstart, pa->pa_pstart) - ctf_integer(__u64, pa_lstart, pa->pa_lstart) - ctf_integer(__u32, pa_len, pa->pa_len) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__mb_new_pa, ext4_mb_new_inode_pa, - - TP_PROTO(struct ext4_allocation_context *ac, - struct ext4_prealloc_space *pa), - - TP_ARGS(ac, pa) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__mb_new_pa, ext4_mb_new_group_pa, - - TP_PROTO(struct ext4_allocation_context *ac, - struct ext4_prealloc_space *pa), - - TP_ARGS(ac, pa) -) - -LTTNG_TRACEPOINT_EVENT(ext4_mb_release_inode_pa, - TP_PROTO( - struct ext4_prealloc_space *pa, - unsigned long long block, unsigned int count), - - TP_ARGS(pa, block, count), - - TP_FIELDS( - ctf_integer(dev_t, dev, pa->pa_inode->i_sb->s_dev) - ctf_integer(ino_t, ino, pa->pa_inode->i_ino) - ctf_integer(__u64, block, block) - ctf_integer(__u32, count, count) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) -LTTNG_TRACEPOINT_EVENT(ext4_mb_release_group_pa, - - TP_PROTO(struct super_block *sb, struct ext4_prealloc_space *pa), - - TP_ARGS(sb, pa), - - TP_FIELDS( - ctf_integer(dev_t, dev, sb->s_dev) - ctf_integer(__u64, pa_pstart, pa->pa_pstart) - ctf_integer(__u32, pa_len, pa->pa_len) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(ext4_mb_release_group_pa, - - TP_PROTO(struct ext4_prealloc_space *pa), - - TP_ARGS(pa), - - TP_FIELDS( - ctf_integer(dev_t, dev, pa->pa_inode->i_sb->s_dev) - ctf_integer(__u64, pa_pstart, pa->pa_pstart) - ctf_integer(__u32, pa_len, pa->pa_len) - ) -) -#endif - -LTTNG_TRACEPOINT_EVENT(ext4_discard_preallocations, - TP_PROTO(struct inode *inode), - - TP_ARGS(inode), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_mb_discard_preallocations, - TP_PROTO(struct super_block *sb, int needed), - - TP_ARGS(sb, needed), - - TP_FIELDS( - ctf_integer(dev_t, dev, sb->s_dev) - ctf_integer(int, needed, needed) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_request_blocks, - TP_PROTO(struct ext4_allocation_request *ar), - - TP_ARGS(ar), - - TP_FIELDS( - ctf_integer(dev_t, dev, ar->inode->i_sb->s_dev) - ctf_integer(ino_t, ino, ar->inode->i_ino) - ctf_integer(unsigned int, len, ar->len) - ctf_integer(__u32, logical, ar->logical) - ctf_integer(__u32, lleft, ar->lleft) - ctf_integer(__u32, lright, ar->lright) - ctf_integer(__u64, goal, ar->goal) - ctf_integer(__u64, pleft, ar->pleft) - ctf_integer(__u64, pright, ar->pright) - ctf_integer(unsigned int, flags, ar->flags) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_allocate_blocks, - TP_PROTO(struct ext4_allocation_request *ar, unsigned long long block), - - TP_ARGS(ar, block), - - TP_FIELDS( - ctf_integer(dev_t, dev, ar->inode->i_sb->s_dev) - ctf_integer(ino_t, ino, ar->inode->i_ino) - ctf_integer(__u64, block, block) - ctf_integer(unsigned int, len, ar->len) - ctf_integer(__u32, logical, ar->logical) - ctf_integer(__u32, lleft, ar->lleft) - ctf_integer(__u32, lright, ar->lright) - ctf_integer(__u64, goal, ar->goal) - ctf_integer(__u64, pleft, ar->pleft) - ctf_integer(__u64, pright, ar->pright) - ctf_integer(unsigned int, flags, ar->flags) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_free_blocks, - TP_PROTO(struct inode *inode, __u64 block, unsigned long count, - int flags), - - TP_ARGS(inode, block, count, flags), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(__u64, block, block) - ctf_integer(unsigned long, count, count) - ctf_integer(int, flags, flags) - ctf_integer(TP_MODE_T, mode, inode->i_mode) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_sync_file_enter, - TP_PROTO(struct file *file, int datasync), - - TP_ARGS(file, datasync), - - TP_FIELDS( - ctf_integer(dev_t, dev, file->f_path.dentry->d_inode->i_sb->s_dev) - ctf_integer(ino_t, ino, file->f_path.dentry->d_inode->i_ino) - ctf_integer(ino_t, parent, file->f_path.dentry->d_parent->d_inode->i_ino) - ctf_integer(int, datasync, datasync) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_sync_file_exit, - TP_PROTO(struct inode *inode, int ret), - - TP_ARGS(inode, ret), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(int, ret, ret) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_sync_fs, - TP_PROTO(struct super_block *sb, int wait), - - TP_ARGS(sb, wait), - - TP_FIELDS( - ctf_integer(dev_t, dev, sb->s_dev) - ctf_integer(int, wait, wait) - - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0)) -LTTNG_TRACEPOINT_EVENT(ext4_alloc_da_blocks, - TP_PROTO(struct inode *inode), - - TP_ARGS(inode), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(unsigned int, data_blocks, EXT4_I(inode)->i_reserved_data_blocks) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(ext4_alloc_da_blocks, - TP_PROTO(struct inode *inode), - - TP_ARGS(inode), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(unsigned int, data_blocks, EXT4_I(inode)->i_reserved_data_blocks) - ctf_integer(unsigned int, meta_blocks, EXT4_I(inode)->i_reserved_meta_blocks) - ) -) -#endif - -LTTNG_TRACEPOINT_EVENT(ext4_mballoc_alloc, - TP_PROTO(struct ext4_allocation_context *ac), - - TP_ARGS(ac), - - TP_FIELDS( - ctf_integer(dev_t, dev, ac->ac_inode->i_sb->s_dev) - ctf_integer(ino_t, ino, ac->ac_inode->i_ino) - ctf_integer(__u32, orig_logical, ac->ac_o_ex.fe_logical) - ctf_integer(int, orig_start, ac->ac_o_ex.fe_start) - ctf_integer(__u32, orig_group, ac->ac_o_ex.fe_group) - ctf_integer(int, orig_len, ac->ac_o_ex.fe_len) - ctf_integer(__u32, goal_logical, ac->ac_g_ex.fe_logical) - ctf_integer(int, goal_start, ac->ac_g_ex.fe_start) - ctf_integer(__u32, goal_group, ac->ac_g_ex.fe_group) - ctf_integer(int, goal_len, ac->ac_g_ex.fe_len) - ctf_integer(__u32, result_logical, ac->ac_f_ex.fe_logical) - ctf_integer(int, result_start, ac->ac_f_ex.fe_start) - ctf_integer(__u32, result_group, ac->ac_f_ex.fe_group) - ctf_integer(int, result_len, ac->ac_f_ex.fe_len) - ctf_integer(__u16, found, ac->ac_found) - ctf_integer(__u16, groups, ac->ac_groups_scanned) - ctf_integer(__u16, buddy, ac->ac_buddy) - ctf_integer(__u16, flags, ac->ac_flags) - ctf_integer(__u16, tail, ac->ac_tail) - ctf_integer(__u8, cr, ac->ac_criteria) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_mballoc_prealloc, - TP_PROTO(struct ext4_allocation_context *ac), - - TP_ARGS(ac), - - TP_FIELDS( - ctf_integer(dev_t, dev, ac->ac_inode->i_sb->s_dev) - ctf_integer(ino_t, ino, ac->ac_inode->i_ino) - ctf_integer(__u32, orig_logical, ac->ac_o_ex.fe_logical) - ctf_integer(int, orig_start, ac->ac_o_ex.fe_start) - ctf_integer(__u32, orig_group, ac->ac_o_ex.fe_group) - ctf_integer(int, orig_len, ac->ac_o_ex.fe_len) - ctf_integer(__u32, result_logical, ac->ac_b_ex.fe_logical) - ctf_integer(int, result_start, ac->ac_b_ex.fe_start) - ctf_integer(__u32, result_group, ac->ac_b_ex.fe_group) - ctf_integer(int, result_len, ac->ac_b_ex.fe_len) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(ext4__mballoc, - TP_PROTO(struct super_block *sb, - struct inode *inode, - ext4_group_t group, - ext4_grpblk_t start, - ext4_grpblk_t len), - - TP_ARGS(sb, inode, group, start, len), - - TP_FIELDS( - ctf_integer(dev_t, dev, sb->s_dev) - ctf_integer(ino_t, ino, inode ? inode->i_ino : 0) - ctf_integer(int, result_start, start) - ctf_integer(__u32, result_group, group) - ctf_integer(int, result_len, len) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__mballoc, ext4_mballoc_discard, - - TP_PROTO(struct super_block *sb, - struct inode *inode, - ext4_group_t group, - ext4_grpblk_t start, - ext4_grpblk_t len), - - TP_ARGS(sb, inode, group, start, len) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__mballoc, ext4_mballoc_free, - - TP_PROTO(struct super_block *sb, - struct inode *inode, - ext4_group_t group, - ext4_grpblk_t start, - ext4_grpblk_t len), - - TP_ARGS(sb, inode, group, start, len) -) - -LTTNG_TRACEPOINT_EVENT(ext4_forget, - TP_PROTO(struct inode *inode, int is_metadata, __u64 block), - - TP_ARGS(inode, is_metadata, block), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(__u64, block, block) - ctf_integer(int, is_metadata, is_metadata) - ctf_integer(TP_MODE_T, mode, inode->i_mode) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0)) -LTTNG_TRACEPOINT_EVENT(ext4_da_update_reserve_space, - TP_PROTO(struct inode *inode, int used_blocks, int quota_claim), - - TP_ARGS(inode, used_blocks, quota_claim), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(__u64, i_blocks, inode->i_blocks) - ctf_integer(int, used_blocks, used_blocks) - ctf_integer(int, reserved_data_blocks, - EXT4_I(inode)->i_reserved_data_blocks) - ctf_integer(int, quota_claim, quota_claim) - ctf_integer(TP_MODE_T, mode, inode->i_mode) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) -LTTNG_TRACEPOINT_EVENT(ext4_da_update_reserve_space, - TP_PROTO(struct inode *inode, int used_blocks, int quota_claim), - - TP_ARGS(inode, used_blocks, quota_claim), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(__u64, i_blocks, inode->i_blocks) - ctf_integer(int, used_blocks, used_blocks) - ctf_integer(int, reserved_data_blocks, - EXT4_I(inode)->i_reserved_data_blocks) - ctf_integer(int, reserved_meta_blocks, - EXT4_I(inode)->i_reserved_meta_blocks) - ctf_integer(int, allocated_meta_blocks, - EXT4_I(inode)->i_allocated_meta_blocks) - ctf_integer(int, quota_claim, quota_claim) - ctf_integer(TP_MODE_T, mode, inode->i_mode) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(ext4_da_update_reserve_space, - TP_PROTO(struct inode *inode, int used_blocks), - - TP_ARGS(inode, used_blocks), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(__u64, i_blocks, inode->i_blocks) - ctf_integer(int, used_blocks, used_blocks) - ctf_integer(int, reserved_data_blocks, - EXT4_I(inode)->i_reserved_data_blocks) - ctf_integer(int, reserved_meta_blocks, - EXT4_I(inode)->i_reserved_meta_blocks) - ctf_integer(int, allocated_meta_blocks, - EXT4_I(inode)->i_allocated_meta_blocks) - ctf_integer(TP_MODE_T, mode, inode->i_mode) - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0)) -LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_space, - TP_PROTO(struct inode *inode), - - TP_ARGS(inode), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(__u64, i_blocks, inode->i_blocks) - ctf_integer(int, reserved_data_blocks, - EXT4_I(inode)->i_reserved_data_blocks) - ctf_integer(TP_MODE_T, mode, inode->i_mode) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) -LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_space, - TP_PROTO(struct inode *inode), - - TP_ARGS(inode), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(__u64, i_blocks, inode->i_blocks) - ctf_integer(int, reserved_data_blocks, - EXT4_I(inode)->i_reserved_data_blocks) - ctf_integer(int, reserved_meta_blocks, - EXT4_I(inode)->i_reserved_meta_blocks) - ctf_integer(TP_MODE_T, mode, inode->i_mode) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_space, - TP_PROTO(struct inode *inode, int md_needed), - - TP_ARGS(inode, md_needed), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(__u64, i_blocks, inode->i_blocks) - ctf_integer(int, md_needed, md_needed) - ctf_integer(int, reserved_data_blocks, - EXT4_I(inode)->i_reserved_data_blocks) - ctf_integer(int, reserved_meta_blocks, - EXT4_I(inode)->i_reserved_meta_blocks) - ctf_integer(TP_MODE_T, mode, inode->i_mode) - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0)) -LTTNG_TRACEPOINT_EVENT(ext4_da_release_space, - TP_PROTO(struct inode *inode, int freed_blocks), - - TP_ARGS(inode, freed_blocks), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(__u64, i_blocks, inode->i_blocks) - ctf_integer(int, freed_blocks, freed_blocks) - ctf_integer(int, reserved_data_blocks, - EXT4_I(inode)->i_reserved_data_blocks) - ctf_integer(TP_MODE_T, mode, inode->i_mode) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(ext4_da_release_space, - TP_PROTO(struct inode *inode, int freed_blocks), - - TP_ARGS(inode, freed_blocks), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(__u64, i_blocks, inode->i_blocks) - ctf_integer(int, freed_blocks, freed_blocks) - ctf_integer(int, reserved_data_blocks, - EXT4_I(inode)->i_reserved_data_blocks) - ctf_integer(int, reserved_meta_blocks, - EXT4_I(inode)->i_reserved_meta_blocks) - ctf_integer(int, allocated_meta_blocks, - EXT4_I(inode)->i_allocated_meta_blocks) - ctf_integer(TP_MODE_T, mode, inode->i_mode) - ) -) -#endif - -LTTNG_TRACEPOINT_EVENT_CLASS(ext4__bitmap_load, - TP_PROTO(struct super_block *sb, unsigned long group), - - TP_ARGS(sb, group), - - TP_FIELDS( - ctf_integer(dev_t, dev, sb->s_dev) - ctf_integer(__u32, group, group) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__bitmap_load, ext4_mb_bitmap_load, - - TP_PROTO(struct super_block *sb, unsigned long group), - - TP_ARGS(sb, group) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__bitmap_load, ext4_mb_buddy_bitmap_load, - - TP_PROTO(struct super_block *sb, unsigned long group), - - TP_ARGS(sb, group) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__bitmap_load, ext4_read_block_bitmap_load, - - TP_PROTO(struct super_block *sb, unsigned long group), - - TP_ARGS(sb, group) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__bitmap_load, ext4_load_inode_bitmap, - - TP_PROTO(struct super_block *sb, unsigned long group), - - TP_ARGS(sb, group) -) - -LTTNG_TRACEPOINT_EVENT(ext4_direct_IO_enter, - TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw), - - TP_ARGS(inode, offset, len, rw), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(loff_t, pos, offset) - ctf_integer(unsigned long, len, len) - ctf_integer(int, rw, rw) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_direct_IO_exit, - TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, - int rw, int ret), - - TP_ARGS(inode, offset, len, rw, ret), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(loff_t, pos, offset) - ctf_integer(unsigned long, len, len) - ctf_integer(int, rw, rw) - ctf_integer(int, ret, ret) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_fallocate_exit, - TP_PROTO(struct inode *inode, loff_t offset, - unsigned int max_blocks, int ret), - - TP_ARGS(inode, offset, max_blocks, ret), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(loff_t, pos, offset) - ctf_integer(unsigned int, blocks, max_blocks) - ctf_integer(int, ret, ret) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) - -LTTNG_TRACEPOINT_EVENT_CLASS(ext4__fallocate_mode, - TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode), - - TP_ARGS(inode, offset, len, mode), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(loff_t, pos, offset) - ctf_integer(loff_t, len, len) - ctf_integer(int, mode, mode) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__fallocate_mode, ext4_fallocate_enter, - - TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode), - - TP_ARGS(inode, offset, len, mode) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__fallocate_mode, ext4_punch_hole, - - TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode), - - TP_ARGS(inode, offset, len, mode) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__fallocate_mode, ext4_zero_range, - - TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode), - - TP_ARGS(inode, offset, len, mode) -) - -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */ - -LTTNG_TRACEPOINT_EVENT(ext4_fallocate_enter, - TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode), - - TP_ARGS(inode, offset, len, mode), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(loff_t, pos, offset) - ctf_integer(loff_t, len, len) - ctf_integer(int, mode, mode) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) - -LTTNG_TRACEPOINT_EVENT(ext4_punch_hole, - TP_PROTO(struct inode *inode, loff_t offset, loff_t len), - - TP_ARGS(inode, offset, len), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(loff_t, pos, offset) - ctf_integer(loff_t, len, len) - ) -) - -#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) */ - -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */ - -LTTNG_TRACEPOINT_EVENT(ext4_unlink_enter, - TP_PROTO(struct inode *parent, struct dentry *dentry), - - TP_ARGS(parent, dentry), - - TP_FIELDS( - ctf_integer(dev_t, dev, dentry->d_inode->i_sb->s_dev) - ctf_integer(ino_t, ino, dentry->d_inode->i_ino) - ctf_integer(ino_t, parent, parent->i_ino) - ctf_integer(loff_t, size, dentry->d_inode->i_size) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_unlink_exit, - TP_PROTO(struct dentry *dentry, int ret), - - TP_ARGS(dentry, ret), - - TP_FIELDS( - ctf_integer(dev_t, dev, dentry->d_inode->i_sb->s_dev) - ctf_integer(ino_t, ino, dentry->d_inode->i_ino) - ctf_integer(int, ret, ret) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(ext4__truncate, - TP_PROTO(struct inode *inode), - - TP_ARGS(inode), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(unsigned int, blocks, inode->i_blocks) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__truncate, ext4_truncate_enter, - - TP_PROTO(struct inode *inode), - - TP_ARGS(inode) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__truncate, ext4_truncate_exit, - - TP_PROTO(struct inode *inode), - - TP_ARGS(inode) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) -/* 'ux' is the uninitialized extent. */ -LTTNG_TRACEPOINT_EVENT(ext4_ext_convert_to_initialized_enter, - TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, - struct ext4_extent *ux), - - TP_ARGS(inode, map, ux), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_lblk_t, m_lblk, map->m_lblk) - ctf_integer(unsigned, m_len, map->m_len) - ctf_integer(ext4_lblk_t, u_lblk, le32_to_cpu(ux->ee_block)) - ctf_integer(unsigned, u_len, ext4_ext_get_actual_len(ux)) - ctf_integer(ext4_fsblk_t, u_pblk, ext4_ext_pblock(ux)) - ) -) - -/* - * 'ux' is the uninitialized extent. - * 'ix' is the initialized extent to which blocks are transferred. - */ -LTTNG_TRACEPOINT_EVENT(ext4_ext_convert_to_initialized_fastpath, - TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, - struct ext4_extent *ux, struct ext4_extent *ix), - - TP_ARGS(inode, map, ux, ix), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_lblk_t, m_lblk, map->m_lblk) - ctf_integer(unsigned, m_len, map->m_len) - ctf_integer(ext4_lblk_t, u_lblk, le32_to_cpu(ux->ee_block)) - ctf_integer(unsigned, u_len, ext4_ext_get_actual_len(ux)) - ctf_integer(ext4_fsblk_t, u_pblk, ext4_ext_pblock(ux)) - ctf_integer(ext4_lblk_t, i_lblk, le32_to_cpu(ix->ee_block)) - ctf_integer(unsigned, i_len, ext4_ext_get_actual_len(ix)) - ctf_integer(ext4_fsblk_t, i_pblk, ext4_ext_pblock(ix)) - ) -) -#endif - -LTTNG_TRACEPOINT_EVENT_CLASS(ext4__map_blocks_enter, - TP_PROTO(struct inode *inode, ext4_lblk_t lblk, - unsigned int len, unsigned int flags), - - TP_ARGS(inode, lblk, len, flags), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_lblk_t, lblk, lblk) - ctf_integer(unsigned int, len, len) - ctf_integer(unsigned int, flags, flags) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__map_blocks_enter, ext4_ext_map_blocks_enter, - TP_PROTO(struct inode *inode, ext4_lblk_t lblk, - unsigned len, unsigned flags), - - TP_ARGS(inode, lblk, len, flags) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__map_blocks_enter, ext4_ind_map_blocks_enter, - TP_PROTO(struct inode *inode, ext4_lblk_t lblk, - unsigned len, unsigned flags), - - TP_ARGS(inode, lblk, len, flags) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) - -LTTNG_TRACEPOINT_EVENT_CLASS(ext4__map_blocks_exit, - TP_PROTO(struct inode *inode, unsigned flags, struct ext4_map_blocks *map, - int ret), - - TP_ARGS(inode, flags, map, ret), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(unsigned int, flags, flags) - ctf_integer(ext4_fsblk_t, pblk, map->m_pblk) - ctf_integer(ext4_lblk_t, lblk, map->m_lblk) - ctf_integer(unsigned int, len, map->m_len) - ctf_integer(unsigned int, mflags, map->m_flags) - ctf_integer(int, ret, ret) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__map_blocks_exit, ext4_ext_map_blocks_exit, - TP_PROTO(struct inode *inode, unsigned flags, - struct ext4_map_blocks *map, int ret), - - TP_ARGS(inode, flags, map, ret) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__map_blocks_exit, ext4_ind_map_blocks_exit, - TP_PROTO(struct inode *inode, unsigned flags, - struct ext4_map_blocks *map, int ret), - - TP_ARGS(inode, flags, map, ret) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) - -LTTNG_TRACEPOINT_EVENT_CLASS(ext4__map_blocks_exit, - TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int ret), - - TP_ARGS(inode, map, ret), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_fsblk_t, pblk, map->m_pblk) - ctf_integer(ext4_lblk_t, lblk, map->m_lblk) - ctf_integer(unsigned int, len, map->m_len) - ctf_integer(unsigned int, mflags, map->m_flags) - ctf_integer(int, ret, ret) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__map_blocks_exit, ext4_ext_map_blocks_exit, - TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int ret), - - TP_ARGS(inode, map, ret) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__map_blocks_exit, ext4_ind_map_blocks_exit, - TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int ret), - - TP_ARGS(inode, map, ret) -) - -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */ - -LTTNG_TRACEPOINT_EVENT_CLASS(ext4__map_blocks_exit, - TP_PROTO(struct inode *inode, ext4_lblk_t lblk, - ext4_fsblk_t pblk, unsigned int len, int ret), - - TP_ARGS(inode, lblk, pblk, len, ret), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_fsblk_t, pblk, pblk) - ctf_integer(ext4_lblk_t, lblk, lblk) - ctf_integer(unsigned int, len, len) - ctf_integer(int, ret, ret) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__map_blocks_exit, ext4_ext_map_blocks_exit, - TP_PROTO(struct inode *inode, ext4_lblk_t lblk, - ext4_fsblk_t pblk, unsigned len, int ret), - - TP_ARGS(inode, lblk, pblk, len, ret) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__map_blocks_exit, ext4_ind_map_blocks_exit, - TP_PROTO(struct inode *inode, ext4_lblk_t lblk, - ext4_fsblk_t pblk, unsigned len, int ret), - - TP_ARGS(inode, lblk, pblk, len, ret) -) - -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */ - -LTTNG_TRACEPOINT_EVENT(ext4_ext_load_extent, - TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk), - - TP_ARGS(inode, lblk, pblk), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_fsblk_t, pblk, pblk) - ctf_integer(ext4_lblk_t, lblk, lblk) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_load_inode, - TP_PROTO(struct inode *inode), - - TP_ARGS(inode), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) - -LTTNG_TRACEPOINT_EVENT(ext4_journal_start, - TP_PROTO(struct super_block *sb, int blocks, int rsv_blocks, - int revoke_creds, unsigned long IP), - - TP_ARGS(sb, blocks, rsv_blocks, revoke_creds, IP), - - TP_FIELDS( - ctf_integer(dev_t, dev, sb->s_dev) - ctf_integer_hex(unsigned long, ip, IP) - ctf_integer(int, blocks, blocks) - ctf_integer(int, rsv_blocks, rsv_blocks) - ctf_integer(int, revoke_creds, revoke_creds) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_journal_start_reserved, - TP_PROTO(struct super_block *sb, int blocks, unsigned long IP), - - TP_ARGS(sb, blocks, IP), - - TP_FIELDS( - ctf_integer(dev_t, dev, sb->s_dev) - ctf_integer_hex(unsigned long, ip, IP) - ctf_integer(int, blocks, blocks) - ) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) - -LTTNG_TRACEPOINT_EVENT(ext4_journal_start, - TP_PROTO(struct super_block *sb, int blocks, int rsv_blocks, - unsigned long IP), - - TP_ARGS(sb, blocks, rsv_blocks, IP), - - TP_FIELDS( - ctf_integer(dev_t, dev, sb->s_dev) - ctf_integer_hex(unsigned long, ip, IP) - ctf_integer(int, blocks, blocks) - ctf_integer(int, rsv_blocks, rsv_blocks) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_journal_start_reserved, - TP_PROTO(struct super_block *sb, int blocks, unsigned long IP), - - TP_ARGS(sb, blocks, IP), - - TP_FIELDS( - ctf_integer(dev_t, dev, sb->s_dev) - ctf_integer_hex(unsigned long, ip, IP) - ctf_integer(int, blocks, blocks) - ) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) - -LTTNG_TRACEPOINT_EVENT(ext4_journal_start, - TP_PROTO(struct super_block *sb, int nblocks, unsigned long IP), - - TP_ARGS(sb, nblocks, IP), - - TP_FIELDS( - ctf_integer(dev_t, dev, sb->s_dev) - ctf_integer_hex(unsigned long, ip, IP) - ctf_integer(int, nblocks, nblocks) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(ext4__trim, - TP_PROTO(struct super_block *sb, - ext4_group_t group, - ext4_grpblk_t start, - ext4_grpblk_t len), - - TP_ARGS(sb, group, start, len), - - TP_FIELDS( - ctf_integer(int, dev_major, MAJOR(sb->s_dev)) - ctf_integer(int, dev_minor, MINOR(sb->s_dev)) - ctf_integer(__u32, group, group) - ctf_integer(int, start, start) - ctf_integer(int, len, len) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__trim, ext4_trim_extent, - - TP_PROTO(struct super_block *sb, - ext4_group_t group, - ext4_grpblk_t start, - ext4_grpblk_t len), - - TP_ARGS(sb, group, start, len) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__trim, ext4_trim_all_free, - - TP_PROTO(struct super_block *sb, - ext4_group_t group, - ext4_grpblk_t start, - ext4_grpblk_t len), - - TP_ARGS(sb, group, start, len) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) - -LTTNG_TRACEPOINT_EVENT(ext4_ext_handle_uninitialized_extents, -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) - TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int flags, - unsigned int allocated, ext4_fsblk_t newblock), - - TP_ARGS(inode, map, flags, allocated, newblock), -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */ - TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, - unsigned int allocated, ext4_fsblk_t newblock), - - TP_ARGS(inode, map, allocated, newblock), -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */ - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) - ctf_integer(int, flags, flags) -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */ - ctf_integer(int, flags, map->m_flags) -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) */ - ctf_integer(ext4_lblk_t, lblk, map->m_lblk) - ctf_integer(ext4_fsblk_t, pblk, map->m_pblk) - ctf_integer(unsigned int, len, map->m_len) - ctf_integer(unsigned int, allocated, allocated) - ctf_integer(ext4_fsblk_t, newblk, newblock) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_get_implied_cluster_alloc_exit, - TP_PROTO(struct super_block *sb, struct ext4_map_blocks *map, int ret), - - TP_ARGS(sb, map, ret), - - TP_FIELDS( - ctf_integer(dev_t, dev, sb->s_dev) - ctf_integer(unsigned int, flags, map->m_flags) - ctf_integer(ext4_lblk_t, lblk, map->m_lblk) - ctf_integer(ext4_fsblk_t, pblk, map->m_pblk) - ctf_integer(unsigned int, len, map->m_len) - ctf_integer(int, ret, ret) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_ext_put_in_cache, - TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len, - ext4_fsblk_t start), - - TP_ARGS(inode, lblk, len, start), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_lblk_t, lblk, lblk) - ctf_integer(unsigned int, len, len) - ctf_integer(ext4_fsblk_t, start, start) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_ext_in_cache, - TP_PROTO(struct inode *inode, ext4_lblk_t lblk, int ret), - - TP_ARGS(inode, lblk, ret), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_lblk_t, lblk, lblk) - ctf_integer(int, ret, ret) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_find_delalloc_range, - TP_PROTO(struct inode *inode, ext4_lblk_t from, ext4_lblk_t to, - int reverse, int found, ext4_lblk_t found_blk), - - TP_ARGS(inode, from, to, reverse, found, found_blk), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_lblk_t, from, from) - ctf_integer(ext4_lblk_t, to, to) - ctf_integer(int, reverse, reverse) - ctf_integer(int, found, found) - ctf_integer(ext4_lblk_t, found_blk, found_blk) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_get_reserved_cluster_alloc, - TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len), - - TP_ARGS(inode, lblk, len), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_lblk_t, lblk, lblk) - ctf_integer(unsigned int, len, len) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_ext_show_extent, - TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk, - unsigned short len), - - TP_ARGS(inode, lblk, pblk, len), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_fsblk_t, pblk, pblk) - ctf_integer(ext4_lblk_t, lblk, lblk) - ctf_integer(unsigned short, len, len) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \ - LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0)) - -LTTNG_TRACEPOINT_EVENT(ext4_remove_blocks, - TP_PROTO(struct inode *inode, struct ext4_extent *ex, - ext4_lblk_t from, ext4_fsblk_t to, - struct partial_cluster *pc), - - TP_ARGS(inode, ex, from, to, pc), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_lblk_t, from, from) - ctf_integer(ext4_lblk_t, to, to) - ctf_integer(ext4_fsblk_t, ee_pblk, ext4_ext_pblock(ex)) - ctf_integer(ext4_lblk_t, ee_lblk, le32_to_cpu(ex->ee_block)) - ctf_integer(unsigned short, ee_len, ext4_ext_get_actual_len(ex)) - ctf_integer(ext4_fsblk_t, pc_pclu, pc->pclu) - ctf_integer(ext4_lblk_t, pc_lblk, pc->lblk) - ctf_integer(int, pc_state, pc->state) - ) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) - -LTTNG_TRACEPOINT_EVENT(ext4_remove_blocks, - TP_PROTO(struct inode *inode, struct ext4_extent *ex, - ext4_lblk_t from, ext4_fsblk_t to, - long long partial_cluster), - - TP_ARGS(inode, ex, from, to, partial_cluster), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_lblk_t, from, from) - ctf_integer(ext4_lblk_t, to, to) - ctf_integer(long long, partial, partial_cluster) - ctf_integer(ext4_fsblk_t, ee_pblk, ext4_ext_pblock(ex)) - ctf_integer(ext4_lblk_t, ee_lblk, le32_to_cpu(ex->ee_block)) - ctf_integer(unsigned short, ee_len, ext4_ext_get_actual_len(ex)) - ) -) - -#else - -LTTNG_TRACEPOINT_EVENT(ext4_remove_blocks, - TP_PROTO(struct inode *inode, struct ext4_extent *ex, - ext4_lblk_t from, ext4_fsblk_t to, - ext4_fsblk_t partial_cluster), - - TP_ARGS(inode, ex, from, to, partial_cluster), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_lblk_t, from, from) - ctf_integer(ext4_lblk_t, to, to) - ctf_integer(ext4_fsblk_t, partial, partial_cluster) - ctf_integer(ext4_fsblk_t, ee_pblk, ext4_ext_pblock(ex)) - ctf_integer(ext4_lblk_t, ee_lblk, le32_to_cpu(ex->ee_block)) - ctf_integer(unsigned short, ee_len, ext4_ext_get_actual_len(ex)) - ) -) - -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \ - LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0)) - -LTTNG_TRACEPOINT_EVENT(ext4_ext_rm_leaf, - TP_PROTO(struct inode *inode, ext4_lblk_t start, - struct ext4_extent *ex, - struct partial_cluster *pc), - - TP_ARGS(inode, start, ex, pc), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_lblk_t, start, start) - ctf_integer(ext4_lblk_t, ee_lblk, le32_to_cpu(ex->ee_block)) - ctf_integer(ext4_fsblk_t, ee_pblk, ext4_ext_pblock(ex)) - ctf_integer(short, ee_len, ext4_ext_get_actual_len(ex)) - ctf_integer(ext4_fsblk_t, pc_pclu, pc->pclu) - ctf_integer(ext4_lblk_t, pc_lblk, pc->lblk) - ctf_integer(int, pc_state, pc->state) - ) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) - -LTTNG_TRACEPOINT_EVENT(ext4_ext_rm_leaf, - TP_PROTO(struct inode *inode, ext4_lblk_t start, - struct ext4_extent *ex, - long long partial_cluster), - - TP_ARGS(inode, start, ex, partial_cluster), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(long long, partial, partial_cluster) - ctf_integer(ext4_lblk_t, start, start) - ctf_integer(ext4_lblk_t, ee_lblk, le32_to_cpu(ex->ee_block)) - ctf_integer(ext4_fsblk_t, ee_pblk, ext4_ext_pblock(ex)) - ctf_integer(short, ee_len, ext4_ext_get_actual_len(ex)) - ) -) - -#else - -LTTNG_TRACEPOINT_EVENT(ext4_ext_rm_leaf, - TP_PROTO(struct inode *inode, ext4_lblk_t start, - struct ext4_extent *ex, ext4_fsblk_t partial_cluster), - - TP_ARGS(inode, start, ex, partial_cluster), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(long long, partial, partial_cluster) - ctf_integer(ext4_lblk_t, start, start) - ctf_integer(ext4_lblk_t, ee_lblk, le32_to_cpu(ex->ee_block)) - ctf_integer(ext4_fsblk_t, ee_pblk, ext4_ext_pblock(ex)) - ctf_integer(short, ee_len, ext4_ext_get_actual_len(ex)) - ) -) - -#endif - -LTTNG_TRACEPOINT_EVENT(ext4_ext_rm_idx, - TP_PROTO(struct inode *inode, ext4_fsblk_t pblk), - - TP_ARGS(inode, pblk), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_fsblk_t, pblk, pblk) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) - -LTTNG_TRACEPOINT_EVENT(ext4_ext_remove_space, - TP_PROTO(struct inode *inode, ext4_lblk_t start, - ext4_lblk_t end, int depth), - - TP_ARGS(inode, start, end, depth), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_lblk_t, start, start) - ctf_integer(ext4_lblk_t, end, end) - ctf_integer(int, depth, depth) - ) -) - -#else - -LTTNG_TRACEPOINT_EVENT(ext4_ext_remove_space, - TP_PROTO(struct inode *inode, ext4_lblk_t start, int depth), - - TP_ARGS(inode, start, depth), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_lblk_t, start, start) - ctf_integer(int, depth, depth) - ) -) - -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \ - LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0)) - -LTTNG_TRACEPOINT_EVENT(ext4_ext_remove_space_done, - TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t end, - int depth, struct partial_cluster *pc, __le16 eh_entries), - - TP_ARGS(inode, start, end, depth, pc, eh_entries), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_lblk_t, start, start) - ctf_integer(ext4_lblk_t, end, end) - ctf_integer(int, depth, depth) - ctf_integer(unsigned short, eh_entries, le16_to_cpu(eh_entries)) - ctf_integer(ext4_fsblk_t, pc_pclu, pc->pclu) - ctf_integer(ext4_lblk_t, pc_lblk, pc->lblk) - ctf_integer(int, pc_state, pc->state) - ) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) - -LTTNG_TRACEPOINT_EVENT(ext4_ext_remove_space_done, - TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t end, - int depth, long long partial, __le16 eh_entries), - - TP_ARGS(inode, start, end, depth, partial, eh_entries), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_lblk_t, start, start) - ctf_integer(ext4_lblk_t, end, end) - ctf_integer(int, depth, depth) - ctf_integer(long long, partial, partial) - ctf_integer(unsigned short, eh_entries, le16_to_cpu(eh_entries)) - ) -) - -#else - -LTTNG_TRACEPOINT_EVENT(ext4_ext_remove_space_done, - TP_PROTO(struct inode *inode, ext4_lblk_t start, int depth, - ext4_lblk_t partial, unsigned short eh_entries), - - TP_ARGS(inode, start, depth, partial, eh_entries), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_lblk_t, start, start) - ctf_integer(int, depth, depth) - ctf_integer(ext4_lblk_t, partial, partial) - ctf_integer(unsigned short, eh_entries, eh_entries) - ) -) - -#endif - -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) - -LTTNG_TRACEPOINT_EVENT_CLASS(ext4__es_extent, - TP_PROTO(struct inode *inode, struct extent_status *es), - - TP_ARGS(inode, es), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_lblk_t, lblk, es->es_lblk) - ctf_integer(ext4_lblk_t, len, es->es_len) - ctf_integer(ext4_fsblk_t, pblk, ext4_es_pblock(es)) - ctf_integer(char, status, ext4_es_status(es)) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__es_extent, ext4_es_insert_extent, - TP_PROTO(struct inode *inode, struct extent_status *es), - - TP_ARGS(inode, es) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(ext4__es_extent, ext4_es_cache_extent, - TP_PROTO(struct inode *inode, struct extent_status *es), - - TP_ARGS(inode, es) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) - -LTTNG_TRACEPOINT_EVENT(ext4_es_insert_extent, - TP_PROTO(struct inode *inode, struct extent_status *es), - - TP_ARGS(inode, es), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_lblk_t, lblk, es->es_lblk) - ctf_integer(ext4_lblk_t, len, es->es_len) - ctf_integer(ext4_fsblk_t, pblk, ext4_es_pblock(es)) - ctf_integer(char, status, ext4_es_status(es) >> 60) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_es_remove_extent, - TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_lblk_t len), - - TP_ARGS(inode, lblk, len), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(loff_t, lblk, lblk) - ctf_integer(loff_t, len, len) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_es_find_delayed_extent_range_enter, - TP_PROTO(struct inode *inode, ext4_lblk_t lblk), - - TP_ARGS(inode, lblk), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_lblk_t, lblk, lblk) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_es_find_delayed_extent_range_exit, - TP_PROTO(struct inode *inode, struct extent_status *es), - - TP_ARGS(inode, es), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_lblk_t, lblk, es->es_lblk) - ctf_integer(ext4_lblk_t, len, es->es_len) - ctf_integer(ext4_fsblk_t, pblk, ext4_es_pblock(es)) - ctf_integer(char, status, ext4_es_status(es) >> 60) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_es_lookup_extent_enter, - TP_PROTO(struct inode *inode, ext4_lblk_t lblk), - - TP_ARGS(inode, lblk), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_lblk_t, lblk, lblk) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_es_lookup_extent_exit, - TP_PROTO(struct inode *inode, struct extent_status *es, - int found), - - TP_ARGS(inode, es, found), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ctf_integer(ext4_lblk_t, lblk, es->es_lblk) - ctf_integer(ext4_lblk_t, len, es->es_len) - ctf_integer(ext4_fsblk_t, pblk, ext4_es_pblock(es)) - ctf_integer(char, status, ext4_es_status(es) >> 60) - ctf_integer(int, found, found) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_es_shrink_enter, - TP_PROTO(struct super_block *sb, int nr_to_scan, int cache_cnt), - - TP_ARGS(sb, nr_to_scan, cache_cnt), - - TP_FIELDS( - ctf_integer(dev_t, dev, sb->s_dev) - ctf_integer(int, nr_to_scan, nr_to_scan) - ctf_integer(int, cache_cnt, cache_cnt) - ) -) - -LTTNG_TRACEPOINT_EVENT(ext4_es_shrink_exit, - TP_PROTO(struct super_block *sb, int shrunk_nr, int cache_cnt), - - TP_ARGS(sb, shrunk_nr, cache_cnt), - - TP_FIELDS( - ctf_integer(dev_t, dev, sb->s_dev) - ctf_integer(int, shrunk_nr, shrunk_nr) - ctf_integer(int, cache_cnt, cache_cnt) - ) -) - -#endif - -#endif /* LTTNG_TRACE_EXT4_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/gpio.h b/include/instrumentation/events/lttng-module/gpio.h deleted file mode 100644 index 97e5e847..00000000 --- a/include/instrumentation/events/lttng-module/gpio.h +++ /dev/null @@ -1,39 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM gpio - -#if !defined(LTTNG_TRACE_GPIO_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_GPIO_H - -#include - -LTTNG_TRACEPOINT_EVENT(gpio_direction, - - TP_PROTO(unsigned gpio, int in, int err), - - TP_ARGS(gpio, in, err), - - TP_FIELDS( - ctf_integer(unsigned, gpio, gpio) - ctf_integer(int, in, in) - ctf_integer(int, err, err) - ) -) - -LTTNG_TRACEPOINT_EVENT(gpio_value, - - TP_PROTO(unsigned gpio, int get, int value), - - TP_ARGS(gpio, get, value), - - TP_FIELDS( - ctf_integer(unsigned, gpio, gpio) - ctf_integer(int, get, get) - ctf_integer(int, value, value) - ) -) - -#endif /* if !defined(LTTNG_TRACE_GPIO_H) || defined(TRACE_HEADER_MULTI_READ) */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/i2c.h b/include/instrumentation/events/lttng-module/i2c.h deleted file mode 100644 index 312f6733..00000000 --- a/include/instrumentation/events/lttng-module/i2c.h +++ /dev/null @@ -1,120 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM i2c - -#if !defined(LTTNG_TRACE_I2C_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_I2C_H - -#include - -/* - * __i2c_transfer() write request - */ -LTTNG_TRACEPOINT_EVENT_CODE(i2c_write, - - TP_PROTO(const struct i2c_adapter *adap, const struct i2c_msg *msg, - int num), - - TP_ARGS(adap, msg, num), - - TP_locvar( - int extract_sensitive_payload; - ), - - TP_code_pre( - tp_locvar->extract_sensitive_payload = - READ_ONCE(extract_sensitive_payload); - ), - - TP_FIELDS( - ctf_integer(int, adapter_nr, adap->nr) - ctf_integer(__u16, msg_nr, num) - ctf_integer(__u16, addr, msg->addr) - ctf_integer(__u16, flags, msg->flags) - ctf_integer(__u16, len, msg->len) - ctf_sequence_hex(__u8, buf, - tp_locvar->extract_sensitive_payload ? - msg->buf : NULL, - __u16, - tp_locvar->extract_sensitive_payload ? - msg->len : 0) - ), - - TP_code_post() -) - -/* - * __i2c_transfer() read request - */ -LTTNG_TRACEPOINT_EVENT(i2c_read, - - TP_PROTO(const struct i2c_adapter *adap, const struct i2c_msg *msg, - int num), - - TP_ARGS(adap, msg, num), - - TP_FIELDS( - ctf_integer(int, adapter_nr, adap->nr) - ctf_integer(__u16, msg_nr, num) - ctf_integer(__u16, addr, msg->addr) - ctf_integer(__u16, flags, msg->flags) - ctf_integer(__u16, len, msg->len) - ) -) - -/* - * __i2c_transfer() read reply - */ -LTTNG_TRACEPOINT_EVENT_CODE(i2c_reply, - - TP_PROTO(const struct i2c_adapter *adap, const struct i2c_msg *msg, - int num), - - TP_ARGS(adap, msg, num), - - TP_locvar( - int extract_sensitive_payload; - ), - - TP_code_pre( - tp_locvar->extract_sensitive_payload = - READ_ONCE(extract_sensitive_payload); - ), - - TP_FIELDS( - ctf_integer(int, adapter_nr, adap->nr) - ctf_integer(__u16, msg_nr, num) - ctf_integer(__u16, addr, msg->addr) - ctf_integer(__u16, flags, msg->flags) - ctf_integer(__u16, len, msg->len) - ctf_sequence_hex(__u8, buf, - tp_locvar->extract_sensitive_payload ? - msg->buf : NULL, - __u16, - tp_locvar->extract_sensitive_payload ? - msg->len : 0) - ), - - TP_code_post() -) - -/* - * __i2c_transfer() result - */ -LTTNG_TRACEPOINT_EVENT(i2c_result, - - TP_PROTO(const struct i2c_adapter *adap, int num, int ret), - - TP_ARGS(adap, num, ret), - - TP_FIELDS( - ctf_integer(int, adapter_nr, adap->nr) - ctf_integer(__u16, nr_msgs, num) - ctf_integer(__s16, ret, ret) - ) -) - -#endif /* LTTNG_TRACE_I2C_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/irq.h b/include/instrumentation/events/lttng-module/irq.h deleted file mode 100644 index a66b8139..00000000 --- a/include/instrumentation/events/lttng-module/irq.h +++ /dev/null @@ -1,126 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM irq - -#if !defined(LTTNG_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_IRQ_H - -#include - -#ifndef _TRACE_IRQ_DEF_ -#define _TRACE_IRQ_DEF_ - -struct irqaction; -struct softirq_action; - -#endif /* _TRACE_IRQ_DEF_ */ - -/** - * irq_handler_entry - called immediately before the irq action handler - * @irq: irq number - * @action: pointer to struct irqaction - * - * The struct irqaction pointed to by @action contains various - * information about the handler, including the device name, - * @action->name, and the device id, @action->dev_id. When used in - * conjunction with the irq_handler_exit tracepoint, we can figure - * out irq handler latencies. - */ -LTTNG_TRACEPOINT_EVENT(irq_handler_entry, - - TP_PROTO(int irq, struct irqaction *action), - - TP_ARGS(irq, action), - - TP_FIELDS( - ctf_integer(int, irq, irq) - ctf_string(name, action->name) - ) -) - -/** - * irq_handler_exit - called immediately after the irq action handler returns - * @irq: irq number - * @action: pointer to struct irqaction - * @ret: return value - * - * If the @ret value is set to IRQ_HANDLED, then we know that the corresponding - * @action->handler scuccessully handled this irq. Otherwise, the irq might be - * a shared irq line, or the irq was not handled successfully. Can be used in - * conjunction with the irq_handler_entry to understand irq handler latencies. - */ -LTTNG_TRACEPOINT_EVENT(irq_handler_exit, - - TP_PROTO(int irq, struct irqaction *action, int ret), - - TP_ARGS(irq, action, ret), - - TP_FIELDS( - ctf_integer(int, irq, irq) - ctf_integer(int, ret, ret) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(irq_softirq, - - TP_PROTO(unsigned int vec_nr), - - TP_ARGS(vec_nr), - - TP_FIELDS( - ctf_integer(unsigned int, vec, vec_nr) - ) -) - -/** - * softirq_entry - called immediately before the softirq handler - * @vec_nr: softirq vector number - * - * When used in combination with the softirq_exit tracepoint - * we can determine the softirq handler runtine. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(irq_softirq, softirq_entry, - - irq_softirq_entry, - - TP_PROTO(unsigned int vec_nr), - - TP_ARGS(vec_nr) -) - -/** - * softirq_exit - called immediately after the softirq handler returns - * @vec_nr: softirq vector number - * - * When used in combination with the softirq_entry tracepoint - * we can determine the softirq handler runtine. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(irq_softirq, softirq_exit, - - irq_softirq_exit, - - TP_PROTO(unsigned int vec_nr), - - TP_ARGS(vec_nr) -) - -/** - * softirq_raise - called immediately when a softirq is raised - * @vec_nr: softirq vector number - * - * When used in combination with the softirq_entry tracepoint - * we can determine the softirq raise to run latency. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(irq_softirq, softirq_raise, - - irq_softirq_raise, - - TP_PROTO(unsigned int vec_nr), - - TP_ARGS(vec_nr) -) - -#endif /* LTTNG_TRACE_IRQ_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/jbd.h b/include/instrumentation/events/lttng-module/jbd.h deleted file mode 100644 index e9aabd69..00000000 --- a/include/instrumentation/events/lttng-module/jbd.h +++ /dev/null @@ -1,157 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM jbd - -#if !defined(LTTNG_TRACE_JBD_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_JBD_H - -#include -#include -#include - -LTTNG_TRACEPOINT_EVENT(jbd_checkpoint, - - TP_PROTO(journal_t *journal, int result), - - TP_ARGS(journal, result), - - TP_FIELDS( - ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) - ctf_integer(int, result, result) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(jbd_commit, - - TP_PROTO(journal_t *journal, transaction_t *commit_transaction), - - TP_ARGS(journal, commit_transaction), - - TP_FIELDS( - ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) - ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit) -#endif - ctf_integer(int, transaction, commit_transaction->t_tid) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd_commit, jbd_start_commit, - - TP_PROTO(journal_t *journal, transaction_t *commit_transaction), - - TP_ARGS(journal, commit_transaction) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd_commit, jbd_commit_locking, - - TP_PROTO(journal_t *journal, transaction_t *commit_transaction), - - TP_ARGS(journal, commit_transaction) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd_commit, jbd_commit_flushing, - - TP_PROTO(journal_t *journal, transaction_t *commit_transaction), - - TP_ARGS(journal, commit_transaction) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd_commit, jbd_commit_logging, - - TP_PROTO(journal_t *journal, transaction_t *commit_transaction), - - TP_ARGS(journal, commit_transaction) -) - -LTTNG_TRACEPOINT_EVENT(jbd_drop_transaction, - - TP_PROTO(journal_t *journal, transaction_t *commit_transaction), - - TP_ARGS(journal, commit_transaction), - - TP_FIELDS( - ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) - ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit) -#endif - ctf_integer(int, transaction, commit_transaction->t_tid) - ) -) - -LTTNG_TRACEPOINT_EVENT(jbd_end_commit, - TP_PROTO(journal_t *journal, transaction_t *commit_transaction), - - TP_ARGS(journal, commit_transaction), - - TP_FIELDS( - ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) - ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit) -#endif - ctf_integer(int, transaction, commit_transaction->t_tid) - ctf_integer(int, head, journal->j_tail_sequence) - ) -) - -LTTNG_TRACEPOINT_EVENT(jbd_do_submit_data, - TP_PROTO(journal_t *journal, transaction_t *commit_transaction), - - TP_ARGS(journal, commit_transaction), - - TP_FIELDS( - ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) - ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit) -#endif - ctf_integer(int, transaction, commit_transaction->t_tid) - ) -) - -LTTNG_TRACEPOINT_EVENT(jbd_cleanup_journal_tail, - - TP_PROTO(journal_t *journal, tid_t first_tid, - unsigned long block_nr, unsigned long freed), - - TP_ARGS(journal, first_tid, block_nr, freed), - - TP_FIELDS( - ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) - ctf_integer(tid_t, tail_sequence, journal->j_tail_sequence) - ctf_integer(tid_t, first_tid, first_tid) - ctf_integer(unsigned long, block_nr, block_nr) - ctf_integer(unsigned long, freed, freed) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) -LTTNG_TRACEPOINT_EVENT_MAP(journal_write_superblock, - - jbd_journal_write_superblock, - - TP_PROTO(journal_t *journal, int write_op), - - TP_ARGS(journal, write_op), - - TP_FIELDS( - ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) - ctf_integer(int, write_op, write_op) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(jbd_update_superblock_end, - TP_PROTO(journal_t *journal, int wait), - - TP_ARGS(journal, wait), - - TP_FIELDS( - ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) - ctf_integer(int, wait, wait) - ) -) -#endif - -#endif /* LTTNG_TRACE_JBD_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/jbd2.h b/include/instrumentation/events/lttng-module/jbd2.h deleted file mode 100644 index 04968735..00000000 --- a/include/instrumentation/events/lttng-module/jbd2.h +++ /dev/null @@ -1,177 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM jbd2 - -#if !defined(LTTNG_TRACE_JBD2_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_JBD2_H - -#include -#include -#include - -#ifndef _TRACE_JBD2_DEF -#define _TRACE_JBD2_DEF -struct transaction_chp_stats_s; -struct transaction_run_stats_s; -#endif - -LTTNG_TRACEPOINT_EVENT(jbd2_checkpoint, - - TP_PROTO(journal_t *journal, int result), - - TP_ARGS(journal, result), - - TP_FIELDS( - ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) - ctf_integer(int, result, result) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(jbd2_commit, - - TP_PROTO(journal_t *journal, transaction_t *commit_transaction), - - TP_ARGS(journal, commit_transaction), - - TP_FIELDS( - ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) - ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit) - ctf_integer(int, transaction, commit_transaction->t_tid) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_start_commit, - - TP_PROTO(journal_t *journal, transaction_t *commit_transaction), - - TP_ARGS(journal, commit_transaction) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_commit_locking, - - TP_PROTO(journal_t *journal, transaction_t *commit_transaction), - - TP_ARGS(journal, commit_transaction) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_commit_flushing, - - TP_PROTO(journal_t *journal, transaction_t *commit_transaction), - - TP_ARGS(journal, commit_transaction) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_commit_logging, - - TP_PROTO(journal_t *journal, transaction_t *commit_transaction), - - TP_ARGS(journal, commit_transaction) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) -LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_drop_transaction, - - TP_PROTO(journal_t *journal, transaction_t *commit_transaction), - - TP_ARGS(journal, commit_transaction) -) -#endif - -LTTNG_TRACEPOINT_EVENT(jbd2_end_commit, - TP_PROTO(journal_t *journal, transaction_t *commit_transaction), - - TP_ARGS(journal, commit_transaction), - - TP_FIELDS( - ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) - ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit) - ctf_integer(int, transaction, commit_transaction->t_tid) - ctf_integer(int, head, journal->j_tail_sequence) - ) -) - -LTTNG_TRACEPOINT_EVENT(jbd2_submit_inode_data, - TP_PROTO(struct inode *inode), - - TP_ARGS(inode), - - TP_FIELDS( - ctf_integer(dev_t, dev, inode->i_sb->s_dev) - ctf_integer(ino_t, ino, inode->i_ino) - ) -) - -LTTNG_TRACEPOINT_EVENT(jbd2_run_stats, - TP_PROTO(dev_t dev, unsigned long tid, - struct transaction_run_stats_s *stats), - - TP_ARGS(dev, tid, stats), - - TP_FIELDS( - ctf_integer(dev_t, dev, dev) - ctf_integer(unsigned long, tid, tid) - ctf_integer(unsigned long, wait, stats->rs_wait) - ctf_integer(unsigned long, running, stats->rs_running) - ctf_integer(unsigned long, locked, stats->rs_locked) - ctf_integer(unsigned long, flushing, stats->rs_flushing) - ctf_integer(unsigned long, logging, stats->rs_logging) - ctf_integer(__u32, handle_count, stats->rs_handle_count) - ctf_integer(__u32, blocks, stats->rs_blocks) - ctf_integer(__u32, blocks_logged, stats->rs_blocks_logged) - ) -) - -LTTNG_TRACEPOINT_EVENT(jbd2_checkpoint_stats, - TP_PROTO(dev_t dev, unsigned long tid, - struct transaction_chp_stats_s *stats), - - TP_ARGS(dev, tid, stats), - - TP_FIELDS( - ctf_integer(dev_t, dev, dev) - ctf_integer(unsigned long, tid, tid) - ctf_integer(unsigned long, chp_time, stats->cs_chp_time) - ctf_integer(__u32, forced_to_close, stats->cs_forced_to_close) - ctf_integer(__u32, written, stats->cs_written) - ctf_integer(__u32, dropped, stats->cs_dropped) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) -LTTNG_TRACEPOINT_EVENT(jbd2_update_log_tail, -#else -LTTNG_TRACEPOINT_EVENT(jbd2_cleanup_journal_tail, -#endif - - TP_PROTO(journal_t *journal, tid_t first_tid, - unsigned long block_nr, unsigned long freed), - - TP_ARGS(journal, first_tid, block_nr, freed), - - TP_FIELDS( - ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) - ctf_integer(tid_t, tail_sequence, journal->j_tail_sequence) - ctf_integer(tid_t, first_tid, first_tid) - ctf_integer(unsigned long, block_nr, block_nr) - ctf_integer(unsigned long, freed, freed) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) -LTTNG_TRACEPOINT_EVENT(jbd2_write_superblock, - - TP_PROTO(journal_t *journal, int write_op), - - TP_ARGS(journal, write_op), - - TP_FIELDS( - ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) - ctf_integer(int, write_op, write_op) - ) -) -#endif - -#endif /* LTTNG_TRACE_JBD2_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/kmem.h b/include/instrumentation/events/lttng-module/kmem.h deleted file mode 100644 index 8f56cc5a..00000000 --- a/include/instrumentation/events/lttng-module/kmem.h +++ /dev/null @@ -1,338 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM kmem - -#if !defined(LTTNG_TRACE_KMEM_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_KMEM_H - -#include -#include -#include - -LTTNG_TRACEPOINT_EVENT_CLASS(kmem_alloc, - - TP_PROTO(unsigned long call_site, - const void *ptr, - size_t bytes_req, - size_t bytes_alloc, - gfp_t gfp_flags), - - TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags), - - TP_FIELDS( - ctf_integer_hex(unsigned long, call_site, call_site) - ctf_integer_hex(const void *, ptr, ptr) - ctf_integer(size_t, bytes_req, bytes_req) - ctf_integer(size_t, bytes_alloc, bytes_alloc) - ctf_integer(gfp_t, gfp_flags, gfp_flags) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(kmem_alloc, kmalloc, - - kmem_kmalloc, - - TP_PROTO(unsigned long call_site, const void *ptr, - size_t bytes_req, size_t bytes_alloc, gfp_t gfp_flags), - - TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(kmem_alloc, kmem_cache_alloc, - - TP_PROTO(unsigned long call_site, const void *ptr, - size_t bytes_req, size_t bytes_alloc, gfp_t gfp_flags), - - TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(kmem_alloc_node, - - TP_PROTO(unsigned long call_site, - const void *ptr, - size_t bytes_req, - size_t bytes_alloc, - gfp_t gfp_flags, - int node), - - TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node), - - TP_FIELDS( - ctf_integer_hex(unsigned long, call_site, call_site) - ctf_integer_hex(const void *, ptr, ptr) - ctf_integer(size_t, bytes_req, bytes_req) - ctf_integer(size_t, bytes_alloc, bytes_alloc) - ctf_integer(gfp_t, gfp_flags, gfp_flags) - ctf_integer(int, node, node) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(kmem_alloc_node, kmalloc_node, - - kmem_kmalloc_node, - - TP_PROTO(unsigned long call_site, const void *ptr, - size_t bytes_req, size_t bytes_alloc, - gfp_t gfp_flags, int node), - - TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(kmem_alloc_node, kmem_cache_alloc_node, - - TP_PROTO(unsigned long call_site, const void *ptr, - size_t bytes_req, size_t bytes_alloc, - gfp_t gfp_flags, int node), - - TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(kmem_free, - - TP_PROTO(unsigned long call_site, const void *ptr), - - TP_ARGS(call_site, ptr), - - TP_FIELDS( - ctf_integer_hex(unsigned long, call_site, call_site) - ctf_integer_hex(const void *, ptr, ptr) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(kmem_free, kfree, - - kmem_kfree, - - TP_PROTO(unsigned long call_site, const void *ptr), - - TP_ARGS(call_site, ptr) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(kmem_free, kmem_cache_free, - - TP_PROTO(unsigned long call_site, const void *ptr), - - TP_ARGS(call_site, ptr) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) -LTTNG_TRACEPOINT_EVENT_MAP(mm_page_free, kmem_mm_page_free, -#else -LTTNG_TRACEPOINT_EVENT_MAP(mm_page_free_direct, kmem_mm_page_free_direct, -#endif - - TP_PROTO(struct page *page, unsigned int order), - - TP_ARGS(page, order), - - TP_FIELDS( - ctf_integer_hex(struct page *, page, page) - ctf_integer(unsigned long, pfn, page_to_pfn(page)) - ctf_integer(unsigned int, order, order) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) -LTTNG_TRACEPOINT_EVENT_MAP(mm_page_free_batched, kmem_mm_page_free_batched, - - TP_PROTO(struct page *page), - - TP_ARGS(page), - - TP_FIELDS( - ctf_integer_hex(struct page *, page, page) - ctf_integer(unsigned long, pfn, page_to_pfn(page)) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) -LTTNG_TRACEPOINT_EVENT_MAP(mm_page_free_batched, kmem_mm_page_free_batched, - - TP_PROTO(struct page *page, int cold), - - TP_ARGS(page, cold), - - TP_FIELDS( - ctf_integer_hex(struct page *, page, page) - ctf_integer(unsigned long, pfn, page_to_pfn(page)) - ctf_integer(int, cold, cold) - ) -) -#else -LTTNG_TRACEPOINT_EVENT_MAP(mm_pagevec_free, kmem_pagevec_free, - - TP_PROTO(struct page *page, int cold), - - TP_ARGS(page, cold), - - TP_FIELDS( - ctf_integer_hex(struct page *, page, page) - ctf_integer(unsigned long, pfn, page_to_pfn(page)) - ctf_integer(int, cold, cold) - ) -) -#endif - -LTTNG_TRACEPOINT_EVENT_MAP(mm_page_alloc, kmem_mm_page_alloc, - - TP_PROTO(struct page *page, unsigned int order, - gfp_t gfp_flags, int migratetype), - - TP_ARGS(page, order, gfp_flags, migratetype), - - TP_FIELDS( - ctf_integer_hex(struct page *, page, page) - ctf_integer(unsigned long, pfn, - page ? page_to_pfn(page) : -1UL) - ctf_integer(unsigned int, order, order) - ctf_integer(gfp_t, gfp_flags, gfp_flags) - ctf_integer(int, migratetype, migratetype) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(kmem_mm_page, - - TP_PROTO(struct page *page, unsigned int order, int migratetype), - - TP_ARGS(page, order, migratetype), - - TP_FIELDS( - ctf_integer_hex(struct page *, page, page) - ctf_integer(unsigned long, pfn, - page ? page_to_pfn(page) : -1UL) - ctf_integer(unsigned int, order, order) - ctf_integer(int, migratetype, migratetype) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(kmem_mm_page, mm_page_alloc_zone_locked, - - kmem_mm_page_alloc_zone_locked, - - TP_PROTO(struct page *page, unsigned int order, int migratetype), - - TP_ARGS(page, order, migratetype) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(kmem_mm_page, mm_page_pcpu_drain, - - kmem_mm_page_pcpu_drain, - - TP_PROTO(struct page *page, unsigned int order, int migratetype), - - TP_ARGS(page, order, migratetype) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,2) \ - || LTTNG_KERNEL_RANGE(3,14,36, 3,15,0) \ - || LTTNG_KERNEL_RANGE(3,16,35, 3,17,0) \ - || LTTNG_KERNEL_RANGE(3,18,10, 3,19,0) \ - || LTTNG_DEBIAN_KERNEL_RANGE(3,16,7,9,0,0, 3,17,0,0,0,0) \ - || LTTNG_UBUNTU_KERNEL_RANGE(3,13,11,50, 3,14,0,0) \ - || LTTNG_UBUNTU_KERNEL_RANGE(3,16,7,34, 3,17,0,0)) - -LTTNG_TRACEPOINT_EVENT_MAP(mm_page_alloc_extfrag, - - kmem_mm_page_alloc_extfrag, - - TP_PROTO(struct page *page, - int alloc_order, int fallback_order, - int alloc_migratetype, int fallback_migratetype), - - TP_ARGS(page, - alloc_order, fallback_order, - alloc_migratetype, fallback_migratetype), - - TP_FIELDS( - ctf_integer_hex(struct page *, page, page) - ctf_integer(unsigned long, pfn, page_to_pfn(page)) - ctf_integer(int, alloc_order, alloc_order) - ctf_integer(int, fallback_order, fallback_order) - ctf_integer(int, alloc_migratetype, alloc_migratetype) - ctf_integer(int, fallback_migratetype, fallback_migratetype) - ctf_integer(int, change_ownership, - (alloc_migratetype == get_pageblock_migratetype(page))) - ) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,30)) - -LTTNG_TRACEPOINT_EVENT_MAP(mm_page_alloc_extfrag, - - kmem_mm_page_alloc_extfrag, - - TP_PROTO(struct page *page, - int alloc_order, int fallback_order, - int alloc_migratetype, int fallback_migratetype, int new_migratetype), - - TP_ARGS(page, - alloc_order, fallback_order, - alloc_migratetype, fallback_migratetype, new_migratetype), - - TP_FIELDS( - ctf_integer_hex(struct page *, page, page) - ctf_integer(unsigned long, pfn, page_to_pfn(page)) - ctf_integer(int, alloc_order, alloc_order) - ctf_integer(int, fallback_order, fallback_order) - ctf_integer(int, alloc_migratetype, alloc_migratetype) - ctf_integer(int, fallback_migratetype, fallback_migratetype) - ctf_integer(int, change_ownership, (new_migratetype == alloc_migratetype)) - ) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) - -LTTNG_TRACEPOINT_EVENT_MAP(mm_page_alloc_extfrag, - - kmem_mm_page_alloc_extfrag, - - TP_PROTO(struct page *page, - int alloc_order, int fallback_order, - int alloc_migratetype, int fallback_migratetype, - int change_ownership), - - TP_ARGS(page, - alloc_order, fallback_order, - alloc_migratetype, fallback_migratetype, - change_ownership), - - TP_FIELDS( - ctf_integer_hex(struct page *, page, page) - ctf_integer(unsigned long, pfn, page_to_pfn(page)) - ctf_integer(int, alloc_order, alloc_order) - ctf_integer(int, fallback_order, fallback_order) - ctf_integer(int, alloc_migratetype, alloc_migratetype) - ctf_integer(int, fallback_migratetype, fallback_migratetype) - ctf_integer(int, change_ownership, change_ownership) - ) -) - -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ - -LTTNG_TRACEPOINT_EVENT_MAP(mm_page_alloc_extfrag, - - kmem_mm_page_alloc_extfrag, - - TP_PROTO(struct page *page, - int alloc_order, int fallback_order, - int alloc_migratetype, int fallback_migratetype), - - TP_ARGS(page, - alloc_order, fallback_order, - alloc_migratetype, fallback_migratetype), - - TP_FIELDS( - ctf_integer_hex(struct page *, page, page) - ctf_integer(unsigned long, pfn, page_to_pfn(page)) - ctf_integer(int, alloc_order, alloc_order) - ctf_integer(int, fallback_order, fallback_order) - ctf_integer(int, alloc_migratetype, alloc_migratetype) - ctf_integer(int, fallback_migratetype, fallback_migratetype) - ) -) - -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ - -#endif /* LTTNG_TRACE_KMEM_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/kvm.h b/include/instrumentation/events/lttng-module/kvm.h deleted file mode 100644 index b05482ee..00000000 --- a/include/instrumentation/events/lttng-module/kvm.h +++ /dev/null @@ -1,274 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#if !defined(LTTNG_TRACE_KVM_MAIN_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_KVM_MAIN_H - -#include -#include - -#undef TRACE_SYSTEM -#define TRACE_SYSTEM kvm - -LTTNG_TRACEPOINT_EVENT(kvm_userspace_exit, - TP_PROTO(__u32 reason, int errno), - TP_ARGS(reason, errno), - - TP_FIELDS( - ctf_integer(__u32, reason, reason) - ctf_integer(int, errno, errno) - ) -) - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0)) -#if defined(__KVM_HAVE_IOAPIC) -#undef __KVM_HAVE_IRQ_LINE -#define __KVM_HAVE_IRQ_LINE -#endif -#endif - -#if defined(__KVM_HAVE_IRQ_LINE) -LTTNG_TRACEPOINT_EVENT(kvm_set_irq, - TP_PROTO(unsigned int gsi, int level, int irq_source_id), - TP_ARGS(gsi, level, irq_source_id), - - TP_FIELDS( - ctf_integer(unsigned int, gsi, gsi) - ctf_integer(int, level, level) - ctf_integer(int, irq_source_id, irq_source_id) - ) -) -#endif - -#if defined(__KVM_HAVE_IOAPIC) - -LTTNG_TRACEPOINT_EVENT(kvm_ioapic_set_irq, - TP_PROTO(__u64 e, int pin, bool coalesced), - TP_ARGS(e, pin, coalesced), - - TP_FIELDS( - ctf_integer(__u64, e, e) - ctf_integer(int, pin, pin) - ctf_integer(bool, coalesced, coalesced) - ) -) - -LTTNG_TRACEPOINT_EVENT(kvm_msi_set_irq, - TP_PROTO(__u64 address, __u64 data), - TP_ARGS(address, data), - - TP_FIELDS( - ctf_integer_hex(__u64, address, address) - ctf_integer(__u64, data, data) - ) -) - -LTTNG_TRACEPOINT_EVENT(kvm_ack_irq, - TP_PROTO(unsigned int irqchip, unsigned int pin), - TP_ARGS(irqchip, pin), - - TP_FIELDS( - ctf_integer(unsigned int, irqchip, irqchip) - ctf_integer(unsigned int, pin, pin) - ) -) - -#endif /* defined(__KVM_HAVE_IOAPIC) */ - -#define KVM_TRACE_MMIO_READ_UNSATISFIED 0 -#define KVM_TRACE_MMIO_READ 1 -#define KVM_TRACE_MMIO_WRITE 2 - -#define kvm_trace_symbol_mmio \ - { KVM_TRACE_MMIO_READ_UNSATISFIED, "unsatisfied-read" }, \ - { KVM_TRACE_MMIO_READ, "read" }, \ - { KVM_TRACE_MMIO_WRITE, "write" } - - -#if (LTTNG_SLE_KERNEL_RANGE(4,4,121,92,92,0, 4,4,122,0,0,0) \ - || LTTNG_SLE_KERNEL_RANGE(4,4,131,94,0,0, 4,5,0,0,0,0)) - -LTTNG_TRACEPOINT_EVENT(kvm_mmio, - TP_PROTO(int type, int len, u64 gpa, u64 val), - TP_ARGS(type, len, gpa, val), - - TP_FIELDS( - ctf_integer(u32, type, type) - ctf_integer(u32, len, len) - ctf_integer(u64, gpa, gpa) - ctf_integer(u64, val, val) - ) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0) \ - || LTTNG_KERNEL_RANGE(4,14,14, 4,15,0) \ - || LTTNG_DEBIAN_KERNEL_RANGE(4,14,13,0,1,0, 4,15,0,0,0,0) \ - || LTTNG_KERNEL_RANGE(4,9,77, 4,10,0) \ - || LTTNG_KERNEL_RANGE(4,4,112, 4,5,0) \ - || LTTNG_KERNEL_RANGE(4,1,50, 4,2,0) \ - || LTTNG_KERNEL_RANGE(3,16,52, 3,17,0) \ - || LTTNG_UBUNTU_KERNEL_RANGE(3,13,11,144, 3,14,0,0) \ - || LTTNG_KERNEL_RANGE(3,2,97, 3,3,0) \ - || LTTNG_UBUNTU_KERNEL_RANGE(4,13,16,38, 4,14,0,0) \ - || LTTNG_DEBIAN_KERNEL_RANGE(4,9,65,0,3,0, 4,10,0,0,0,0) \ - || LTTNG_FEDORA_KERNEL_RANGE(4,14,13,300, 4,15,0,0)) - -LTTNG_TRACEPOINT_EVENT(kvm_mmio, - TP_PROTO(int type, int len, u64 gpa, void *val), - TP_ARGS(type, len, gpa, val), - - TP_FIELDS( - ctf_integer(u32, type, type) - ctf_integer(u32, len, len) - ctf_integer(u64, gpa, gpa) - ctf_sequence_hex(unsigned char, val, val, u32, len) - ) -) - -#else - -LTTNG_TRACEPOINT_EVENT(kvm_mmio, - TP_PROTO(int type, int len, u64 gpa, u64 val), - TP_ARGS(type, len, gpa, val), - - TP_FIELDS( - ctf_integer(u32, type, type) - ctf_integer(u32, len, len) - ctf_integer(u64, gpa, gpa) - ctf_integer(u64, val, val) - ) -) - -#endif - -#define kvm_fpu_load_symbol \ - {0, "unload"}, \ - {1, "load"} - -LTTNG_TRACEPOINT_EVENT(kvm_fpu, - TP_PROTO(int load), - TP_ARGS(load), - - TP_FIELDS( - ctf_integer(u32, load, load) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0) \ - || LTTNG_RHEL_KERNEL_RANGE(3,10,0,327,0,0, 3,11,0,0,0,0)) - -LTTNG_TRACEPOINT_EVENT(kvm_age_page, - TP_PROTO(ulong gfn, int level, struct kvm_memory_slot *slot, int ref), - TP_ARGS(gfn, level, slot, ref), - - TP_FIELDS( - ctf_integer(u64, hva, - ((gfn - slot->base_gfn) << PAGE_SHIFT) + slot->userspace_addr) - ctf_integer(u64, gfn, gfn) - ctf_integer(u8, level, level) - ctf_integer(u8, referenced, ref) - ) -) - -#else - -LTTNG_TRACEPOINT_EVENT(kvm_age_page, - TP_PROTO(ulong hva, struct kvm_memory_slot *slot, int ref), - TP_ARGS(hva, slot, ref), - - TP_FIELDS( - ctf_integer(u64, hva, hva) - ctf_integer(u64, gfn, - slot->base_gfn + ((hva - slot->userspace_addr) >> PAGE_SHIFT)) - ctf_integer(u8, referenced, ref) - ) -) -#endif - -#ifdef CONFIG_KVM_ASYNC_PF -LTTNG_TRACEPOINT_EVENT_CLASS(kvm_async_get_page_class, - - TP_PROTO(u64 gva, u64 gfn), - - TP_ARGS(gva, gfn), - - TP_FIELDS( - ctf_integer(__u64, gva, gva) - ctf_integer(u64, gfn, gfn) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_async_get_page_class, kvm_try_async_get_page, - - TP_PROTO(u64 gva, u64 gfn), - - TP_ARGS(gva, gfn) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_async_get_page_class, kvm_async_pf_doublefault, - - TP_PROTO(u64 gva, u64 gfn), - - TP_ARGS(gva, gfn) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(kvm_async_pf_nopresent_ready, - - TP_PROTO(u64 token, u64 gva), - - TP_ARGS(token, gva), - - TP_FIELDS( - ctf_integer(__u64, token, token) - ctf_integer(__u64, gva, gva) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_async_pf_nopresent_ready, kvm_async_pf_not_present, - - TP_PROTO(u64 token, u64 gva), - - TP_ARGS(token, gva) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_async_pf_nopresent_ready, kvm_async_pf_ready, - - TP_PROTO(u64 token, u64 gva), - - TP_ARGS(token, gva) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) \ - || LTTNG_RHEL_KERNEL_RANGE(3,10,0,229,0,0, 3,11,0,0,0,0)) - -LTTNG_TRACEPOINT_EVENT( - kvm_async_pf_completed, - TP_PROTO(unsigned long address, u64 gva), - TP_ARGS(address, gva), - - TP_FIELDS( - ctf_integer_hex(unsigned long, address, address) - ctf_integer(u64, gva, gva) - ) -) - -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) */ - -LTTNG_TRACEPOINT_EVENT( - kvm_async_pf_completed, - TP_PROTO(unsigned long address, struct page *page, u64 gva), - TP_ARGS(address, page, gva), - - TP_FIELDS( - ctf_integer_hex(unsigned long, address, address) - ctf_integer(pfn_t, pfn, page ? page_to_pfn(page) : 0) - ctf_integer(u64, gva, gva) - ) -) - -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) */ - -#endif - -#endif /* LTTNG_TRACE_KVM_MAIN_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/lock.h b/include/instrumentation/events/lttng-module/lock.h deleted file mode 100644 index af28517e..00000000 --- a/include/instrumentation/events/lttng-module/lock.h +++ /dev/null @@ -1,71 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#undef TRACE_SYSTEM -#define TRACE_SYSTEM lock - -#if !defined(LTTNG_TRACE_LOCK_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_LOCK_H - -#include -#include - -#ifdef CONFIG_LOCKDEP - -LTTNG_TRACEPOINT_EVENT(lock_acquire, - - TP_PROTO(struct lockdep_map *lock, unsigned int subclass, - int trylock, int read, int check, - struct lockdep_map *next_lock, unsigned long ip), - - TP_ARGS(lock, subclass, trylock, read, check, next_lock, ip), - - TP_FIELDS( - ctf_integer(unsigned int, flags, (trylock ? 1 : 0) | (read ? 2 : 0)) - ctf_string(name, lock->name) - ctf_integer_hex(void *, lockdep_addr, lock) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(lock, - - TP_PROTO(struct lockdep_map *lock, unsigned long ip), - - TP_ARGS(lock, ip), - - TP_FIELDS( - ctf_string(name, lock->name) - ctf_integer_hex(void *, lockdep_addr, lock) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(lock, lock_release, - - TP_PROTO(struct lockdep_map *lock, unsigned long ip), - - TP_ARGS(lock, ip) -) - -#ifdef CONFIG_LOCK_STAT - -LTTNG_TRACEPOINT_EVENT_INSTANCE(lock, lock_contended, - - TP_PROTO(struct lockdep_map *lock, unsigned long ip), - - TP_ARGS(lock, ip) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(lock, lock_acquired, - - TP_PROTO(struct lockdep_map *lock, unsigned long ip), - - TP_ARGS(lock, ip) -) - -#endif /* CONFIG_LOCK_STAT */ - -#endif /* CONFIG_LOCKDEP */ - -#endif /* LTTNG_TRACE_LOCK_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/lttng-statedump.h b/include/instrumentation/events/lttng-module/lttng-statedump.h deleted file mode 100644 index 23fdd0e8..00000000 --- a/include/instrumentation/events/lttng-module/lttng-statedump.h +++ /dev/null @@ -1,271 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM lttng_statedump - -#if !defined(LTTNG_TRACE_LTTNG_STATEDUMP_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_LTTNG_STATEDUMP_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef LTTNG_MNT_NS_MISSING_HEADER -# ifndef ONCE_LTTNG_FS_MOUNT_H -# define ONCE_LTTNG_FS_MOUNT_H -# include <../fs/mount.h> -# endif -#endif - -LTTNG_TRACEPOINT_EVENT(lttng_statedump_start, - TP_PROTO(struct lttng_session *session), - TP_ARGS(session), - TP_FIELDS() -) - -LTTNG_TRACEPOINT_EVENT(lttng_statedump_end, - TP_PROTO(struct lttng_session *session), - TP_ARGS(session), - TP_FIELDS() -) - -LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_state, - TP_PROTO(struct lttng_session *session, - struct task_struct *p, - int type, int mode, int submode, int status, - struct files_struct *files), - TP_ARGS(session, p, type, mode, submode, status, files), - TP_FIELDS( - ctf_integer(pid_t, tid, p->pid) - ctf_integer(pid_t, pid, p->tgid) - ctf_integer(pid_t, ppid, - ({ - pid_t ret; - - rcu_read_lock(); - ret = task_tgid_nr(p->real_parent); - rcu_read_unlock(); - ret; - })) - ctf_array_text(char, name, p->comm, TASK_COMM_LEN) - ctf_integer(int, type, type) - ctf_integer(int, mode, mode) - ctf_integer(int, submode, submode) - ctf_integer(int, status, status) - ctf_integer(unsigned int, cpu, task_cpu(p)) - ctf_integer_hex(struct files_struct *, file_table_address, files) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)) -LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_cgroup_ns, - TP_PROTO(struct lttng_session *session, - struct task_struct *p, - struct cgroup_namespace *cgroup_ns), - TP_ARGS(session, p, cgroup_ns), - TP_FIELDS( - ctf_integer(pid_t, tid, p->pid) - ctf_integer(unsigned int, ns_inum, cgroup_ns ? cgroup_ns->lttng_ns_inum : 0) - ) -) -#endif - -LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_ipc_ns, - TP_PROTO(struct lttng_session *session, - struct task_struct *p, - struct ipc_namespace *ipc_ns), - TP_ARGS(session, p, ipc_ns), - TP_FIELDS( - ctf_integer(pid_t, tid, p->pid) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) - ctf_integer(unsigned int, ns_inum, ipc_ns ? ipc_ns->lttng_ns_inum : 0) -#endif - ) -) - -#if !defined(LTTNG_MNT_NS_MISSING_HEADER) -LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_mnt_ns, - TP_PROTO(struct lttng_session *session, - struct task_struct *p, - struct mnt_namespace *mnt_ns), - TP_ARGS(session, p, mnt_ns), - TP_FIELDS( - ctf_integer(pid_t, tid, p->pid) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) - ctf_integer(unsigned int, ns_inum, mnt_ns ? mnt_ns->lttng_ns_inum : 0) -#endif - ) -) -#endif - -LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_net_ns, - TP_PROTO(struct lttng_session *session, - struct task_struct *p, - struct net *net_ns), - TP_ARGS(session, p, net_ns), - TP_FIELDS( - ctf_integer(pid_t, tid, p->pid) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) - ctf_integer(unsigned int, ns_inum, net_ns ? net_ns->lttng_ns_inum : 0) -#endif - ) -) - -LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_pid_ns, - TP_PROTO(struct lttng_session *session, - struct task_struct *p, - struct pid_namespace *pid_ns), - TP_ARGS(session, p, pid_ns), - TP_FIELDS( - ctf_integer(pid_t, tid, p->pid) - ctf_integer(pid_t, vtid, pid_ns ? task_pid_nr_ns(p, pid_ns) : 0) - ctf_integer(pid_t, vpid, pid_ns ? task_tgid_nr_ns(p, pid_ns) : 0) - ctf_integer(pid_t, vppid, - ({ - struct task_struct *parent; - pid_t ret = 0; - - if (pid_ns) { - rcu_read_lock(); - parent = rcu_dereference(p->real_parent); - ret = task_tgid_nr_ns(parent, pid_ns); - rcu_read_unlock(); - } - ret; - })) - ctf_integer(int, ns_level, pid_ns ? pid_ns->level : 0) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) - ctf_integer(unsigned int, ns_inum, pid_ns ? pid_ns->lttng_ns_inum : 0) -#endif - ) -) - -LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_user_ns, - TP_PROTO(struct lttng_session *session, - struct task_struct *p, - struct user_namespace *user_ns), - TP_ARGS(session, p, user_ns), - TP_FIELDS( - ctf_integer(pid_t, tid, p->pid) - ctf_integer(uid_t, vuid, user_ns ? lttng_task_vuid(p, user_ns) : 0) - ctf_integer(gid_t, vgid, user_ns ? lttng_task_vgid(p, user_ns) : 0) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) - ctf_integer(int, ns_level, user_ns ? user_ns->level : 0) -#endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) - ctf_integer(unsigned int, ns_inum, user_ns ? user_ns->lttng_ns_inum : 0) -#endif - ) -) - -LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_uts_ns, - TP_PROTO(struct lttng_session *session, - struct task_struct *p, - struct uts_namespace *uts_ns), - TP_ARGS(session, p, uts_ns), - TP_FIELDS( - ctf_integer(pid_t, tid, p->pid) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) - ctf_integer(unsigned int, ns_inum, uts_ns ? uts_ns->lttng_ns_inum : 0) -#endif - ) -) - -LTTNG_TRACEPOINT_EVENT(lttng_statedump_file_descriptor, - TP_PROTO(struct lttng_session *session, - struct files_struct *files, - int fd, const char *filename, - unsigned int flags, fmode_t fmode), - TP_ARGS(session, files, fd, filename, flags, fmode), - TP_FIELDS( - ctf_integer_hex(struct files_struct *, file_table_address, files) - ctf_integer(int, fd, fd) - ctf_integer_oct(unsigned int, flags, flags) - ctf_integer_hex(fmode_t, fmode, fmode) - ctf_string(filename, filename) - ) -) - -LTTNG_TRACEPOINT_EVENT(lttng_statedump_vm_map, - TP_PROTO(struct lttng_session *session, - struct task_struct *p, struct vm_area_struct *map, - unsigned long inode), - TP_ARGS(session, p, map, inode), - TP_FIELDS( - ctf_integer(pid_t, pid, p->tgid) - ctf_integer_hex(unsigned long, start, map->vm_start) - ctf_integer_hex(unsigned long, end, map->vm_end) - ctf_integer_hex(unsigned long, flags, map->vm_flags) - ctf_integer(unsigned long, inode, inode) - ctf_integer(unsigned long, pgoff, map->vm_pgoff << PAGE_SHIFT) - ) -) - -LTTNG_TRACEPOINT_EVENT(lttng_statedump_network_interface, - TP_PROTO(struct lttng_session *session, - struct net_device *dev, struct in_ifaddr *ifa), - TP_ARGS(session, dev, ifa), - TP_FIELDS( - ctf_string(name, dev->name) - ctf_integer_network_hex(uint32_t, address_ipv4, - ifa ? ifa->ifa_address : 0U) - ) -) - -LTTNG_TRACEPOINT_EVENT(lttng_statedump_block_device, - TP_PROTO(struct lttng_session *session, - dev_t dev, const char *diskname), - TP_ARGS(session, dev, diskname), - TP_FIELDS( - ctf_integer(dev_t, dev, dev) - ctf_string(diskname, diskname) - ) -) - -/* Called with desc->lock held */ -LTTNG_TRACEPOINT_EVENT(lttng_statedump_interrupt, - TP_PROTO(struct lttng_session *session, - unsigned int irq, const char *chip_name, - struct irqaction *action), - TP_ARGS(session, irq, chip_name, action), - TP_FIELDS( - ctf_integer(unsigned int, irq, irq) - ctf_string(name, chip_name) - ctf_string(action, action->name ? : "") - ctf_integer(pid_t, tid, action->thread ? action->thread->pid : 0) - ) -) - -#if defined(CONFIG_X86_32) || defined(CONFIG_X86_64) - -#define LTTNG_HAVE_STATEDUMP_CPU_TOPOLOGY - -LTTNG_TRACEPOINT_EVENT(lttng_statedump_cpu_topology, - TP_PROTO(struct lttng_session *session, struct cpuinfo_x86 *c), - TP_ARGS(session, c), - TP_FIELDS( - ctf_string(architecture, "x86") - ctf_integer(uint16_t, cpu_id, c->cpu_index) - ctf_string(vendor, c->x86_vendor_id[0] ? c->x86_vendor_id : "unknown") - ctf_integer(uint8_t, family, c->x86) - ctf_integer(uint8_t, model, c->x86_model) - ctf_string(model_name, c->x86_model_id[0] ? c->x86_model_id : "unknown") - ctf_integer(uint16_t, physical_id, c->phys_proc_id) - ctf_integer(uint16_t, core_id, c->cpu_core_id) - ctf_integer(uint16_t, cores, c->booted_cores) - ) -) -#endif /* CONFIG_X86_32 || CONFIG_X86_64 */ - -#endif /* LTTNG_TRACE_LTTNG_STATEDUMP_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/lttng-test.h b/include/instrumentation/events/lttng-module/lttng-test.h deleted file mode 100644 index 7d2b1f7c..00000000 --- a/include/instrumentation/events/lttng-module/lttng-test.h +++ /dev/null @@ -1,58 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM lttng_test - -#if !defined(LTTNG_TRACE_LTTNG_TEST_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_LTTNG_TEST_H - -#include -#include -#include - -LTTNG_TRACEPOINT_ENUM( - lttng_test_filter_event_enum, - TP_ENUM_VALUES( - ctf_enum_auto("AUTO: EXPECT 0") - ctf_enum_value("VALUE: 23", 23) - ctf_enum_value("VALUE: 27", 27) - ctf_enum_auto("AUTO: EXPECT 28") - ctf_enum_range("RANGE: 101 TO 303", 101, 303) - ctf_enum_auto("AUTO: EXPECT 304") - ) -) - -LTTNG_TRACEPOINT_EVENT(lttng_test_filter_event, - TP_PROTO(int anint, int netint, long *values, - char *text, size_t textlen, - char *etext, uint32_t * net_values), - TP_ARGS(anint, netint, values, text, textlen, etext, net_values), - TP_FIELDS( - ctf_integer(int, intfield, anint) - ctf_integer_hex(int, intfield2, anint) - ctf_integer(long, longfield, anint) - ctf_integer_network(int, netintfield, netint) - ctf_integer_network_hex(int, netintfieldhex, netint) - ctf_array(long, arrfield1, values, 3) - ctf_array_text(char, arrfield2, text, 10) - ctf_array_network(uint32_t, arrfield3, net_values, 3) - ctf_sequence(char, seqfield1, text, size_t, textlen) - ctf_sequence_text(char, seqfield2, text, size_t, textlen) - ctf_sequence_network(uint32_t, seqfield3, net_values, size_t, 3) - ctf_sequence(long, seqfield4, values, size_t, 3) - ctf_string(stringfield, text) - ctf_string(stringfield2, etext) - ctf_sequence_bitfield(long, bitfield_seq, values, uint8_t, 3) - ctf_array_bitfield(long, bitfield_array, values, 3) - ctf_enum(lttng_test_filter_event_enum, int, enum0, 0) - ctf_enum(lttng_test_filter_event_enum, int, enum23, 23) - ctf_enum(lttng_test_filter_event_enum, int, enum27, 27) - ctf_enum(lttng_test_filter_event_enum, int, enum28, 28) - ctf_enum(lttng_test_filter_event_enum, int, enum202, 202) - ctf_enum(lttng_test_filter_event_enum, int, enum304, 304) - ) -) - -#endif /* LTTNG_TRACE_LTTNG_TEST_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/lttng.h b/include/instrumentation/events/lttng-module/lttng.h deleted file mode 100644 index 91eb4608..00000000 --- a/include/instrumentation/events/lttng-module/lttng.h +++ /dev/null @@ -1,21 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM lttng - -#if !defined(LTTNG_TRACE_LTTNG_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_LTTNG_H - -#include - -LTTNG_TRACEPOINT_EVENT(lttng_logger, - TP_PROTO(const char __user *text, size_t len), - TP_ARGS(text, len), - TP_FIELDS( - ctf_user_sequence_text(char, msg, text, size_t, len) - ) -) - -#endif /* LTTNG_TRACE_LTTNG_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/mm_vmscan.h b/include/instrumentation/events/lttng-module/mm_vmscan.h deleted file mode 100644 index 8bdd65d2..00000000 --- a/include/instrumentation/events/lttng-module/mm_vmscan.h +++ /dev/null @@ -1,825 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM mm_vmscan - -#if !defined(LTTNG_TRACE_MM_VMSCAN_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_MM_VMSCAN_H - -#include -#include -#include -#include -#include - -#ifndef _TRACE_VMSCAN_DEF -#define _TRACE_VMSCAN_DEF -#define RECLAIM_WB_ANON 0x0001u -#define RECLAIM_WB_FILE 0x0002u -#define RECLAIM_WB_MIXED 0x0010u -#define RECLAIM_WB_SYNC 0x0004u /* Unused, all reclaim async */ -#define RECLAIM_WB_ASYNC 0x0008u - -#if ((LINUX_VERSION_CODE <= KERNEL_VERSION(3,0,38)) || \ - LTTNG_KERNEL_RANGE(3,1,0, 3,2,0)) -typedef int isolate_mode_t; -#endif - -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)) - -#include - -#define trace_reclaim_flags(file) ( \ - (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \ - (RECLAIM_WB_ASYNC) \ - ) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)) - -#include - -#define trace_reclaim_flags(page) ( \ - (page_is_file_cache(page) ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \ - (RECLAIM_WB_ASYNC) \ - ) - -#define trace_shrink_flags(file) \ - ( \ - (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \ - (RECLAIM_WB_ASYNC) \ - ) - -#endif - -LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_sleep, - - TP_PROTO(int nid), - - TP_ARGS(nid), - - TP_FIELDS( - ctf_integer(int, nid, nid) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) - -LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake, - - TP_PROTO(int nid, int zid, int order), - - TP_ARGS(nid, zid, order), - - TP_FIELDS( - ctf_integer(int, nid, nid) - ctf_integer(int, zid, zid) - ctf_integer(int, order, order) - ) -) - -#else - -LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake, - - TP_PROTO(int nid, int order), - - TP_ARGS(nid, order), - - TP_FIELDS( - ctf_integer(int, nid, nid) - ctf_integer(int, order, order) - ) -) - -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) -LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd, - - TP_PROTO(int nid, int zid, int order, gfp_t gfp_flags), - - TP_ARGS(nid, zid, order, gfp_flags), - - TP_FIELDS( - ctf_integer(int, nid, nid) - ctf_integer(int, zid, zid) - ctf_integer(int, order, order) - ctf_integer(gfp_t, gfp_flags, gfp_flags) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd, - - TP_PROTO(int nid, int zid, int order), - - TP_ARGS(nid, zid, order), - - TP_FIELDS( - ctf_integer(int, nid, nid) - ctf_integer(int, zid, zid) - ctf_integer(int, order, order) - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)) - -LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template, - - TP_PROTO(int order, gfp_t gfp_flags), - - TP_ARGS(order, gfp_flags), - - TP_FIELDS( - ctf_integer(int, order, order) - ctf_integer(gfp_t, gfp_flags, gfp_flags) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin, - - TP_PROTO(int order, gfp_t gfp_flags), - - TP_ARGS(order, gfp_flags) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin, - - TP_PROTO(int order, gfp_t gfp_flags), - - TP_ARGS(order, gfp_flags) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin, - - TP_PROTO(int order, gfp_t gfp_flags), - - TP_ARGS(order, gfp_flags) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) - -LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template, - - TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), - - TP_ARGS(order, may_writepage, gfp_flags, classzone_idx), - - TP_FIELDS( - ctf_integer(int, order, order) - ctf_integer(int, may_writepage, may_writepage) - ctf_integer(gfp_t, gfp_flags, gfp_flags) - ctf_integer(int, classzone_idx, classzone_idx) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin, - - TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), - - TP_ARGS(order, may_writepage, gfp_flags, classzone_idx) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin, - - TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), - - TP_ARGS(order, may_writepage, gfp_flags, classzone_idx) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin, - - TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), - - TP_ARGS(order, may_writepage, gfp_flags, classzone_idx) -) - -#else - -LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template, - - TP_PROTO(int order, int may_writepage, gfp_t gfp_flags), - - TP_ARGS(order, may_writepage, gfp_flags), - - TP_FIELDS( - ctf_integer(int, order, order) - ctf_integer(int, may_writepage, may_writepage) - ctf_integer(gfp_t, gfp_flags, gfp_flags) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin, - - TP_PROTO(int order, int may_writepage, gfp_t gfp_flags), - - TP_ARGS(order, may_writepage, gfp_flags) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin, - - TP_PROTO(int order, int may_writepage, gfp_t gfp_flags), - - TP_ARGS(order, may_writepage, gfp_flags) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin, - - TP_PROTO(int order, int may_writepage, gfp_t gfp_flags), - - TP_ARGS(order, may_writepage, gfp_flags) -) - -#endif - -LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_end_template, - - TP_PROTO(unsigned long nr_reclaimed), - - TP_ARGS(nr_reclaimed), - - TP_FIELDS( - ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template, mm_vmscan_direct_reclaim_end, - - TP_PROTO(unsigned long nr_reclaimed), - - TP_ARGS(nr_reclaimed) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_reclaim_end, - - TP_PROTO(unsigned long nr_reclaimed), - - TP_ARGS(nr_reclaimed) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_softlimit_reclaim_end, - - TP_PROTO(unsigned long nr_reclaimed), - - TP_ARGS(nr_reclaimed) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0)) -LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start, - - mm_vmscan_shrink_slab_start, - - TP_PROTO(struct shrinker *shr, struct shrink_control *sc, - long nr_objects_to_shrink, unsigned long cache_items, - unsigned long long delta, unsigned long total_scan, - int priority), - - TP_ARGS(shr, sc, nr_objects_to_shrink, cache_items, delta, total_scan, - priority), - - TP_FIELDS( - ctf_integer_hex(struct shrinker *, shr, shr) - ctf_integer_hex(void *, shrink, shr->scan_objects) - ctf_integer(int, nid, sc->nid) - ctf_integer(long, nr_objects_to_shrink, nr_objects_to_shrink) - ctf_integer(gfp_t, gfp_flags, sc->gfp_mask) - ctf_integer(unsigned long, cache_items, cache_items) - ctf_integer(unsigned long long, delta, delta) - ctf_integer(unsigned long, total_scan, total_scan) - ctf_integer(int, priority, priority) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) -LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start, - - mm_vmscan_shrink_slab_start, - - TP_PROTO(struct shrinker *shr, struct shrink_control *sc, - long nr_objects_to_shrink, unsigned long pgs_scanned, - unsigned long lru_pgs, unsigned long cache_items, - unsigned long long delta, unsigned long total_scan), - - TP_ARGS(shr, sc, nr_objects_to_shrink, pgs_scanned, lru_pgs, - cache_items, delta, total_scan), - - TP_FIELDS( - ctf_integer_hex(struct shrinker *, shr, shr) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) - ctf_integer_hex(void *, shrink, shr->scan_objects) -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ - ctf_integer_hex(void *, shrink, shr->shrink) -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ - ctf_integer(long, nr_objects_to_shrink, nr_objects_to_shrink) - ctf_integer(gfp_t, gfp_flags, sc->gfp_mask) - ctf_integer(unsigned long, pgs_scanned, pgs_scanned) - ctf_integer(unsigned long, lru_pgs, lru_pgs) - ctf_integer(unsigned long, cache_items, cache_items) - ctf_integer(unsigned long long, delta, delta) - ctf_integer(unsigned long, total_scan, total_scan) - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) -LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end, - - mm_vmscan_shrink_slab_end, - - TP_PROTO(struct shrinker *shr, int nid, int shrinker_retval, - long unused_scan_cnt, long new_scan_cnt, long total_scan), - - TP_ARGS(shr, nid, shrinker_retval, unused_scan_cnt, new_scan_cnt, - total_scan), - - TP_FIELDS( - ctf_integer_hex(struct shrinker *, shr, shr) - ctf_integer(int, nid, nid) - ctf_integer_hex(void *, shrink, shr->scan_objects) - ctf_integer(long, unused_scan, unused_scan_cnt) - ctf_integer(long, new_scan, new_scan_cnt) - ctf_integer(int, retval, shrinker_retval) - ctf_integer(long, total_scan, total_scan) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) -LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end, - - mm_vmscan_shrink_slab_end, - - TP_PROTO(struct shrinker *shr, int shrinker_retval, - long unused_scan_cnt, long new_scan_cnt), - - TP_ARGS(shr, shrinker_retval, unused_scan_cnt, new_scan_cnt), - - TP_FIELDS( - ctf_integer_hex(struct shrinker *, shr, shr) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) - ctf_integer_hex(void *, shrink, shr->scan_objects) -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ - ctf_integer_hex(void *, shrink, shr->shrink) -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ - ctf_integer(long, unused_scan, unused_scan_cnt) - ctf_integer(long, new_scan, new_scan_cnt) - ctf_integer(int, retval, shrinker_retval) - ctf_integer(long, total_scan, new_scan_cnt - unused_scan_cnt) - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) -LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_isolate, - - TP_PROTO(int classzone_idx, - int order, - unsigned long nr_requested, - unsigned long nr_scanned, - unsigned long nr_skipped, - unsigned long nr_taken, - isolate_mode_t isolate_mode, - int lru - ), - - TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_skipped, - nr_taken, isolate_mode, lru - ), - - TP_FIELDS( - ctf_integer(int, classzone_idx, classzone_idx) - ctf_integer(int, order, order) - ctf_integer(unsigned long, nr_requested, nr_requested) - ctf_integer(unsigned long, nr_scanned, nr_scanned) - ctf_integer(unsigned long, nr_skipped, nr_skipped) - ctf_integer(unsigned long, nr_taken, nr_taken) - ctf_integer(isolate_mode_t, isolate_mode, isolate_mode) - ctf_integer(int, lru, lru) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template, - - TP_PROTO(int classzone_idx, - int order, - unsigned long nr_requested, - unsigned long nr_scanned, - unsigned long nr_taken, - isolate_mode_t isolate_mode, - int file - ), - - TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken, - isolate_mode, file - ), - - - TP_FIELDS( - ctf_integer(int, classzone_idx, classzone_idx) - ctf_integer(int, order, order) - ctf_integer(unsigned long, nr_requested, nr_requested) - ctf_integer(unsigned long, nr_scanned, nr_scanned) - ctf_integer(unsigned long, nr_taken, nr_taken) - ctf_integer(isolate_mode_t, isolate_mode, isolate_mode) - ctf_integer(int, file, file) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate, - - TP_PROTO(int classzone_idx, - int order, - unsigned long nr_requested, - unsigned long nr_scanned, - unsigned long nr_taken, - isolate_mode_t isolate_mode, - int file - ), - - TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken, - isolate_mode, file - ) - -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate, - - TP_PROTO(int classzone_idx, - int order, - unsigned long nr_requested, - unsigned long nr_scanned, - unsigned long nr_taken, - isolate_mode_t isolate_mode, - int file - ), - - TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken, - isolate_mode, file - ) -) -#else -LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template, - - TP_PROTO(int order, - unsigned long nr_requested, - unsigned long nr_scanned, - unsigned long nr_taken, -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) - unsigned long nr_lumpy_taken, - unsigned long nr_lumpy_dirty, - unsigned long nr_lumpy_failed, -#endif -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) - isolate_mode_t isolate_mode -#else - isolate_mode_t isolate_mode, - int file -#endif - ), - - TP_ARGS(order, nr_requested, nr_scanned, nr_taken, -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) - nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, -#endif -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) - isolate_mode -#else - isolate_mode, file -#endif - ), - - - TP_FIELDS( - ctf_integer(int, order, order) - ctf_integer(unsigned long, nr_requested, nr_requested) - ctf_integer(unsigned long, nr_scanned, nr_scanned) - ctf_integer(unsigned long, nr_taken, nr_taken) -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) - ctf_integer(unsigned long, nr_lumpy_taken, nr_lumpy_taken) - ctf_integer(unsigned long, nr_lumpy_dirty, nr_lumpy_dirty) - ctf_integer(unsigned long, nr_lumpy_failed, nr_lumpy_failed) -#endif - ctf_integer(isolate_mode_t, isolate_mode, isolate_mode) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) - ctf_integer(int, file, file) -#endif - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate, - - TP_PROTO(int order, - unsigned long nr_requested, - unsigned long nr_scanned, - unsigned long nr_taken, -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) - unsigned long nr_lumpy_taken, - unsigned long nr_lumpy_dirty, - unsigned long nr_lumpy_failed, -#endif -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) - isolate_mode_t isolate_mode -#else - isolate_mode_t isolate_mode, - int file -#endif - ), - - TP_ARGS(order, nr_requested, nr_scanned, nr_taken, -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) - nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, -#endif -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) - isolate_mode -#else - isolate_mode, file -#endif - ) - -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate, - - TP_PROTO(int order, - unsigned long nr_requested, - unsigned long nr_scanned, - unsigned long nr_taken, -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) - unsigned long nr_lumpy_taken, - unsigned long nr_lumpy_dirty, - unsigned long nr_lumpy_failed, -#endif -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) - isolate_mode_t isolate_mode -#else - isolate_mode_t isolate_mode, - int file -#endif - ), - - TP_ARGS(order, nr_requested, nr_scanned, nr_taken, -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) - nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, -#endif -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) - isolate_mode -#else - isolate_mode, file -#endif - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) -LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage, - - TP_PROTO(struct page *page), - - TP_ARGS(page), - - TP_FIELDS( - ctf_integer_hex(struct page *, page, page) - ctf_integer(int, reclaim_flags, trace_reclaim_flags( - page_is_file_lru(page))) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)) -LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage, - - TP_PROTO(struct page *page), - - TP_ARGS(page), - - TP_FIELDS( - ctf_integer_hex(struct page *, page, page) - ctf_integer(int, reclaim_flags, trace_reclaim_flags( - page_is_file_cache(page))) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)) -LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage, - - TP_PROTO(struct page *page), - - TP_ARGS(page), - - TP_FIELDS( - ctf_integer_hex(struct page *, page, page) - ctf_integer(int, reclaim_flags, trace_reclaim_flags(page)) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage, - - TP_PROTO(struct page *page, - int reclaim_flags), - - TP_ARGS(page, reclaim_flags), - - TP_FIELDS( - ctf_integer_hex(struct page *, page, page) - ctf_integer(int, reclaim_flags, reclaim_flags) - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)) -LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, - - TP_PROTO(int nid, - unsigned long nr_scanned, unsigned long nr_reclaimed, - struct reclaim_stat *stat, int priority, int file), - - TP_ARGS(nid, nr_scanned, nr_reclaimed, stat, priority, file), - - TP_FIELDS( - ctf_integer(int, nid, nid) - ctf_integer(unsigned long, nr_scanned, nr_scanned) - ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) - ctf_integer(unsigned long, nr_dirty, stat->nr_dirty) - ctf_integer(unsigned long, nr_writeback, stat->nr_writeback) - ctf_integer(unsigned long, nr_congested, stat->nr_congested) - ctf_integer(unsigned long, nr_immediate, stat->nr_immediate) - ctf_integer(unsigned long, nr_activate_anon, stat->nr_activate[0]) - ctf_integer(unsigned long, nr_activate_file, stat->nr_activate[1]) - ctf_integer(unsigned long, nr_ref_keep, stat->nr_ref_keep) - ctf_integer(unsigned long, nr_unmap_fail, stat->nr_unmap_fail) - ctf_integer(int, priority, priority) - ctf_integer(int, reclaim_flags, trace_reclaim_flags(file)) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) -LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, - - TP_PROTO(int nid, - unsigned long nr_scanned, unsigned long nr_reclaimed, - struct reclaim_stat *stat, int priority, int file), - - TP_ARGS(nid, nr_scanned, nr_reclaimed, stat, priority, file), - - TP_FIELDS( - ctf_integer(int, nid, nid) - ctf_integer(unsigned long, nr_scanned, nr_scanned) - ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) - ctf_integer(unsigned long, nr_dirty, stat->nr_dirty) - ctf_integer(unsigned long, nr_writeback, stat->nr_writeback) - ctf_integer(unsigned long, nr_congested, stat->nr_congested) - ctf_integer(unsigned long, nr_immediate, stat->nr_immediate) - ctf_integer(unsigned long, nr_activate, stat->nr_activate) - ctf_integer(unsigned long, nr_ref_keep, stat->nr_ref_keep) - ctf_integer(unsigned long, nr_unmap_fail, stat->nr_unmap_fail) - ctf_integer(int, priority, priority) - ctf_integer(int, reclaim_flags, trace_shrink_flags(file)) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) -LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, - - TP_PROTO(int nid, - unsigned long nr_scanned, unsigned long nr_reclaimed, - unsigned long nr_dirty, unsigned long nr_writeback, - unsigned long nr_congested, unsigned long nr_immediate, - unsigned long nr_activate, unsigned long nr_ref_keep, - unsigned long nr_unmap_fail, - int priority, int file), - - TP_ARGS(nid, nr_scanned, nr_reclaimed, nr_dirty, nr_writeback, - nr_congested, nr_immediate, nr_activate, nr_ref_keep, - nr_unmap_fail, priority, file), - - TP_FIELDS( - ctf_integer(int, nid, nid) - ctf_integer(unsigned long, nr_scanned, nr_scanned) - ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) - ctf_integer(unsigned long, nr_dirty, nr_dirty) - ctf_integer(unsigned long, nr_writeback, nr_writeback) - ctf_integer(unsigned long, nr_congested, nr_congested) - ctf_integer(unsigned long, nr_immediate, nr_immediate) - ctf_integer(unsigned long, nr_activate, nr_activate) - ctf_integer(unsigned long, nr_ref_keep, nr_ref_keep) - ctf_integer(unsigned long, nr_unmap_fail, nr_unmap_fail) - ctf_integer(int, priority, priority) - ctf_integer(int, reclaim_flags, trace_shrink_flags(file)) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) -LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, - - TP_PROTO(int nid, - unsigned long nr_scanned, unsigned long nr_reclaimed, - int priority, int file), - - TP_ARGS(nid, nr_scanned, nr_reclaimed, priority, file), - - TP_FIELDS( - ctf_integer(int, nid, nid) - ctf_integer(unsigned long, nr_scanned, nr_scanned) - ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) - ctf_integer(int, priority, priority) - ctf_integer(int, reclaim_flags, trace_shrink_flags(file)) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)) -LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, - - TP_PROTO(struct zone *zone, - unsigned long nr_scanned, unsigned long nr_reclaimed, - int priority, int file), - - TP_ARGS(zone, nr_scanned, nr_reclaimed, priority, file), - - TP_FIELDS( - ctf_integer(int, nid, zone_to_nid(zone)) - ctf_integer(int, zid, zone_idx(zone)) - ctf_integer(unsigned long, nr_scanned, nr_scanned) - ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) - ctf_integer(int, priority, priority) - ctf_integer(int, reclaim_flags, trace_shrink_flags(file)) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, - - TP_PROTO(int nid, int zid, - unsigned long nr_scanned, unsigned long nr_reclaimed, - int priority, int reclaim_flags), - - TP_ARGS(nid, zid, nr_scanned, nr_reclaimed, priority, reclaim_flags), - - TP_FIELDS( - ctf_integer(int, nid, nid) - ctf_integer(int, zid, zid) - ctf_integer(unsigned long, nr_scanned, nr_scanned) - ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) - ctf_integer(int, priority, priority) - ctf_integer(int, reclaim_flags, reclaim_flags) - ) -) -#endif - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) -LTTNG_TRACEPOINT_EVENT_MAP(replace_swap_token, - - mm_vmscan_replace_swap_token, - - TP_PROTO(struct mm_struct *old_mm, - struct mm_struct *new_mm), - - TP_ARGS(old_mm, new_mm), - - TP_FIELDS( - ctf_integer_hex(struct mm_struct *, old_mm, old_mm) - ctf_integer(unsigned int, old_prio, old_mm ? old_mm->token_priority : 0) - ctf_integer_hex(struct mm_struct *, new_mm, new_mm) - ctf_integer(unsigned int, new_prio, new_mm->token_priority) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_put_swap_token_template, - TP_PROTO(struct mm_struct *swap_token_mm), - - TP_ARGS(swap_token_mm), - - TP_FIELDS( - ctf_integer_hex(struct mm_struct*, swap_token_mm, swap_token_mm) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template, put_swap_token, - - mm_vmscan_put_swap_token, - - TP_PROTO(struct mm_struct *swap_token_mm), - TP_ARGS(swap_token_mm) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template, disable_swap_token, - - mm_vmscan_disable_swap_token, - - TP_PROTO(struct mm_struct *swap_token_mm), - TP_ARGS(swap_token_mm) -) - -LTTNG_TRACEPOINT_EVENT_MAP(update_swap_token_priority, - - mm_vmscan_update_swap_token_priority, - - TP_PROTO(struct mm_struct *mm, - unsigned int old_prio, - struct mm_struct *swap_token_mm), - - TP_ARGS(mm, old_prio, swap_token_mm), - - TP_FIELDS( - ctf_integer_hex(struct mm_struct *, mm, mm) - ctf_integer(unsigned int, old_prio, old_prio) - ctf_integer(unsigned int, new_prio, mm->token_priority) - ctf_integer_hex(struct mm_struct *, swap_token_mm, swap_token_mm) - ctf_integer(unsigned int, swap_token_prio, swap_token_mm ? swap_token_mm->token_priority : 0) - ) -) -#endif - -#endif /* LTTNG_TRACE_MM_VMSCAN_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/module.h b/include/instrumentation/events/lttng-module/module.h deleted file mode 100644 index 5831650b..00000000 --- a/include/instrumentation/events/lttng-module/module.h +++ /dev/null @@ -1,105 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * Because linux/module.h has tracepoints in the header, and ftrace.h - * eventually includes this file, define_trace.h includes linux/module.h - * But we do not want the module.h to override the TRACE_SYSTEM macro - * variable that define_trace.h is processing, so we only set it - * when module events are being processed, which would happen when - * CREATE_TRACE_POINTS is defined. - */ -#ifdef CREATE_TRACE_POINTS -#undef TRACE_SYSTEM -#define TRACE_SYSTEM module -#endif - -#if !defined(LTTNG_TRACE_MODULE_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_MODULE_H - -#include -#include - -#ifdef CONFIG_MODULES - -#ifndef _TRACE_MODULE_DEF -#define _TRACE_MODULE_DEF -struct module; - -#endif - -LTTNG_TRACEPOINT_EVENT(module_load, - - TP_PROTO(struct module *mod), - - TP_ARGS(mod), - - TP_FIELDS( - ctf_integer(unsigned int, taints, mod->taints) - ctf_string(name, mod->name) - ) -) - -LTTNG_TRACEPOINT_EVENT(module_free, - - TP_PROTO(struct module *mod), - - TP_ARGS(mod), - - TP_FIELDS( - ctf_string(name, mod->name) - ) -) - -#ifdef CONFIG_MODULE_UNLOAD -/* trace_module_get/put are only used if CONFIG_MODULE_UNLOAD is defined */ - -LTTNG_TRACEPOINT_EVENT_CLASS(module_refcnt, - - TP_PROTO(struct module *mod, unsigned long ip), - - TP_ARGS(mod, ip), - - TP_FIELDS( - ctf_integer_hex(unsigned long, ip, ip) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)) - ctf_integer(int, refcnt, atomic_read(&mod->refcnt)) -#else - ctf_integer(int, refcnt, __this_cpu_read(mod->refptr->incs) + __this_cpu_read(mod->refptr->decs)) -#endif - ctf_string(name, mod->name) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(module_refcnt, module_get, - - TP_PROTO(struct module *mod, unsigned long ip), - - TP_ARGS(mod, ip) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(module_refcnt, module_put, - - TP_PROTO(struct module *mod, unsigned long ip), - - TP_ARGS(mod, ip) -) -#endif /* CONFIG_MODULE_UNLOAD */ - -LTTNG_TRACEPOINT_EVENT(module_request, - - TP_PROTO(char *name, bool wait, unsigned long ip), - - TP_ARGS(name, wait, ip), - - TP_FIELDS( - ctf_integer_hex(unsigned long, ip, ip) - ctf_integer(bool, wait, wait) - ctf_string(name, name) - ) -) - -#endif /* CONFIG_MODULES */ - -#endif /* LTTNG_TRACE_MODULE_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/napi.h b/include/instrumentation/events/lttng-module/napi.h deleted file mode 100644 index 8a32993f..00000000 --- a/include/instrumentation/events/lttng-module/napi.h +++ /dev/null @@ -1,51 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM napi - -#if !defined(LTTNG_TRACE_NAPI_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_NAPI_H - -#include -#include -#include - -#define NO_DEV "(no_device)" - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) - -LTTNG_TRACEPOINT_EVENT(napi_poll, - - TP_PROTO(struct napi_struct *napi, int work, int budget), - - TP_ARGS(napi, work, budget), - - TP_FIELDS( - ctf_integer_hex(struct napi_struct *, napi, napi) - ctf_string(dev_name, napi->dev ? napi->dev->name : NO_DEV) - ctf_integer(int, work, work) - ctf_integer(int, budget, budget) - ) -) - -#else - -LTTNG_TRACEPOINT_EVENT(napi_poll, - - TP_PROTO(struct napi_struct *napi), - - TP_ARGS(napi), - - TP_FIELDS( - ctf_integer_hex(struct napi_struct *, napi, napi) - ctf_string(dev_name, napi->dev ? napi->dev->name : NO_DEV) - ) -) - -#endif - -#undef NO_DEV - -#endif /* LTTNG_TRACE_NAPI_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/net.h b/include/instrumentation/events/lttng-module/net.h deleted file mode 100644 index c2d8c67b..00000000 --- a/include/instrumentation/events/lttng-module/net.h +++ /dev/null @@ -1,871 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM net - -#if !defined(LTTNG_TRACE_NET_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_NET_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef ONCE_LTTNG_NET_H -#define ONCE_LTTNG_NET_H - -static inline unsigned char __has_network_hdr(struct sk_buff *skb) -{ - /* - * If the header is not set yet, the network header will point - * to the head. - */ - return skb_network_header(skb) != skb->head; -} - -static struct lttng_event_field emptyfields[] = { -}; - -/* Structures for transport headers. */ - -static struct lttng_event_field tcpfields[] = { - [0] = { - .name = "source_port", - .type = __type_integer(uint16_t, 0, 0, 0, - __BIG_ENDIAN, 10, none), - }, - [1] = { - .name = "dest_port", - .type = __type_integer(uint16_t, 0, 0, 0, - __BIG_ENDIAN, 10, none), - }, - [2] = { - .name = "seq", - .type = __type_integer(uint32_t, 0, 0, 0, - __BIG_ENDIAN, 10, none), - }, - [3] = { - .name = "ack_seq", - .type = __type_integer(uint32_t, 0, 0, 0, - __BIG_ENDIAN, 10, none), - }, - [4] = { - .name = "data_offset", - .type = __type_integer(uint8_t, 4, 4, 0, - __BIG_ENDIAN, 10, none), - }, - [5] = { - .name = "reserved", - .type = __type_integer(uint8_t, 3, 1, 0, - __BIG_ENDIAN, 10, none), - }, - [6] = { - .name = "flags", - .type = __type_integer(uint8_t, 9, 1, 0, - __BIG_ENDIAN, 16, none), - }, - [7] = { - .name = "window_size", - .type = __type_integer(uint16_t, 0, 0, 0, - __BIG_ENDIAN, 10, none), - }, - [8] = { - .name = "checksum", - .type = __type_integer(uint16_t, 0, 0, 0, - __BIG_ENDIAN, 16, none), - }, - [9] = { - .name = "urg_ptr", - .type = __type_integer(uint16_t, 0, 0, 0, - __BIG_ENDIAN, 10, none), - }, -}; - -static struct lttng_event_field udpfields[] = { - [0] = { - .name = "source_port", - .type = __type_integer(uint16_t, 0, 0, 0, - __BIG_ENDIAN, 10, none), - }, - [1] = { - .name = "dest_port", - .type = __type_integer(uint16_t, 0, 0, 0, - __BIG_ENDIAN, 10, none), - }, - [2] = { - .name = "len", - .type = __type_integer(uint16_t, 0, 0, 0, - __BIG_ENDIAN, 10, none), - }, - [3] = { - .name = "check", - .type = __type_integer(uint16_t, 0, 0, 0, - __BIG_ENDIAN, 10, none), - }, -}; - -static struct lttng_event_field icmpfields[] = { - [0] = { - .name = "type", - .type = __type_integer(uint8_t, 0, 0, 0, - __BIG_ENDIAN, 10, none), - }, - [1] = { - .name = "code", - .type = __type_integer(uint8_t, 0, 0, 0, - __BIG_ENDIAN, 10, none), - }, - [2] = { - .name = "checksum", - .type = __type_integer(uint16_t, 0, 0, 0, - __BIG_ENDIAN, 10, none), - }, - [3] = { - .name = "gateway", - .type = __type_integer(uint32_t, 0, 0, 0, - __BIG_ENDIAN, 10, none), - }, -}; - - -static struct lttng_event_field transport_fields[] = { - [0] = { - .name = "unknown", - .type = { - .atype = atype_struct_nestable, - .u.struct_nestable.nr_fields = ARRAY_SIZE(emptyfields), - .u.struct_nestable.fields = emptyfields, - .u.struct_nestable.alignment = 0, - }, - .nofilter = 1, - }, - [1] = { - .name = "tcp", - .type = { - .atype = atype_struct_nestable, - .u.struct_nestable.nr_fields = ARRAY_SIZE(tcpfields), - .u.struct_nestable.fields = tcpfields, - .u.struct_nestable.alignment = 0, - }, - .nofilter = 1, - }, - [2] = { - .name = "udp", - .type = { - .atype = atype_struct_nestable, - .u.struct_nestable.nr_fields = ARRAY_SIZE(udpfields), - .u.struct_nestable.fields = udpfields, - .u.struct_nestable.alignment = 0, - }, - .nofilter = 1, - }, - [3] = { - .name = "icmp", - .type = { - .atype = atype_struct_nestable, - .u.struct_nestable.nr_fields = ARRAY_SIZE(icmpfields), - .u.struct_nestable.fields = icmpfields, - .u.struct_nestable.alignment = 0, - }, - .nofilter = 1, - }, -}; - -enum transport_header_types { - TH_NONE = 0, - TH_TCP = 1, - TH_UDP = 2, - TH_ICMP = 3, -}; - -static inline enum transport_header_types __get_transport_header_type_ip(struct sk_buff *skb) -{ - switch (ip_hdr(skb)->protocol) { - case IPPROTO_TCP: - return TH_TCP; - case IPPROTO_UDP: - return TH_UDP; - case IPPROTO_ICMP: - return TH_ICMP; - } - return TH_NONE; -} - -static inline enum transport_header_types __get_transport_header_type_ipv6(struct sk_buff *skb) -{ - switch (ipv6_hdr(skb)->nexthdr) { - case IPPROTO_TCP: - return TH_TCP; - case IPPROTO_UDP: - return TH_UDP; - case IPPROTO_ICMP: - return TH_ICMP; - } - return TH_NONE; -} - -static inline enum transport_header_types __get_transport_header_type(struct sk_buff *skb) -{ - if (__has_network_hdr(skb)) { - /* - * When both transport and network headers are set, - * transport header is greater than network header, - * otherwise it points to head. - */ - if (skb->transport_header > skb->network_header) { - /* - * Get the transport protocol from the network - * header's data. This method works both for - * sent and received packets. - */ - if (skb->protocol == htons(ETH_P_IP)) { - return __get_transport_header_type_ip(skb); - } else if(skb->protocol == htons(ETH_P_IPV6)) { - return __get_transport_header_type_ipv6(skb); - } - } - /* Fallthrough for other cases where header is not recognized. */ - } - return TH_NONE; -} - -static struct lttng_enum_entry proto_transport_enum_entries[] = { - [0] = { - .start = { .value = 0, .signedness = 0, }, - .end = { .value = IPPROTO_ICMP - 1, .signedness = 0, }, - .string = "_unknown", - }, - [1] = { - .start = { .value = IPPROTO_ICMP, .signedness = 0, }, - .end = { .value = IPPROTO_ICMP, .signedness = 0, }, - .string = "_icmp", - }, - [2] = { - .start = { .value = IPPROTO_ICMP + 1, .signedness = 0, }, - .end = { .value = IPPROTO_TCP - 1, .signedness = 0, }, - .string = "_unknown", - }, - [3] = { - .start = { .value = IPPROTO_TCP, .signedness = 0, }, - .end = { .value = IPPROTO_TCP, .signedness = 0, }, - .string = "_tcp", - }, - [4] = { - .start = { .value = IPPROTO_TCP + 1, .signedness = 0, }, - .end = { .value = IPPROTO_UDP - 1, .signedness = 0, }, - .string = "_unknown", - }, - [5] = { - .start = { .value = IPPROTO_UDP, .signedness = 0, }, - .end = { .value = IPPROTO_UDP, .signedness = 0, }, - .string = "_udp", - }, - [6] = { - .start = { .value = IPPROTO_UDP + 1, .signedness = 0, }, - .end = { .value = 255, .signedness = 0, }, - .string = "_unknown", - }, -}; - -static const struct lttng_enum_desc proto_transport_header_type = { - .name = "proto_transport_header_type", - .entries = proto_transport_enum_entries, - .nr_entries = ARRAY_SIZE(proto_transport_enum_entries), -}; - -static struct lttng_enum_entry transport_enum_entries[] = { - [0] = { - .start = { .value = TH_NONE, .signedness = 0, }, - .end = { .value = TH_NONE, .signedness = 0, }, - .string = "_unknown", - }, - [1] = { - .start = { .value = TH_TCP, .signedness = 0, }, - .end = { .value = TH_TCP, .signedness = 0, }, - .string = "_tcp", - }, - [2] = { - .start = { .value = TH_UDP, .signedness = 0, }, - .end = { .value = TH_UDP, .signedness = 0, }, - .string = "_udp", - }, - [3] = { - .start = { .value = TH_ICMP, .signedness = 0, }, - .end = { .value = TH_ICMP, .signedness = 0, }, - .string = "_icmp", - }, -}; - -static const struct lttng_enum_desc transport_header_type = { - .name = "transport_header_type", - .entries = transport_enum_entries, - .nr_entries = ARRAY_SIZE(transport_enum_entries), -}; - -/* Structures for network headers. */ - -static struct lttng_event_field ipv4fields[] = { - [0] = { - .name = "version", - .type = __type_integer(uint8_t, 4, 4, 0, - __BIG_ENDIAN, 10, none), - }, - [1] = { - .name = "ihl", - .type = __type_integer(uint8_t, 4, 4, 0, - __BIG_ENDIAN, 10, none), - }, - [2] = { - .name = "tos", - .type = __type_integer(uint8_t, 0, 0, 0, - __BIG_ENDIAN, 10, none), - }, - [3] = { - .name = "tot_len", - .type = __type_integer(uint16_t, 0, 0, 0, - __BIG_ENDIAN, 10, none), - }, - [4] = { - .name = "id", - .type = __type_integer(uint16_t, 0, 0, 0, - __BIG_ENDIAN, 16, none), - }, - [5] = { - .name = "frag_off", - .type = __type_integer(uint16_t, 0, 0, 0, - __BIG_ENDIAN, 10, none), - }, - [6] = { - .name = "ttl", - .type = __type_integer(uint8_t, 0, 0, 0, - __BIG_ENDIAN, 10, none), - }, - [7] = { - .name = "protocol", - .type = { - .atype = atype_enum_nestable, - .u.enum_nestable.desc = - &proto_transport_header_type, - .u.enum_nestable.container_type = - __LTTNG_COMPOUND_LITERAL(struct lttng_type, - __type_integer(uint8_t, 0, 0, -1, - __BIG_ENDIAN, 10, none)), - }, - }, - [8] = { - .name = "checksum", - .type = __type_integer(uint16_t, 0, 0, 0, - __BIG_ENDIAN, 16, none), - }, - [9] = { - .name = "saddr", - .type = { - .atype = atype_array_nestable, - .u.array_nestable.elem_type = - __LTTNG_COMPOUND_LITERAL(struct lttng_type, - __type_integer(uint8_t, 0, 0, 0, - __BIG_ENDIAN, 10, none)), - .u.array_nestable.length = 4, - .u.array_nestable.alignment = lttng_alignof(uint8_t), - }, - }, - [10] = { - .name = "daddr", - .type = { - .atype = atype_array_nestable, - .u.array_nestable.elem_type = - __LTTNG_COMPOUND_LITERAL(struct lttng_type, - __type_integer(uint8_t, 0, 0, 0, - __BIG_ENDIAN, 10, none)), - .u.array_nestable.length = 4, - .u.array_nestable.alignment = lttng_alignof(uint8_t), - }, - }, - [11] = { - .name = "transport_header_type", - .type = { - .atype = atype_enum_nestable, - .u.enum_nestable.desc = &transport_header_type, - .u.enum_nestable.container_type = - __LTTNG_COMPOUND_LITERAL(struct lttng_type, - __type_integer(uint8_t, 0, 0, -1, - __BYTE_ORDER, 10, none)), - }, - }, - [12] = { - .name = "transport_header", - .type = { - .atype = atype_variant_nestable, - .u.variant_nestable.tag_name = "transport_header_type", - .u.variant_nestable.choices = transport_fields, - .u.variant_nestable.nr_choices = ARRAY_SIZE(transport_fields), - .u.variant_nestable.alignment = 0, - }, - }, -}; - -static struct lttng_event_field ipv6fields[] = { - [0] = { - .name = "version", - .type = __type_integer(uint8_t, 4, 4, 0, - __BIG_ENDIAN, 10, none), - }, - [1] = { - .name = "prio", - .type = __type_integer(uint8_t, 4, 4, 0, - __BIG_ENDIAN, 10, none), - }, - [2] = { - .name = "flow_lbl", - .type = { - .atype = atype_array_nestable, - .u.array_nestable.elem_type = - __LTTNG_COMPOUND_LITERAL(struct lttng_type, - __type_integer(uint8_t, 0, 0, 0, - __BIG_ENDIAN, 16, none)), - .u.array_nestable.length = 3, - .u.array_nestable.alignment = lttng_alignof(uint8_t), - }, - }, - [3] = { - .name = "payload_len", - .type = __type_integer(uint16_t, 0, 0, 0, - __BIG_ENDIAN, 10, none), - }, - [4] = { - .name = "nexthdr", - .type = { - .atype = atype_enum_nestable, - .u.enum_nestable.desc = - &proto_transport_header_type, - .u.enum_nestable.container_type = - __LTTNG_COMPOUND_LITERAL(struct lttng_type, - __type_integer(uint8_t, 0, 0, -1, - __BIG_ENDIAN, 10, none)), - }, - }, - [5] = { - .name = "hop_limit", - .type = __type_integer(uint8_t, 0, 0, 0, - __BIG_ENDIAN, 10, none), - }, - [6] = { - .name = "saddr", - .type = { - .atype = atype_array_nestable, - .u.array_nestable.elem_type = - __LTTNG_COMPOUND_LITERAL(struct lttng_type, - __type_integer(uint16_t, 0, 0, 0, - __BIG_ENDIAN, 16, none)), - .u.array_nestable.length = 8, - .u.array_nestable.alignment = lttng_alignof(uint16_t), - }, - }, - [7] = { - .name = "daddr", - .type = { - .atype = atype_array_nestable, - .u.array_nestable.elem_type = - __LTTNG_COMPOUND_LITERAL(struct lttng_type, - __type_integer(uint16_t, 0, 0, 0, - __BIG_ENDIAN, 16, none)), - .u.array_nestable.length = 8, - .u.array_nestable.alignment = lttng_alignof(uint16_t), - }, - }, - [8] = { - .name = "transport_header_type", - .type = { - .atype = atype_enum_nestable, - .u.enum_nestable.desc = &transport_header_type, - .u.enum_nestable.container_type = - __LTTNG_COMPOUND_LITERAL(struct lttng_type, - __type_integer(uint8_t, 0, 0, -1, - __BYTE_ORDER, 10, none)), - }, - }, - [9] = { - .name = "transport_header", - .type = { - .atype = atype_variant_nestable, - .u.variant_nestable.tag_name = "transport_header_type", - .u.variant_nestable.choices = transport_fields, - .u.variant_nestable.nr_choices = ARRAY_SIZE(transport_fields), - .u.variant_nestable.alignment = 0, - }, - }, -}; - -static struct lttng_event_field network_fields[] = { - [0] = { - .name = "unknown", - .type = { - .atype = atype_struct_nestable, - .u.struct_nestable.nr_fields = 0, - .u.struct_nestable.fields = emptyfields, - .u.struct_nestable.alignment = 0, - }, - }, - [1] = { - .name = "ipv4", - .type = { - .atype = atype_struct_nestable, - .u.struct_nestable.nr_fields = ARRAY_SIZE(ipv4fields), - .u.struct_nestable.fields = ipv4fields, - .u.struct_nestable.alignment = 0, - }, - }, - [2] = { - .name = "ipv6", - .type = { - .atype = atype_struct_nestable, - .u.struct_nestable.nr_fields = ARRAY_SIZE(ipv6fields), - .u.struct_nestable.fields = ipv6fields, - .u.struct_nestable.alignment = 0, - }, - }, -}; - -enum network_header_types { - NH_NONE, - NH_IPV4, - NH_IPV6, -}; - -static inline unsigned char __get_network_header_type(struct sk_buff *skb) -{ - if (__has_network_hdr(skb)) { - if (skb->protocol == htons(ETH_P_IPV6)) - return NH_IPV6; - else if (skb->protocol == htons(ETH_P_IP)) - return NH_IPV4; - /* Fallthrough for other header types. */ - } - return NH_NONE; -} - -#endif - -LTTNG_TRACEPOINT_ENUM(net_network_header, - TP_ENUM_VALUES( - ctf_enum_value("_unknown", NH_NONE) - ctf_enum_value("_ipv4", NH_IPV4) - ctf_enum_value("_ipv6", NH_IPV6) - ) -) - -LTTNG_TRACEPOINT_EVENT(net_dev_xmit, - - TP_PROTO(struct sk_buff *skb, - int rc, - struct net_device *dev, - unsigned int skb_len), - - TP_ARGS(skb, rc, dev, skb_len), - - TP_FIELDS( - ctf_integer_hex(void *, skbaddr, skb) - ctf_integer(int, rc, rc) - ctf_integer(unsigned int, len, skb_len) - ctf_string(name, dev->name) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(net_dev_template, - - TP_PROTO(struct sk_buff *skb), - - TP_ARGS(skb), - - TP_FIELDS( - ctf_integer_hex(void *, skbaddr, skb) - ctf_integer(unsigned int, len, skb->len) - ctf_string(name, skb->dev->name) - ctf_enum(net_network_header, unsigned char, - network_header_type, __get_network_header_type(skb)) - ctf_custom_field( - ctf_custom_type( - { - .atype = atype_variant_nestable, - .u.variant_nestable.tag_name = "network_header_type", - .u.variant_nestable.choices = network_fields, - .u.variant_nestable.nr_choices = - ARRAY_SIZE(network_fields), - .u.variant_nestable.alignment = 0, - } - ), - network_header, - ctf_custom_code( - bool has_network_header = false; - - /* Copy the network header. */ - switch (__get_network_header_type(skb)) { - case NH_IPV4: { - ctf_align(uint16_t) - ctf_array_type(uint8_t, ip_hdr(skb), - sizeof(struct iphdr)) - has_network_header = true; - break; - } - case NH_IPV6: { - ctf_align(uint16_t) - ctf_array_type(uint8_t, ipv6_hdr(skb), - sizeof(struct ipv6hdr)) - has_network_header = true; - break; - } - default: - /* - * For any other network header - * type, there is nothing to do. - */ - break; - } - - if (has_network_header) { - enum transport_header_types th_type = - __get_transport_header_type(skb); - - /* Transport header type field. */ - ctf_integer_type(unsigned char, th_type) - - /* Copy the transport header. */ - switch (th_type) { - case TH_TCP: { - ctf_align(uint32_t) - ctf_array_type(uint8_t, tcp_hdr(skb), - sizeof(struct tcphdr)) - break; - } - case TH_UDP: { - ctf_align(uint32_t) - ctf_array_type(uint8_t, udp_hdr(skb), - sizeof(struct udphdr)) - break; - } - case TH_ICMP: { - ctf_align(uint32_t) - ctf_array_type(uint8_t, icmp_hdr(skb), - sizeof(struct icmphdr)) - break; - } - default: - /* - * For any other transport header type, - * there is nothing to do. - */ - break; - } - } - ) - ) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(net_dev_template, net_dev_queue, - - TP_PROTO(struct sk_buff *skb), - - TP_ARGS(skb) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_template, - - netif_receive_skb, - - net_if_receive_skb, - - TP_PROTO(struct sk_buff *skb), - - TP_ARGS(skb) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_template, - - netif_rx, - - net_if_rx, - - TP_PROTO(struct sk_buff *skb), - - TP_ARGS(skb) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) - -/* Trace events for the receive entry points */ -LTTNG_TRACEPOINT_EVENT_CLASS(net_dev_receive_entry_template, - - TP_PROTO(const struct sk_buff *skb), - - TP_ARGS(skb), - - TP_FIELDS( - ctf_integer_hex(const void *, skbaddr, skb) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_entry_template, - - napi_gro_frags_entry, - - net_napi_gro_frags_entry, - - TP_PROTO(const struct sk_buff *skb), - - TP_ARGS(skb) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_entry_template, - - napi_gro_receive_entry, - - net_napi_gro_receive_entry, - - TP_PROTO(const struct sk_buff *skb), - - TP_ARGS(skb) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_entry_template, - - netif_receive_skb_entry, - - net_if_receive_skb_entry, - - TP_PROTO(const struct sk_buff *skb), - - TP_ARGS(skb) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_entry_template, - - netif_rx_entry, - - net_if_rx_entry, - - TP_PROTO(const struct sk_buff *skb), - - TP_ARGS(skb) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_entry_template, - - netif_rx_ni_entry, - - net_if_rx_ni_entry, - - TP_PROTO(const struct sk_buff *skb), - - TP_ARGS(skb) -) - -#endif /* kernel > 3.14 */ - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_entry_template, - - netif_receive_skb_list_entry, - - net_if_receive_skb_list_entry, - - TP_PROTO(const struct sk_buff *skb), - - TP_ARGS(skb) -) - -#endif /* kernel > 4.19 */ - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)) - -/* Trace events for the receive exit points */ -LTTNG_TRACEPOINT_EVENT_CLASS(net_dev_receive_exit_template, - - TP_PROTO(int ret), - - TP_ARGS(ret), - - TP_FIELDS( - ctf_integer(int, ret, ret) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_exit_template, - - napi_gro_frags_exit, - - net_napi_gro_frags_exit, - - TP_PROTO(int ret), - - TP_ARGS(ret) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_exit_template, - - napi_gro_receive_exit, - - net_napi_gro_receive_exit, - - TP_PROTO(int ret), - - TP_ARGS(ret) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_exit_template, - - netif_receive_skb_exit, - - net_if_receive_skb_exit, - - TP_PROTO(int ret), - - TP_ARGS(ret) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_exit_template, - - netif_rx_exit, - - net_if_rx_exit, - - TP_PROTO(int ret), - - TP_ARGS(ret) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_exit_template, - - netif_rx_ni_exit, - - net_if_rx_ni_exit, - - TP_PROTO(int ret), - - TP_ARGS(ret) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_exit_template, - - netif_receive_skb_list_exit, - - net_if_receive_skb_list_exit, - - TP_PROTO(int ret), - - TP_ARGS(ret) -) - -#endif /* kernel > 5.0.0 */ - -#endif /* LTTNG_TRACE_NET_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/power.h b/include/instrumentation/events/lttng-module/power.h deleted file mode 100644 index dd03d60a..00000000 --- a/include/instrumentation/events/lttng-module/power.h +++ /dev/null @@ -1,242 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM power - -#if !defined(LTTNG_TRACE_POWER_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_POWER_H - -#include -#include -#include - -LTTNG_TRACEPOINT_EVENT_CLASS(power_cpu, - - TP_PROTO(unsigned int state, unsigned int cpu_id), - - TP_ARGS(state, cpu_id), - - TP_FIELDS( - ctf_integer(u32, state, state) - ctf_integer(u32, cpu_id, cpu_id) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(power_cpu, cpu_idle, - - power_cpu_idle, - - TP_PROTO(unsigned int state, unsigned int cpu_id), - - TP_ARGS(state, cpu_id) -) - -/* This file can get included multiple times, TRACE_HEADER_MULTI_READ at top */ -#ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING -#define _PWR_EVENT_AVOID_DOUBLE_DEFINING - -#define PWR_EVENT_EXIT -1 -#endif - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(power_cpu, cpu_frequency, - - power_cpu_frequency, - - TP_PROTO(unsigned int frequency, unsigned int cpu_id), - - TP_ARGS(frequency, cpu_id) -) - -LTTNG_TRACEPOINT_EVENT_MAP(machine_suspend, - - power_machine_suspend, - - TP_PROTO(unsigned int state), - - TP_ARGS(state), - - TP_FIELDS( - ctf_integer(u32, state, state) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(power_wakeup_source, - - TP_PROTO(const char *name, unsigned int state), - - TP_ARGS(name, state), - - TP_FIELDS( - ctf_string(name, name) - ctf_integer(u64, state, state) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(power_wakeup_source, wakeup_source_activate, - - power_wakeup_source_activate, - - TP_PROTO(const char *name, unsigned int state), - - TP_ARGS(name, state) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(power_wakeup_source, wakeup_source_deactivate, - - power_wakeup_source_deactivate, - - TP_PROTO(const char *name, unsigned int state), - - TP_ARGS(name, state) -) -#endif - -#ifdef CONFIG_EVENT_POWER_TRACING_DEPRECATED - -/* - * The power events are used for cpuidle & suspend (power_start, power_end) - * and for cpufreq (power_frequency) - */ -LTTNG_TRACEPOINT_EVENT_CLASS(power, - - TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), - - TP_ARGS(type, state, cpu_id), - - TP_FIELDS( - ctf_integer(u64, type, type) - ctf_integer(u64, state, state) - ctf_integer(u64, cpu_id, cpu_id) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(power, power_start, - - TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), - - TP_ARGS(type, state, cpu_id) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(power, power_frequency, - - TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), - - TP_ARGS(type, state, cpu_id) -) - -LTTNG_TRACEPOINT_EVENT(power_end, - - TP_PROTO(unsigned int cpu_id), - - TP_ARGS(cpu_id), - - TP_FIELDS( - ctf_integer(u64, cpu_id, cpu_id) - ) -) - -/* Deprecated dummy functions must be protected against multi-declartion */ -#ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED -#define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED - -enum { - POWER_NONE = 0, - POWER_CSTATE = 1, - POWER_PSTATE = 2, -}; -#endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */ - -#else /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */ - -#ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED -#define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED -enum { - POWER_NONE = 0, - POWER_CSTATE = 1, - POWER_PSTATE = 2, -}; - -/* These dummy declaration have to be ripped out when the deprecated - events get removed */ -static inline void trace_power_start(u64 type, u64 state, u64 cpuid) {}; -static inline void trace_power_end(u64 cpuid) {}; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) -static inline void trace_power_start_rcuidle(u64 type, u64 state, u64 cpuid) {}; -static inline void trace_power_end_rcuidle(u64 cpuid) {}; -#endif -static inline void trace_power_frequency(u64 type, u64 state, u64 cpuid) {}; -#endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */ - -#endif /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */ - -/* - * The clock events are used for clock enable/disable and for - * clock rate change - */ -LTTNG_TRACEPOINT_EVENT_CLASS(power_clock, - - TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), - - TP_ARGS(name, state, cpu_id), - - TP_FIELDS( - ctf_string(name, name) - ctf_integer(u64, state, state) - ctf_integer(u64, cpu_id, cpu_id) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(power_clock, clock_enable, - - power_clock_enable, - - TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), - - TP_ARGS(name, state, cpu_id) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(power_clock, clock_disable, - - power_clock_disable, - - TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), - - TP_ARGS(name, state, cpu_id) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(power_clock, clock_set_rate, - - power_clock_set_rate, - - TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), - - TP_ARGS(name, state, cpu_id) -) - -/* - * The power domain events are used for power domains transitions - */ -LTTNG_TRACEPOINT_EVENT_CLASS(power_domain, - - TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), - - TP_ARGS(name, state, cpu_id), - - TP_FIELDS( - ctf_string(name, name) - ctf_integer(u64, state, state) - ctf_integer(u64, cpu_id, cpu_id) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(power_domain, power_domain_target, - - TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), - - TP_ARGS(name, state, cpu_id) -) - -#endif /* LTTNG_TRACE_POWER_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/preemptirq.h b/include/instrumentation/events/lttng-module/preemptirq.h deleted file mode 100644 index 36aa36cb..00000000 --- a/include/instrumentation/events/lttng-module/preemptirq.h +++ /dev/null @@ -1,100 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#ifdef CONFIG_PREEMPTIRQ_EVENTS - -#undef TRACE_SYSTEM -#define TRACE_SYSTEM preemptirq - -#if !defined(LTTNG_TRACE_PREEMPTIRQ_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_PREEMPTIRQ_H - -#include -#include -#include -#include - -/* - * The preemptirq probe is built when CONFIG_PREEMPTIRQ_EVENTS is defined. - */ - -LTTNG_TRACEPOINT_EVENT_CLASS(preemptirq_template, - - TP_PROTO(unsigned long ip, unsigned long parent_ip), - - TP_ARGS(ip, parent_ip), - - TP_FIELDS( - ctf_integer_hex(unsigned long, caller, ip) - ctf_integer_hex(unsigned long, parent, parent_ip) - ) -) - -/* - * Tracing of irq enable / disable events is enabled - * on >= 4.19 when CONFIG_TRACE_IRQFLAGS is defined. - * on previous kernels when CONFIG_PROVE_LOCKING is NOT defined. - */ -#if defined(CONFIG_TRACE_IRQFLAGS) -#define LTTNG_TRACE_IRQ -#elif (LINUX_VERSION_CODE < KERNEL_VERSION(4,19,0) && \ - !defined(CONFIG_PROVE_LOCKING)) -#define LTTNG_TRACE_IRQ -#endif - -#ifdef LTTNG_TRACE_IRQ -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(preemptirq_template, irq_disable, - - preemptirq_irq_disable, - - TP_PROTO(unsigned long ip, unsigned long parent_ip), - - TP_ARGS(ip, parent_ip) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(preemptirq_template, irq_enable, - - preemptirq_irq_enable, - - TP_PROTO(unsigned long ip, unsigned long parent_ip), - - TP_ARGS(ip, parent_ip) -) -#endif /* LTTNG_TRACE_IRQ */ - -/* - * Tracing of preempt enable / disable events is enabled - * on >= 4.19 when CONFIG_TRACE_PREEMPT_TOGGLE is defined. - * on previous kernels when CONFIG_DEBUG_PREEMPT is defined. - */ -#if defined(CONFIG_TRACE_PREEMPT_TOGGLE) -#define LTTNG_TRACE_PREEMPT -#elif (LINUX_VERSION_CODE < KERNEL_VERSION(4,19,0) && \ - defined(CONFIG_DEBUG_PREEMPT)) -#define LTTNG_TRACE_PREEMPT -#endif - -#ifdef LTTNG_TRACE_PREEMPT -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(preemptirq_template, preempt_disable, - - preemptirq_preempt_disable, - - TP_PROTO(unsigned long ip, unsigned long parent_ip), - - TP_ARGS(ip, parent_ip) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(preemptirq_template, preempt_enable, - - preemptirq_preempt_enable, - - TP_PROTO(unsigned long ip, unsigned long parent_ip), - - TP_ARGS(ip, parent_ip) -) -#endif /* LTTNG_TRACE_PREEMPT */ - -#endif /* LTTNG_TRACE_PREEMPTIRQ_H */ - -/* This part must be outside protection */ -#include - -#endif /* CONFIG_PREEMPTIRQ_EVENTS */ diff --git a/include/instrumentation/events/lttng-module/printk.h b/include/instrumentation/events/lttng-module/printk.h deleted file mode 100644 index 75b4ee92..00000000 --- a/include/instrumentation/events/lttng-module/printk.h +++ /dev/null @@ -1,76 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM printk - -#if !defined(LTTNG_TRACE_PRINTK_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_PRINTK_H - -#include -#include - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)) - -LTTNG_TRACEPOINT_EVENT_MAP(console, - - printk_console, - - TP_PROTO(const char *text, size_t len), - - TP_ARGS(text, len), - - TP_FIELDS( - ctf_sequence_text(char, msg, text, size_t, len) - ) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) - -LTTNG_TRACEPOINT_EVENT_MAP(console, - - printk_console, - - TP_PROTO(const char *log_buf, unsigned start, unsigned end, - unsigned log_buf_len), - - TP_ARGS(log_buf, start, end, log_buf_len), - - TP_FIELDS( - ctf_sequence_text(char, msg, log_buf + start, - size_t, end - start) - ) -) - -#else /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) */ - -LTTNG_TRACEPOINT_EVENT_MAP(console, - - printk_console, - - TP_PROTO(const char *log_buf, unsigned start, unsigned end, - unsigned log_buf_len), - - TP_ARGS(log_buf, start, end, log_buf_len), - - TP_FIELDS( - /* - * printk buffer is gathered from two segments on older kernels. - */ - ctf_sequence_text(char, msg1, - log_buf + (start & (log_buf_len - 1)), - size_t, (start & (log_buf_len - 1)) > (end & (log_buf_len - 1)) - ? log_buf_len - (start & (log_buf_len - 1)) - : end - start) - ctf_sequence_text(char, msg2, - log_buf, - size_t, (start & (log_buf_len - 1)) > (end & (log_buf_len - 1)) - ? end & (log_buf_len - 1) - : 0) - ) -) - -#endif - -#endif /* LTTNG_TRACE_PRINTK_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/random.h b/include/instrumentation/events/lttng-module/random.h deleted file mode 100644 index 7cf0908f..00000000 --- a/include/instrumentation/events/lttng-module/random.h +++ /dev/null @@ -1,132 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM random - -#if !defined(LTTNG_TRACE_RANDOM_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_RANDOM_H - -#include -#include - -LTTNG_TRACEPOINT_EVENT_CLASS(random__mix_pool_bytes, - TP_PROTO(const char *pool_name, int bytes, unsigned long IP), - - TP_ARGS(pool_name, bytes, IP), - - TP_FIELDS( - ctf_string(pool_name, pool_name) - ctf_integer(int, bytes, bytes) - ctf_integer_hex(unsigned long, IP, IP) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(random__mix_pool_bytes, mix_pool_bytes, - - random_mix_pool_bytes, - - TP_PROTO(const char *pool_name, int bytes, unsigned long IP), - - TP_ARGS(pool_name, bytes, IP) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(random__mix_pool_bytes, mix_pool_bytes_nolock, - - random_mix_pool_bytes_nolock, - - TP_PROTO(const char *pool_name, int bytes, unsigned long IP), - - TP_ARGS(pool_name, bytes, IP) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)) -LTTNG_TRACEPOINT_EVENT_MAP(credit_entropy_bits, - - random_credit_entropy_bits, - - TP_PROTO(const char *pool_name, int bits, int entropy_count, - unsigned long IP), - - TP_ARGS(pool_name, bits, entropy_count, IP), - - TP_FIELDS( - ctf_string(pool_name, pool_name) - ctf_integer(int, bits, bits) - ctf_integer(int, entropy_count, entropy_count) - ctf_integer_hex(unsigned long, IP, IP) - ) -) -#else -LTTNG_TRACEPOINT_EVENT_MAP(credit_entropy_bits, - - random_credit_entropy_bits, - - TP_PROTO(const char *pool_name, int bits, int entropy_count, - int entropy_total, unsigned long IP), - - TP_ARGS(pool_name, bits, entropy_count, entropy_total, IP), - - TP_FIELDS( - ctf_string(pool_name, pool_name) - ctf_integer(int, bits, bits) - ctf_integer(int, entropy_count, entropy_count) - ctf_integer(int, entropy_total, entropy_total) - ctf_integer_hex(unsigned long, IP, IP) - ) -) -#endif - -LTTNG_TRACEPOINT_EVENT_MAP(get_random_bytes, - - random_get_random_bytes, - - TP_PROTO(int nbytes, unsigned long IP), - - TP_ARGS(nbytes, IP), - - TP_FIELDS( - ctf_integer(int, nbytes, nbytes) - ctf_integer_hex(unsigned long, IP, IP) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(random__extract_entropy, - TP_PROTO(const char *pool_name, int nbytes, int entropy_count, - unsigned long IP), - - TP_ARGS(pool_name, nbytes, entropy_count, IP), - - TP_FIELDS( - ctf_string(pool_name, pool_name) - ctf_integer(int, nbytes, nbytes) - ctf_integer(int, entropy_count, entropy_count) - ctf_integer_hex(unsigned long, IP, IP) - ) -) - - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(random__extract_entropy, extract_entropy, - - random_extract_entropy, - - TP_PROTO(const char *pool_name, int nbytes, int entropy_count, - unsigned long IP), - - TP_ARGS(pool_name, nbytes, entropy_count, IP) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(random__extract_entropy, extract_entropy_user, - - random_extract_entropy_user, - - TP_PROTO(const char *pool_name, int nbytes, int entropy_count, - unsigned long IP), - - TP_ARGS(pool_name, nbytes, entropy_count, IP) -) - - - -#endif /* LTTNG_TRACE_RANDOM_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/rcu.h b/include/instrumentation/events/lttng-module/rcu.h deleted file mode 100644 index 9c7a6de1..00000000 --- a/include/instrumentation/events/lttng-module/rcu.h +++ /dev/null @@ -1,964 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM rcu - -#if !defined(LTTNG_TRACE_RCU_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_RCU_H - -#include -#include - -/* - * Tracepoint for start/end markers used for utilization calculations. - * By convention, the string is of the following forms: - * - * "Start " -- Mark the start of the specified activity, - * such as "context switch". Nesting is permitted. - * "End " -- Mark the end of the specified activity. - * - * An "@" character within "" is a comment character: Data - * reduction scripts will ignore the "@" and the remainder of the line. - */ -LTTNG_TRACEPOINT_EVENT(rcu_utilization, - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) - TP_PROTO(const char *s), -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ - TP_PROTO(char *s), -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ - - TP_ARGS(s), - - TP_FIELDS( - ctf_string(s, s) - ) -) - -#ifdef CONFIG_RCU_TRACE - -#if defined(CONFIG_TREE_RCU) \ - || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) \ - && defined(CONFIG_PREEMPT_RCU)) \ - || defined(CONFIG_TREE_PREEMPT_RCU) - -/* - * Tracepoint for grace-period events: starting and ending a grace - * period ("start" and "end", respectively), a CPU noting the start - * of a new grace period or the end of an old grace period ("cpustart" - * and "cpuend", respectively), a CPU passing through a quiescent - * state ("cpuqs"), a CPU coming online or going offline ("cpuonl" - * and "cpuofl", respectively), and a CPU being kicked for being too - * long in dyntick-idle mode ("kick"). - */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \ - LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0)) -LTTNG_TRACEPOINT_EVENT(rcu_grace_period, - - TP_PROTO(const char *rcuname, unsigned long gp_seq, const char *gpevent), - - TP_ARGS(rcuname, gp_seq, gpevent), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer(unsigned long, gp_seq, gp_seq) - ctf_string(gpevent, gpevent) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) -LTTNG_TRACEPOINT_EVENT(rcu_grace_period, - - TP_PROTO(const char *rcuname, unsigned long gpnum, const char *gpevent), - - TP_ARGS(rcuname, gpnum, gpevent), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer(unsigned long, gpnum, gpnum) - ctf_string(gpevent, gpevent) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(rcu_grace_period, - - TP_PROTO(char *rcuname, unsigned long gpnum, char *gpevent), - - TP_ARGS(rcuname, gpnum, gpevent), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer(unsigned long, gpnum, gpnum) - ctf_string(gpevent, gpevent) - ) -) -#endif - -/* - * Tracepoint for grace-period-initialization events. These are - * distinguished by the type of RCU, the new grace-period number, the - * rcu_node structure level, the starting and ending CPU covered by the - * rcu_node structure, and the mask of CPUs that will be waited for. - * All but the type of RCU are extracted from the rcu_node structure. - */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \ - LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0)) -LTTNG_TRACEPOINT_EVENT(rcu_grace_period_init, - - TP_PROTO(const char *rcuname, unsigned long gp_seq, u8 level, - int grplo, int grphi, unsigned long qsmask), - - TP_ARGS(rcuname, gp_seq, level, grplo, grphi, qsmask), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer(unsigned long, gp_seq, gp_seq) - ctf_integer(u8, level, level) - ctf_integer(int, grplo, grplo) - ctf_integer(int, grphi, grphi) - ctf_integer(unsigned long, qsmask, qsmask) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) -LTTNG_TRACEPOINT_EVENT(rcu_grace_period_init, - - TP_PROTO(const char *rcuname, unsigned long gpnum, u8 level, - int grplo, int grphi, unsigned long qsmask), - - TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer(unsigned long, gpnum, gpnum) - ctf_integer(u8, level, level) - ctf_integer(int, grplo, grplo) - ctf_integer(int, grphi, grphi) - ctf_integer(unsigned long, qsmask, qsmask) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(rcu_grace_period_init, - - TP_PROTO(char *rcuname, unsigned long gpnum, u8 level, - int grplo, int grphi, unsigned long qsmask), - - TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer(unsigned long, gpnum, gpnum) - ctf_integer(u8, level, level) - ctf_integer(int, grplo, grplo) - ctf_integer(int, grphi, grphi) - ctf_integer(unsigned long, qsmask, qsmask) - ) -) -#endif - -/* - * Tracepoint for tasks blocking within preemptible-RCU read-side - * critical sections. Track the type of RCU (which one day might - * include SRCU), the grace-period number that the task is blocking - * (the current or the next), and the task's PID. - */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \ - LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0)) -LTTNG_TRACEPOINT_EVENT(rcu_preempt_task, - - TP_PROTO(const char *rcuname, int pid, unsigned long gp_seq), - - TP_ARGS(rcuname, pid, gp_seq), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer(unsigned long, gp_seq, gp_seq) - ctf_integer(int, pid, pid) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) -LTTNG_TRACEPOINT_EVENT(rcu_preempt_task, - - TP_PROTO(const char *rcuname, int pid, unsigned long gpnum), - - TP_ARGS(rcuname, pid, gpnum), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer(unsigned long, gpnum, gpnum) - ctf_integer(int, pid, pid) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(rcu_preempt_task, - - TP_PROTO(char *rcuname, int pid, unsigned long gpnum), - - TP_ARGS(rcuname, pid, gpnum), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer(unsigned long, gpnum, gpnum) - ctf_integer(int, pid, pid) - ) -) -#endif - -/* - * Tracepoint for tasks that blocked within a given preemptible-RCU - * read-side critical section exiting that critical section. Track the - * type of RCU (which one day might include SRCU) and the task's PID. - */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \ - LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0)) -LTTNG_TRACEPOINT_EVENT(rcu_unlock_preempted_task, - - TP_PROTO(const char *rcuname, unsigned long gp_seq, int pid), - - TP_ARGS(rcuname, gp_seq, pid), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer(unsigned long, gp_seq, gp_seq) - ctf_integer(int, pid, pid) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) -LTTNG_TRACEPOINT_EVENT(rcu_unlock_preempted_task, - - TP_PROTO(const char *rcuname, unsigned long gpnum, int pid), - - TP_ARGS(rcuname, gpnum, pid), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer(unsigned long, gpnum, gpnum) - ctf_integer(int, pid, pid) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(rcu_unlock_preempted_task, - - TP_PROTO(char *rcuname, unsigned long gpnum, int pid), - - TP_ARGS(rcuname, gpnum, pid), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer(unsigned long, gpnum, gpnum) - ctf_integer(int, pid, pid) - ) -) -#endif - -/* - * Tracepoint for quiescent-state-reporting events. These are - * distinguished by the type of RCU, the grace-period number, the - * mask of quiescent lower-level entities, the rcu_node structure level, - * the starting and ending CPU covered by the rcu_node structure, and - * whether there are any blocked tasks blocking the current grace period. - * All but the type of RCU are extracted from the rcu_node structure. - */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \ - LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0)) -LTTNG_TRACEPOINT_EVENT(rcu_quiescent_state_report, - - TP_PROTO(const char *rcuname, unsigned long gp_seq, - unsigned long mask, unsigned long qsmask, - u8 level, int grplo, int grphi, int gp_tasks), - - TP_ARGS(rcuname, gp_seq, mask, qsmask, level, grplo, grphi, gp_tasks), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer(unsigned long, gp_seq, gp_seq) - ctf_integer(unsigned long, mask, mask) - ctf_integer(unsigned long, qsmask, qsmask) - ctf_integer(u8, level, level) - ctf_integer(int, grplo, grplo) - ctf_integer(int, grphi, grphi) - ctf_integer(u8, gp_tasks, gp_tasks) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) -LTTNG_TRACEPOINT_EVENT(rcu_quiescent_state_report, - - TP_PROTO(const char *rcuname, unsigned long gpnum, - unsigned long mask, unsigned long qsmask, - u8 level, int grplo, int grphi, int gp_tasks), - - TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer(unsigned long, gpnum, gpnum) - ctf_integer(unsigned long, mask, mask) - ctf_integer(unsigned long, qsmask, qsmask) - ctf_integer(u8, level, level) - ctf_integer(int, grplo, grplo) - ctf_integer(int, grphi, grphi) - ctf_integer(u8, gp_tasks, gp_tasks) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(rcu_quiescent_state_report, - - TP_PROTO(char *rcuname, unsigned long gpnum, - unsigned long mask, unsigned long qsmask, - u8 level, int grplo, int grphi, int gp_tasks), - - TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer(unsigned long, gpnum, gpnum) - ctf_integer(unsigned long, mask, mask) - ctf_integer(unsigned long, qsmask, qsmask) - ctf_integer(u8, level, level) - ctf_integer(int, grplo, grplo) - ctf_integer(int, grphi, grphi) - ctf_integer(u8, gp_tasks, gp_tasks) - ) -) -#endif - -/* - * Tracepoint for quiescent states detected by force_quiescent_state(). - * These trace events include the type of RCU, the grace-period number - * that was blocked by the CPU, the CPU itself, and the type of quiescent - * state, which can be "dti" for dyntick-idle mode, "ofl" for CPU offline, - * or "kick" when kicking a CPU that has been in dyntick-idle mode for - * too long. - */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \ - LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0)) -LTTNG_TRACEPOINT_EVENT(rcu_fqs, - - TP_PROTO(const char *rcuname, unsigned long gp_seq, int cpu, const char *qsevent), - - TP_ARGS(rcuname, gp_seq, cpu, qsevent), - - TP_FIELDS( - ctf_integer(unsigned long, gp_seq, gp_seq) - ctf_integer(int, cpu, cpu) - ctf_string(rcuname, rcuname) - ctf_string(qsevent, qsevent) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) -LTTNG_TRACEPOINT_EVENT(rcu_fqs, - - TP_PROTO(const char *rcuname, unsigned long gpnum, int cpu, const char *qsevent), - - TP_ARGS(rcuname, gpnum, cpu, qsevent), - - TP_FIELDS( - ctf_integer(unsigned long, gpnum, gpnum) - ctf_integer(int, cpu, cpu) - ctf_string(rcuname, rcuname) - ctf_string(qsevent, qsevent) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(rcu_fqs, - - TP_PROTO(char *rcuname, unsigned long gpnum, int cpu, char *qsevent), - - TP_ARGS(rcuname, gpnum, cpu, qsevent), - - TP_FIELDS( - ctf_integer(unsigned long, gpnum, gpnum) - ctf_integer(int, cpu, cpu) - ctf_string(rcuname, rcuname) - ctf_string(qsevent, qsevent) - ) -) -#endif - -#endif /* - * #if defined(CONFIG_TREE_RCU) - * || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) - * && defined(CONFIG_PREEMPT_RCU)) - * || defined(CONFIG_TREE_PREEMPT_RCU) - */ - -/* - * Tracepoint for dyntick-idle entry/exit events. These take a string - * as argument: "Start" for entering dyntick-idle mode, "End" for - * leaving it, "--=" for events moving towards idle, and "++=" for events - * moving away from idle. "Error on entry: not idle task" and "Error on - * exit: not idle task" indicate that a non-idle task is erroneously - * toying with the idle loop. - * - * These events also take a pair of numbers, which indicate the nesting - * depth before and after the event of interest. Note that task-related - * events use the upper bits of each number, while interrupt-related - * events use the lower bits. - */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) \ - || LTTNG_KERNEL_RANGE(5,5,6, 5,6,0) \ - || LTTNG_KERNEL_RANGE(5,4,22, 5,5,0) -LTTNG_TRACEPOINT_EVENT(rcu_dyntick, - - TP_PROTO(const char *polarity, long oldnesting, long newnesting, int dynticks), - - TP_ARGS(polarity, oldnesting, newnesting, dynticks), - - TP_FIELDS( - ctf_string(polarity, polarity) - ctf_integer(long, oldnesting, oldnesting) - ctf_integer(long, newnesting, newnesting) - ctf_integer(int, dynticks, dynticks) - ) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0)) -LTTNG_TRACEPOINT_EVENT(rcu_dyntick, - - TP_PROTO(const char *polarity, long oldnesting, long newnesting, atomic_t dynticks), - - TP_ARGS(polarity, oldnesting, newnesting, dynticks), - - TP_FIELDS( - ctf_string(polarity, polarity) - ctf_integer(long, oldnesting, oldnesting) - ctf_integer(long, newnesting, newnesting) - ctf_integer(int, dynticks, atomic_read(&dynticks)) - ) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) -LTTNG_TRACEPOINT_EVENT(rcu_dyntick, - - TP_PROTO(const char *polarity, long long oldnesting, long long newnesting), - - TP_ARGS(polarity, oldnesting, newnesting), - - TP_FIELDS( - ctf_string(polarity, polarity) - ctf_integer(long long, oldnesting, oldnesting) - ctf_integer(long long, newnesting, newnesting) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) -LTTNG_TRACEPOINT_EVENT(rcu_dyntick, - - TP_PROTO(char *polarity, long long oldnesting, long long newnesting), - - TP_ARGS(polarity, oldnesting, newnesting), - - TP_FIELDS( - ctf_string(polarity, polarity) - ctf_integer(long long, oldnesting, oldnesting) - ctf_integer(long long, newnesting, newnesting) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(rcu_dyntick, - - TP_PROTO(char *polarity), - - TP_ARGS(polarity), - - TP_FIELDS( - ctf_string(polarity, polarity) - ) -) -#endif - - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) -/* - * Tracepoint for RCU preparation for idle, the goal being to get RCU - * processing done so that the current CPU can shut off its scheduling - * clock and enter dyntick-idle mode. One way to accomplish this is - * to drain all RCU callbacks from this CPU, and the other is to have - * done everything RCU requires for the current grace period. In this - * latter case, the CPU will be awakened at the end of the current grace - * period in order to process the remainder of its callbacks. - * - * These tracepoints take a string as argument: - * - * "No callbacks": Nothing to do, no callbacks on this CPU. - * "In holdoff": Nothing to do, holding off after unsuccessful attempt. - * "Begin holdoff": Attempt failed, don't retry until next jiffy. - * "Dyntick with callbacks": Entering dyntick-idle despite callbacks. - * "Dyntick with lazy callbacks": Entering dyntick-idle w/lazy callbacks. - * "More callbacks": Still more callbacks, try again to clear them out. - * "Callbacks drained": All callbacks processed, off to dyntick idle! - * "Timer": Timer fired to cause CPU to continue processing callbacks. - * "Demigrate": Timer fired on wrong CPU, woke up correct CPU. - * "Cleanup after idle": Idle exited, timer canceled. - */ -LTTNG_TRACEPOINT_EVENT(rcu_prep_idle, - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) - TP_PROTO(const char *reason), -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ - TP_PROTO(char *reason), -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ - - TP_ARGS(reason), - - TP_FIELDS( - ctf_string(reason, reason) - ) -) -#endif - -/* - * Tracepoint for the registration of a single RCU callback function. - * The first argument is the type of RCU, the second argument is - * a pointer to the RCU callback itself, the third element is the - * number of lazy callbacks queued, and the fourth element is the - * total number of callbacks queued. - */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) -LTTNG_TRACEPOINT_EVENT(rcu_callback, - - TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen), - - TP_ARGS(rcuname, rhp, qlen), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer_hex(void *, rhp, rhp) - ctf_integer_hex(void *, func, rhp->func) - ctf_integer(long, qlen, qlen) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) -LTTNG_TRACEPOINT_EVENT(rcu_callback, - - TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen_lazy, - long qlen), - - TP_ARGS(rcuname, rhp, qlen_lazy, qlen), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer_hex(void *, rhp, rhp) - ctf_integer_hex(void *, func, rhp->func) - ctf_integer(long, qlen_lazy, qlen_lazy) - ctf_integer(long, qlen, qlen) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) -LTTNG_TRACEPOINT_EVENT(rcu_callback, - - TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen_lazy, - long qlen), - - TP_ARGS(rcuname, rhp, qlen_lazy, qlen), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer_hex(void *, rhp, rhp) - ctf_integer_hex(void *, func, rhp->func) - ctf_integer(long, qlen_lazy, qlen_lazy) - ctf_integer(long, qlen, qlen) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(rcu_callback, - - TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen), - - TP_ARGS(rcuname, rhp, qlen), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer_hex(void *, rhp, rhp) - ctf_integer_hex(void *, func, rhp->func) - ctf_integer(long, qlen, qlen) - ) -) -#endif - - -/* - * Tracepoint for the registration of a single RCU callback of the special - * kfree() form. The first argument is the RCU type, the second argument - * is a pointer to the RCU callback, the third argument is the offset - * of the callback within the enclosing RCU-protected data structure, - * the fourth argument is the number of lazy callbacks queued, and the - * fifth argument is the total number of callbacks queued. - */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) -LTTNG_TRACEPOINT_EVENT(rcu_kfree_callback, - - TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset, - long qlen), - - TP_ARGS(rcuname, rhp, offset, qlen), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer_hex(void *, rhp, rhp) - ctf_integer_hex(unsigned long, offset, offset) - ctf_integer(long, qlen, qlen) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) -LTTNG_TRACEPOINT_EVENT(rcu_kfree_callback, - - TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset, - long qlen_lazy, long qlen), - - TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer_hex(void *, rhp, rhp) - ctf_integer_hex(unsigned long, offset, offset) - ctf_integer(long, qlen_lazy, qlen_lazy) - ctf_integer(long, qlen, qlen) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) -LTTNG_TRACEPOINT_EVENT(rcu_kfree_callback, - - TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset, - long qlen_lazy, long qlen), - - TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer_hex(void *, rhp, rhp) - ctf_integer_hex(unsigned long, offset, offset) - ctf_integer(long, qlen_lazy, qlen_lazy) - ctf_integer(long, qlen, qlen) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(rcu_kfree_callback, - - TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset, - long qlen), - - TP_ARGS(rcuname, rhp, offset, qlen), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer_hex(void *, rhp, rhp) - ctf_integer_hex(unsigned long, offset, offset) - ctf_integer(long, qlen, qlen) - ) -) -#endif - -/* - * Tracepoint for marking the beginning rcu_do_batch, performed to start - * RCU callback invocation. The first argument is the RCU flavor, - * the second is the number of lazy callbacks queued, the third is - * the total number of callbacks queued, and the fourth argument is - * the current RCU-callback batch limit. - */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) -LTTNG_TRACEPOINT_EVENT(rcu_batch_start, - - TP_PROTO(const char *rcuname, long qlen, long blimit), - - TP_ARGS(rcuname, qlen, blimit), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer(long, qlen, qlen) - ctf_integer(long, blimit, blimit) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) -LTTNG_TRACEPOINT_EVENT(rcu_batch_start, - - TP_PROTO(const char *rcuname, long qlen_lazy, long qlen, long blimit), - - TP_ARGS(rcuname, qlen_lazy, qlen, blimit), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer(long, qlen_lazy, qlen_lazy) - ctf_integer(long, qlen, qlen) - ctf_integer(long, blimit, blimit) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) -LTTNG_TRACEPOINT_EVENT(rcu_batch_start, - - TP_PROTO(char *rcuname, long qlen_lazy, long qlen, long blimit), - - TP_ARGS(rcuname, qlen_lazy, qlen, blimit), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer(long, qlen_lazy, qlen_lazy) - ctf_integer(long, qlen, qlen) - ctf_integer(long, blimit, blimit) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) -LTTNG_TRACEPOINT_EVENT(rcu_batch_start, - - TP_PROTO(char *rcuname, long qlen_lazy, long qlen, int blimit), - - TP_ARGS(rcuname, qlen_lazy, qlen, blimit), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer(long, qlen_lazy, qlen_lazy) - ctf_integer(long, qlen, qlen) - ctf_integer(int, blimit, blimit) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(rcu_batch_start, - - TP_PROTO(char *rcuname, long qlen, int blimit), - - TP_ARGS(rcuname, qlen, blimit), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer(long, qlen, qlen) - ctf_integer(int, blimit, blimit) - ) -) -#endif - -/* - * Tracepoint for the invocation of a single RCU callback function. - * The first argument is the type of RCU, and the second argument is - * a pointer to the RCU callback itself. - */ -LTTNG_TRACEPOINT_EVENT(rcu_invoke_callback, - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) - TP_PROTO(const char *rcuname, struct rcu_head *rhp), -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ - TP_PROTO(char *rcuname, struct rcu_head *rhp), -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ - - TP_ARGS(rcuname, rhp), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer_hex(void *, rhp, rhp) - ctf_integer_hex(void *, func, rhp->func) - ) -) - -/* - * Tracepoint for the invocation of a single RCU callback of the special - * kfree() form. The first argument is the RCU flavor, the second - * argument is a pointer to the RCU callback, and the third argument - * is the offset of the callback within the enclosing RCU-protected - * data structure. - */ -LTTNG_TRACEPOINT_EVENT(rcu_invoke_kfree_callback, - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) - TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset), -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ - TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset), -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ - - TP_ARGS(rcuname, rhp, offset), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer_hex(void *, rhp, rhp) - ctf_integer(unsigned long, offset, offset) - ) -) - -/* - * Tracepoint for exiting rcu_do_batch after RCU callbacks have been - * invoked. The first argument is the name of the RCU flavor, - * the second argument is number of callbacks actually invoked, - * the third argument (cb) is whether or not any of the callbacks that - * were ready to invoke at the beginning of this batch are still - * queued, the fourth argument (nr) is the return value of need_resched(), - * the fifth argument (iit) is 1 if the current task is the idle task, - * and the sixth argument (risk) is the return value from - * rcu_is_callbacks_kthread(). - */ -LTTNG_TRACEPOINT_EVENT(rcu_batch_end, - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) - TP_PROTO(const char *rcuname, int callbacks_invoked, - char cb, char nr, char iit, char risk), - - TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk), -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) - TP_PROTO(const char *rcuname, int callbacks_invoked, - bool cb, bool nr, bool iit, bool risk), - - TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk), -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) - TP_PROTO(char *rcuname, int callbacks_invoked, - bool cb, bool nr, bool iit, bool risk), - - TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk), -#else - TP_PROTO(char *rcuname, int callbacks_invoked), - - TP_ARGS(rcuname, callbacks_invoked), -#endif - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_integer(int, callbacks_invoked, callbacks_invoked) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) - ctf_integer(char, cb, cb) - ctf_integer(char, nr, nr) - ctf_integer(char, iit, iit) - ctf_integer(char, risk, risk) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) - ctf_integer(bool, cb, cb) - ctf_integer(bool, nr, nr) - ctf_integer(bool, iit, iit) - ctf_integer(bool, risk, risk) -#endif - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) -/* - * Tracepoint for rcutorture readers. The first argument is the name - * of the RCU flavor from rcutorture's viewpoint and the second argument - * is the callback address. - */ -LTTNG_TRACEPOINT_EVENT(rcu_torture_read, - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) - TP_PROTO(const char *rcutorturename, struct rcu_head *rhp, - unsigned long secs, unsigned long c_old, unsigned long c), - - TP_ARGS(rcutorturename, rhp, secs, c_old, c), -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) - TP_PROTO(char *rcutorturename, struct rcu_head *rhp, - unsigned long secs, unsigned long c_old, unsigned long c), - - TP_ARGS(rcutorturename, rhp, secs, c_old, c), -#else - TP_PROTO(char *rcutorturename, struct rcu_head *rhp), - - TP_ARGS(rcutorturename, rhp), -#endif - - TP_FIELDS( - ctf_string(rcutorturename, rcutorturename) - ctf_integer_hex(struct rcu_head *, rhp, rhp) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) - ctf_integer(unsigned long, secs, secs) - ctf_integer(unsigned long, c_old, c_old) - ctf_integer(unsigned long, c, c) -#endif - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) -/* - * Tracepoint for _rcu_barrier() execution. The string "s" describes - * the _rcu_barrier phase: - * "Begin": rcu_barrier_callback() started. - * "Check": rcu_barrier_callback() checking for piggybacking. - * "EarlyExit": rcu_barrier_callback() piggybacked, thus early exit. - * "Inc1": rcu_barrier_callback() piggyback check counter incremented. - * "Offline": rcu_barrier_callback() found offline CPU - * "OnlineQ": rcu_barrier_callback() found online CPU with callbacks. - * "OnlineNQ": rcu_barrier_callback() found online CPU, no callbacks. - * "IRQ": An rcu_barrier_callback() callback posted on remote CPU. - * "CB": An rcu_barrier_callback() invoked a callback, not the last. - * "LastCB": An rcu_barrier_callback() invoked the last callback. - * "Inc2": rcu_barrier_callback() piggyback check counter incremented. - * The "cpu" argument is the CPU or -1 if meaningless, the "cnt" argument - * is the count of remaining callbacks, and "done" is the piggybacking count. - */ -LTTNG_TRACEPOINT_EVENT(rcu_barrier, - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) - TP_PROTO(const char *rcuname, const char *s, int cpu, int cnt, unsigned long done), -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ - TP_PROTO(char *rcuname, char *s, int cpu, int cnt, unsigned long done), -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ - - TP_ARGS(rcuname, s, cpu, cnt, done), - - TP_FIELDS( - ctf_string(rcuname, rcuname) - ctf_string(s, s) - ctf_integer(int, cpu, cpu) - ctf_integer(int, cnt, cnt) - ctf_integer(unsigned long, done, done) - ) -) -#endif - -#else /* #ifdef CONFIG_RCU_TRACE */ - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \ - LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0)) -#define trace_rcu_grace_period(rcuname, gp_seq, gpevent) do { } while (0) -#define trace_rcu_grace_period_init(rcuname, gp_seq, level, grplo, grphi, \ - qsmask) do { } while (0) -#define trace_rcu_preempt_task(rcuname, pid, gp_seq) do { } while (0) -#define trace_rcu_unlock_preempted_task(rcuname, gp_seq, pid) do { } while (0) -#define trace_rcu_quiescent_state_report(rcuname, gp_seq, mask, qsmask, level, \ - grplo, grphi, gp_tasks) do { } \ - while (0) -#define trace_rcu_fqs(rcuname, gp_seq, cpu, qsevent) do { } while (0) -#else -#define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0) -#define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \ - qsmask) do { } while (0) -#define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0) -#define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0) -#define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \ - grplo, grphi, gp_tasks) do { } \ - while (0) -#define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0)) -#define trace_rcu_dyntick(polarity, oldnesting, newnesting, dyntick) do { } while (0) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) -#define trace_rcu_dyntick(polarity, oldnesting, newnesting) do { } while (0) -#else -#define trace_rcu_dyntick(polarity) do { } while (0) -#endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) -#define trace_rcu_prep_idle(reason) do { } while (0) -#endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) -#define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0) -#define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \ - do { } while (0) -#define trace_rcu_batch_start(rcuname, qlen_lazy, qlen, blimit) \ - do { } while (0) -#else -#define trace_rcu_callback(rcuname, rhp, qlen) do { } while (0) -#define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen) do { } while (0) -#define trace_rcu_batch_start(rcuname, qlen, blimit) do { } while (0) -#endif -#define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0) -#define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) -#define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \ - do { } while (0) -#else -#define trace_rcu_batch_end(rcuname, callbacks_invoked) do { } while (0) -#endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) -#define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \ - do { } while (0) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) -#define trace_rcu_torture_read(rcutorturename, rhp) do { } while (0) -#endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) -#define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0) -#endif -#endif /* #else #ifdef CONFIG_RCU_TRACE */ - -#endif /* LTTNG_TRACE_RCU_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/regmap.h b/include/instrumentation/events/lttng-module/regmap.h deleted file mode 100644 index 8af4d5ae..00000000 --- a/include/instrumentation/events/lttng-module/regmap.h +++ /dev/null @@ -1,145 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM regmap - -#if !defined(LTTNG_TRACE_REGMAP_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_REGMAP_H - -#include -#include -#include - -#ifndef _TRACE_REGMAP_DEF_ -#define _TRACE_REGMAP_DEF_ -struct device; -struct regmap; -#endif - -/* - * Log register events - */ -LTTNG_TRACEPOINT_EVENT_CLASS(regmap_reg, - - TP_PROTO(struct regmap *map, unsigned int reg, - unsigned int val), - - TP_ARGS(map, reg, val), - - TP_FIELDS( - ctf_string(name, regmap_name(map)) - ctf_integer(unsigned int, reg, reg) - ctf_integer(unsigned int, val, val) - ) -) -LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_reg, regmap_reg_write, - - TP_PROTO(struct regmap *map, unsigned int reg, - unsigned int val), - - TP_ARGS(map, reg, val) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_reg, regmap_reg_read, - - TP_PROTO(struct regmap *map, unsigned int reg, - unsigned int val), - - TP_ARGS(map, reg, val) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_reg, regmap_reg_read_cache, - - TP_PROTO(struct regmap *map, unsigned int reg, - unsigned int val), - - TP_ARGS(map, reg, val) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(regmap_block, - - TP_PROTO(struct regmap *map, unsigned int reg, int count), - - TP_ARGS(map, reg, count), - - TP_FIELDS( - ctf_string(name, regmap_name(map)) - ctf_integer(unsigned int, reg, reg) - ctf_integer(int, count, count) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_block, regmap_hw_read_start, - - TP_PROTO(struct regmap *map, unsigned int reg, int count), - - TP_ARGS(map, reg, count) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_block, regmap_hw_read_done, - - TP_PROTO(struct regmap *map, unsigned int reg, int count), - - TP_ARGS(map, reg, count) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_block, regmap_hw_write_start, - - TP_PROTO(struct regmap *map, unsigned int reg, int count), - - TP_ARGS(map, reg, count) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_block, regmap_hw_write_done, - - TP_PROTO(struct regmap *map, unsigned int reg, int count), - - TP_ARGS(map, reg, count) -) - -LTTNG_TRACEPOINT_EVENT_MAP(regcache_sync, - - regmap_regcache_sync, - - TP_PROTO(struct regmap *map, const char *type, - const char *status), - - TP_ARGS(map, type, status), - - TP_FIELDS( - ctf_string(name, regmap_name(map)) - ctf_string(status, status) - ctf_string(type, type) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(regmap_bool, - - TP_PROTO(struct regmap *map, bool flag), - - TP_ARGS(map, flag), - - TP_FIELDS( - ctf_string(name, regmap_name(map)) - ctf_integer(int, flag, flag) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_bool, regmap_cache_only, - - TP_PROTO(struct regmap *map, bool flag), - - TP_ARGS(map, flag) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_bool, regmap_cache_bypass, - - TP_PROTO(struct regmap *map, bool flag), - - TP_ARGS(map, flag) - -) - -#endif /* LTTNG_TRACE_REGMAP_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/regulator.h b/include/instrumentation/events/lttng-module/regulator.h deleted file mode 100644 index bfdb6b65..00000000 --- a/include/instrumentation/events/lttng-module/regulator.h +++ /dev/null @@ -1,118 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM regulator - -#if !defined(LTTNG_TRACE_REGULATOR_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_REGULATOR_H - -#include -#include - -/* - * Events which just log themselves and the regulator name for enable/disable - * type tracking. - */ -LTTNG_TRACEPOINT_EVENT_CLASS(regulator_basic, - - TP_PROTO(const char *name), - - TP_ARGS(name), - - TP_FIELDS( - ctf_string(name, name) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(regulator_basic, regulator_enable, - - TP_PROTO(const char *name), - - TP_ARGS(name) - -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(regulator_basic, regulator_enable_delay, - - TP_PROTO(const char *name), - - TP_ARGS(name) - -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(regulator_basic, regulator_enable_complete, - - TP_PROTO(const char *name), - - TP_ARGS(name) - -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(regulator_basic, regulator_disable, - - TP_PROTO(const char *name), - - TP_ARGS(name) - -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(regulator_basic, regulator_disable_complete, - - TP_PROTO(const char *name), - - TP_ARGS(name) - -) - -/* - * Events that take a range of numerical values, mostly for voltages - * and so on. - */ -LTTNG_TRACEPOINT_EVENT_CLASS(regulator_range, - - TP_PROTO(const char *name, int min, int max), - - TP_ARGS(name, min, max), - - TP_FIELDS( - ctf_string(name, name) - ctf_integer(int, min, min) - ctf_integer(int, max, max) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(regulator_range, regulator_set_voltage, - - TP_PROTO(const char *name, int min, int max), - - TP_ARGS(name, min, max) - -) - - -/* - * Events that take a single value, mostly for readback and refcounts. - */ -LTTNG_TRACEPOINT_EVENT_CLASS(regulator_value, - - TP_PROTO(const char *name, unsigned int val), - - TP_ARGS(name, val), - - TP_FIELDS( - ctf_string(name, name) - ctf_integer(unsigned int, val, val) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(regulator_value, regulator_set_voltage_complete, - - TP_PROTO(const char *name, unsigned int value), - - TP_ARGS(name, value) - -) - -#endif /* _TRACE_POWER_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/rpc.h b/include/instrumentation/events/lttng-module/rpc.h deleted file mode 100644 index 90499aee..00000000 --- a/include/instrumentation/events/lttng-module/rpc.h +++ /dev/null @@ -1,366 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM rpc - -#if !defined(LTTNG_TRACE_RPC_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_RPC_H - -#include -#include -#include - -#ifndef ONCE_LTTNG_RPC_H -#define ONCE_LTTNG_RPC_H - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) -static inline -int lttng_get_clid(const struct rpc_task *task) -{ - struct rpc_clnt *tk_client; - - tk_client = task->tk_client; - if (!tk_client) - return -1; - /* - * The cl_clid field is always initialized to positive signed - * integers. Negative signed integer values are treated as - * errors. - */ - return (int) tk_client->cl_clid; -} -#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ - -#endif /* ONCE_LTTNG_RPC_H */ - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, - - TP_PROTO(const struct rpc_task *task), - - TP_ARGS(task), - - TP_FIELDS( - ctf_integer(unsigned int, task_id, task->tk_pid) - ctf_integer(int, client_id, lttng_get_clid(task)) - ctf_integer(int, status, task->tk_status) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status, - TP_PROTO(const struct rpc_task *task), - - TP_ARGS(task) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status, - TP_PROTO(const struct rpc_task *task), - - TP_ARGS(task) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, - - TP_PROTO(struct rpc_task *task), - - TP_ARGS(task), - - TP_FIELDS( - ctf_integer(unsigned int, task_id, task->tk_pid) - ctf_integer(int, client_id, lttng_get_clid(task)) - ctf_integer(int, status, task->tk_status) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status, - TP_PROTO(struct rpc_task *task), - - TP_ARGS(task) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status, - TP_PROTO(struct rpc_task *task), - - TP_ARGS(task) -) -#else -LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, - - TP_PROTO(struct rpc_task *task), - - TP_ARGS(task), - - TP_FIELDS( - ctf_integer_hex(const struct rpc_task *, task, task) - ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client) - ctf_integer(int, status, task->tk_status) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status, - TP_PROTO(struct rpc_task *task), - - TP_ARGS(task) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status, - TP_PROTO(struct rpc_task *task), - - TP_ARGS(task) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)) -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_connect_status, - TP_PROTO(const struct rpc_task *task), - - TP_ARGS(task) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) -LTTNG_TRACEPOINT_EVENT(rpc_connect_status, - TP_PROTO(const struct rpc_task *task), - - TP_ARGS(task), - - TP_FIELDS( - ctf_integer(unsigned int, task_id, task->tk_pid) - ctf_integer(int, client_id, lttng_get_clid(task)) - ctf_integer(int, status, task->tk_status) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) -LTTNG_TRACEPOINT_EVENT(rpc_connect_status, - TP_PROTO(struct rpc_task *task, int status), - - TP_ARGS(task, status), - - TP_FIELDS( - ctf_integer(unsigned int, task_id, task->tk_pid) - ctf_integer(int, client_id, lttng_get_clid(task)) - ctf_integer(int, status, status) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(rpc_connect_status, - TP_PROTO(struct rpc_task *task, int status), - - TP_ARGS(task, status), - - TP_FIELDS( - ctf_integer_hex(const struct rpc_task *, task, task) - ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client) - ctf_integer(int, status, status) - ) -) -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running, - - TP_PROTO(const struct rpc_task *task, const void *action), - - TP_ARGS(task, action), - - TP_FIELDS( - ctf_integer(unsigned int, task_id, task->tk_pid) - ctf_integer(int, client_id, lttng_get_clid(task)) - ctf_integer_hex(const void *, action, action) - ctf_integer(unsigned long, runstate, task->tk_runstate) - ctf_integer(int, status, task->tk_status) - ctf_integer(unsigned short, flags, task->tk_flags) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin, - - TP_PROTO(const struct rpc_task *task, const void *action), - - TP_ARGS(task, action) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action, - - TP_PROTO(const struct rpc_task *task, const void *action), - - TP_ARGS(task, action) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete, - - TP_PROTO(const struct rpc_task *task, const void *action), - - TP_ARGS(task, action) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued, - - TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q), - - TP_ARGS(task, q), - - TP_FIELDS( - ctf_integer(unsigned int, task_id, task->tk_pid) - ctf_integer(int, client_id, lttng_get_clid(task)) - ctf_integer(unsigned long, timeout, task->tk_timeout) - ctf_integer(unsigned long, runstate, task->tk_runstate) - ctf_integer(int, status, task->tk_status) - ctf_integer(unsigned short, flags, task->tk_flags) - ctf_string(q_name, rpc_qname(q)) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep, - - TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q), - - TP_ARGS(task, q) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup, - - TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q), - - TP_ARGS(task, q) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running, - - TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), - - TP_ARGS(clnt, task, action), - - TP_FIELDS( - ctf_integer(unsigned int, task_id, task->tk_pid) - ctf_integer(int, client_id, lttng_get_clid(task)) - ctf_integer_hex(const void *, action, action) - ctf_integer(unsigned long, runstate, task->tk_runstate) - ctf_integer(int, status, task->tk_status) - ctf_integer(unsigned short, flags, task->tk_flags) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin, - - TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), - - TP_ARGS(clnt, task, action) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action, - - TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), - - TP_ARGS(clnt, task, action) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete, - - TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), - - TP_ARGS(clnt, task, action) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued, - - TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), - - TP_ARGS(clnt, task, q), - - TP_FIELDS( - ctf_integer(unsigned int, task_id, task->tk_pid) - ctf_integer(int, client_id, lttng_get_clid(task)) - ctf_integer(unsigned long, timeout, task->tk_timeout) - ctf_integer(unsigned long, runstate, task->tk_runstate) - ctf_integer(int, status, task->tk_status) - ctf_integer(unsigned short, flags, task->tk_flags) - ctf_string(q_name, rpc_qname(q)) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep, - - TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), - - TP_ARGS(clnt, task, q) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup, - - TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), - - TP_ARGS(clnt, task, q) -) - -#else -LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running, - - TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), - - TP_ARGS(clnt, task, action), - - TP_FIELDS( - ctf_integer_hex(const struct rpc_clnt *, clnt, clnt) - ctf_integer_hex(const struct rpc_task *, task, task) - ctf_integer_hex(const void *, action, action) - ctf_integer(unsigned long, runstate, task->tk_runstate) - ctf_integer(int, status, task->tk_status) - ctf_integer(unsigned short, flags, task->tk_flags) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin, - - TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), - - TP_ARGS(clnt, task, action) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action, - - TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), - - TP_ARGS(clnt, task, action) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete, - - TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), - - TP_ARGS(clnt, task, action) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued, - - TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), - - TP_ARGS(clnt, task, q), - - TP_FIELDS( - ctf_integer_hex(const struct rpc_clnt *, clnt, clnt) - ctf_integer_hex(const struct rpc_task *, task, task) - ctf_integer(unsigned long, timeout, task->tk_timeout) - ctf_integer(unsigned long, runstate, task->tk_runstate) - ctf_integer(int, status, task->tk_status) - ctf_integer(unsigned short, flags, task->tk_flags) - ctf_string(q_name, rpc_qname(q)) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep, - - TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), - - TP_ARGS(clnt, task, q) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup, - - TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), - - TP_ARGS(clnt, task, q) -) -#endif - -#endif /* LTTNG_TRACE_RPC_H */ - -#include diff --git a/include/instrumentation/events/lttng-module/rpm.h b/include/instrumentation/events/lttng-module/rpm.h deleted file mode 100644 index 1e425f8e..00000000 --- a/include/instrumentation/events/lttng-module/rpm.h +++ /dev/null @@ -1,73 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM rpm - -#if !defined(LTTNG_TRACE_RUNTIME_POWER_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_RUNTIME_POWER_H - -#include -#include - -#ifndef _TRACE_RPM_DEF_ -#define _TRACE_RPM_DEF_ -struct device; -#endif - -/* - * The rpm_internal events are used for tracing some important - * runtime pm internal functions. - */ -LTTNG_TRACEPOINT_EVENT_CLASS(rpm_internal, - - TP_PROTO(struct device *dev, int flags), - - TP_ARGS(dev, flags), - - TP_FIELDS( - ctf_string(name, dev_name(dev)) - ctf_integer(int, flags, flags) - ctf_integer(int, usage_count, atomic_read(&dev->power.usage_count)) - ctf_integer(int, disable_depth, dev->power.disable_depth) - ctf_integer(int, runtime_auto, dev->power.runtime_auto) - ctf_integer(int, request_pending, dev->power.request_pending) - ctf_integer(int, irq_safe, dev->power.irq_safe) - ctf_integer(int, child_count, atomic_read(&dev->power.child_count)) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpm_internal, rpm_suspend, - - TP_PROTO(struct device *dev, int flags), - - TP_ARGS(dev, flags) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpm_internal, rpm_resume, - - TP_PROTO(struct device *dev, int flags), - - TP_ARGS(dev, flags) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(rpm_internal, rpm_idle, - - TP_PROTO(struct device *dev, int flags), - - TP_ARGS(dev, flags) -) - -LTTNG_TRACEPOINT_EVENT(rpm_return_int, - TP_PROTO(struct device *dev, unsigned long ip, int ret), - TP_ARGS(dev, ip, ret), - - TP_FIELDS( - ctf_string(name, dev_name(dev)) - ctf_integer_hex(unsigned long, ip, ip) - ctf_integer(int, ret, ret) - ) -) - -#endif /* LTTNG_TRACE_RUNTIME_POWER_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/sched.h b/include/instrumentation/events/lttng-module/sched.h deleted file mode 100644 index 10da76c9..00000000 --- a/include/instrumentation/events/lttng-module/sched.h +++ /dev/null @@ -1,630 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM sched - -#if !defined(LTTNG_TRACE_SCHED_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_SCHED_H - -#include -#include -#include -#include -#include -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) -#include -#endif -#include - -#define LTTNG_MAX_PID_NS_LEVEL 32 - -#ifndef _TRACE_SCHED_DEF_ -#define _TRACE_SCHED_DEF_ - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) - -static inline long __trace_sched_switch_state(bool preempt, struct task_struct *p) -{ - unsigned int state; - -#ifdef CONFIG_SCHED_DEBUG - BUG_ON(p != current); -#endif /* CONFIG_SCHED_DEBUG */ - - /* - * Preemption ignores task state, therefore preempted tasks are always - * RUNNING (we will not have dequeued if state != RUNNING). - */ - if (preempt) - return TASK_REPORT_MAX; - - /* - * task_state_index() uses fls() and returns a value from 0-8 range. - * Decrement it by 1 (except TASK_RUNNING state i.e 0) before using - * it for left shift operation to get the correct task->state - * mapping. - */ - state = task_state_index(p); - - return state ? (1 << (state - 1)) : state; -} - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) - -static inline long __trace_sched_switch_state(bool preempt, struct task_struct *p) -{ - unsigned int state; - -#ifdef CONFIG_SCHED_DEBUG - BUG_ON(p != current); -#endif /* CONFIG_SCHED_DEBUG */ - - /* - * Preemption ignores task state, therefore preempted tasks are always - * RUNNING (we will not have dequeued if state != RUNNING). - */ - if (preempt) - return TASK_REPORT_MAX; - - /* - * __get_task_state() uses fls() and returns a value from 0-8 range. - * Decrement it by 1 (except TASK_RUNNING state i.e 0) before using - * it for left shift operation to get the correct task->state - * mapping. - */ - state = __get_task_state(p); - - return state ? (1 << (state - 1)) : state; -} - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)) - -static inline long __trace_sched_switch_state(bool preempt, struct task_struct *p) -{ -#ifdef CONFIG_SCHED_DEBUG - BUG_ON(p != current); -#endif /* CONFIG_SCHED_DEBUG */ - /* - * Preemption ignores task state, therefore preempted tasks are always RUNNING - * (we will not have dequeued if state != RUNNING). - */ - return preempt ? TASK_RUNNING | TASK_STATE_MAX : p->state; -} - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)) - -static inline long __trace_sched_switch_state(struct task_struct *p) -{ - long state = p->state; - -#ifdef CONFIG_PREEMPT -#ifdef CONFIG_SCHED_DEBUG - BUG_ON(p != current); -#endif /* CONFIG_SCHED_DEBUG */ - /* - * For all intents and purposes a preempted task is a running task. - */ - if (preempt_count() & PREEMPT_ACTIVE) - state = TASK_RUNNING | TASK_STATE_MAX; -#endif /* CONFIG_PREEMPT */ - - return state; -} - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) - -static inline long __trace_sched_switch_state(struct task_struct *p) -{ - long state = p->state; - -#ifdef CONFIG_PREEMPT - /* - * For all intents and purposes a preempted task is a running task. - */ - if (task_preempt_count(p) & PREEMPT_ACTIVE) - state = TASK_RUNNING | TASK_STATE_MAX; -#endif - - return state; -} - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) - -static inline long __trace_sched_switch_state(struct task_struct *p) -{ - long state = p->state; - -#ifdef CONFIG_PREEMPT - /* - * For all intents and purposes a preempted task is a running task. - */ - if (task_thread_info(p)->preempt_count & PREEMPT_ACTIVE) - state = TASK_RUNNING | TASK_STATE_MAX; -#endif - - return state; -} - -#else - -static inline long __trace_sched_switch_state(struct task_struct *p) -{ - long state = p->state; - -#ifdef CONFIG_PREEMPT - /* - * For all intents and purposes a preempted task is a running task. - */ - if (task_thread_info(p)->preempt_count & PREEMPT_ACTIVE) - state = TASK_RUNNING; -#endif - - return state; -} - -#endif - -#endif /* _TRACE_SCHED_DEF_ */ - -/* - * Enumeration of the task state bitmask. - * Only bit flags are enumerated here, not composition of states. - */ -LTTNG_TRACEPOINT_ENUM(task_state, - TP_ENUM_VALUES( - ctf_enum_value("TASK_RUNNING", TASK_RUNNING) - ctf_enum_value("TASK_INTERRUPTIBLE", TASK_INTERRUPTIBLE) - ctf_enum_value("TASK_UNINTERRUPTIBLE", TASK_UNINTERRUPTIBLE) - ctf_enum_value("TASK_STOPPED", __TASK_STOPPED) - ctf_enum_value("TASK_TRACED", __TASK_TRACED) - ctf_enum_value("EXIT_DEAD", EXIT_DEAD) - ctf_enum_value("EXIT_ZOMBIE", EXIT_ZOMBIE) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) - ctf_enum_value("TASK_PARKED", TASK_PARKED) -#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) */ - - ctf_enum_value("TASK_DEAD", TASK_DEAD) - ctf_enum_value("TASK_WAKEKILL", TASK_WAKEKILL) - ctf_enum_value("TASK_WAKING", TASK_WAKING) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) - ctf_enum_value("TASK_NOLOAD", TASK_NOLOAD) -#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) - ctf_enum_value("TASK_NEW", TASK_NEW) -#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) */ - - ctf_enum_value("TASK_STATE_MAX", TASK_STATE_MAX) - ) -) - -/* - * Tracepoint for calling kthread_stop, performed to end a kthread: - */ -LTTNG_TRACEPOINT_EVENT(sched_kthread_stop, - - TP_PROTO(struct task_struct *t), - - TP_ARGS(t), - - TP_FIELDS( - ctf_array_text(char, comm, t->comm, TASK_COMM_LEN) - ctf_integer(pid_t, tid, t->pid) - ) -) - -/* - * Tracepoint for the return value of the kthread stopping: - */ -LTTNG_TRACEPOINT_EVENT(sched_kthread_stop_ret, - - TP_PROTO(int ret), - - TP_ARGS(ret), - - TP_FIELDS( - ctf_integer(int, ret, ret) - ) -) - -/* - * Tracepoint for waking up a task: - */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0) || \ - LTTNG_RT_KERNEL_RANGE(4,1,10,11, 4,2,0,0) || \ - LTTNG_RT_KERNEL_RANGE(3,18,27,26, 3,19,0,0) || \ - LTTNG_RT_KERNEL_RANGE(3,14,61,63, 3,15,0,0) || \ - LTTNG_RT_KERNEL_RANGE(3,12,54,73, 3,13,0,0) || \ - LTTNG_RT_KERNEL_RANGE(3,10,97,106, 3,11,0,0) || \ - LTTNG_RT_KERNEL_RANGE(3,4,110,139, 3,5,0,0) || \ - LTTNG_RT_KERNEL_RANGE(3,2,77,111, 3,3,0,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(sched_wakeup_template, - - TP_PROTO(struct task_struct *p), - - TP_ARGS(p), - - TP_FIELDS( - ctf_array_text(char, comm, p->comm, TASK_COMM_LEN) - ctf_integer(pid_t, tid, p->pid) - ctf_integer(int, prio, p->prio - MAX_RT_PRIO) - ctf_integer(int, target_cpu, task_cpu(p)) - ) -) -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ -LTTNG_TRACEPOINT_EVENT_CLASS(sched_wakeup_template, - - TP_PROTO(struct task_struct *p, int success), - - TP_ARGS(p, success), - - TP_FIELDS( - ctf_array_text(char, comm, p->comm, TASK_COMM_LEN) - ctf_integer(pid_t, tid, p->pid) - ctf_integer(int, prio, p->prio - MAX_RT_PRIO) - ctf_integer(int, success, success) - ctf_integer(int, target_cpu, task_cpu(p)) - ) -) -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0) || \ - LTTNG_RT_KERNEL_RANGE(4,1,10,11, 4,2,0,0) || \ - LTTNG_RT_KERNEL_RANGE(3,18,27,26, 3,19,0,0) || \ - LTTNG_RT_KERNEL_RANGE(3,14,61,63, 3,15,0,0) || \ - LTTNG_RT_KERNEL_RANGE(3,12,54,73, 3,13,0,0) || \ - LTTNG_RT_KERNEL_RANGE(3,10,97,106, 3,11,0,0) || \ - LTTNG_RT_KERNEL_RANGE(3,4,110,139, 3,5,0,0) || \ - LTTNG_RT_KERNEL_RANGE(3,2,77,111, 3,3,0,0)) - -/* - * Tracepoint called when waking a task; this tracepoint is guaranteed to be - * called from the waking context. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_wakeup_template, sched_waking, - TP_PROTO(struct task_struct *p), - TP_ARGS(p)) - -/* - * Tracepoint called when the task is actually woken; p->state == TASK_RUNNNG. - * It it not always called from the waking context. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_wakeup_template, sched_wakeup, - TP_PROTO(struct task_struct *p), - TP_ARGS(p)) - -/* - * Tracepoint for waking up a new task: - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_wakeup_template, sched_wakeup_new, - TP_PROTO(struct task_struct *p), - TP_ARGS(p)) - -#else - -LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_wakeup_template, sched_wakeup, - TP_PROTO(struct task_struct *p, int success), - TP_ARGS(p, success)) - -/* - * Tracepoint for waking up a new task: - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_wakeup_template, sched_wakeup_new, - TP_PROTO(struct task_struct *p, int success), - TP_ARGS(p, success)) - -#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ - -/* - * Tracepoint for task switches, performed by the scheduler: - */ -LTTNG_TRACEPOINT_EVENT(sched_switch, - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)) - TP_PROTO(bool preempt, - struct task_struct *prev, - struct task_struct *next), - - TP_ARGS(preempt, prev, next), -#else - TP_PROTO(struct task_struct *prev, - struct task_struct *next), - - TP_ARGS(prev, next), -#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)) */ - - TP_FIELDS( - ctf_array_text(char, prev_comm, prev->comm, TASK_COMM_LEN) - ctf_integer(pid_t, prev_tid, prev->pid) - ctf_integer(int, prev_prio, prev->prio - MAX_RT_PRIO) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)) - ctf_enum(task_state, long, prev_state, __trace_sched_switch_state(preempt, prev)) -#else - ctf_enum(task_state, long, prev_state, __trace_sched_switch_state(prev)) -#endif - ctf_array_text(char, next_comm, next->comm, TASK_COMM_LEN) - ctf_integer(pid_t, next_tid, next->pid) - ctf_integer(int, next_prio, next->prio - MAX_RT_PRIO) - ) -) - -/* - * Tracepoint for a task being migrated: - */ -LTTNG_TRACEPOINT_EVENT(sched_migrate_task, - - TP_PROTO(struct task_struct *p, int dest_cpu), - - TP_ARGS(p, dest_cpu), - - TP_FIELDS( - ctf_array_text(char, comm, p->comm, TASK_COMM_LEN) - ctf_integer(pid_t, tid, p->pid) - ctf_integer(int, prio, p->prio - MAX_RT_PRIO) - ctf_integer(int, orig_cpu, task_cpu(p)) - ctf_integer(int, dest_cpu, dest_cpu) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(sched_process_template, - - TP_PROTO(struct task_struct *p), - - TP_ARGS(p), - - TP_FIELDS( - ctf_array_text(char, comm, p->comm, TASK_COMM_LEN) - ctf_integer(pid_t, tid, p->pid) - ctf_integer(int, prio, p->prio - MAX_RT_PRIO) - ) -) - -/* - * Tracepoint for freeing a task: - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_process_template, sched_process_free, - TP_PROTO(struct task_struct *p), - TP_ARGS(p)) - - -/* - * Tracepoint for a task exiting: - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_process_template, sched_process_exit, - TP_PROTO(struct task_struct *p), - TP_ARGS(p)) - -/* - * Tracepoint for waiting on task to unschedule: - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_process_template, sched_wait_task, - TP_PROTO(struct task_struct *p), - TP_ARGS(p)) - -/* - * Tracepoint for a waiting task: - */ -LTTNG_TRACEPOINT_EVENT(sched_process_wait, - - TP_PROTO(struct pid *pid), - - TP_ARGS(pid), - - TP_FIELDS( - ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) - ctf_integer(pid_t, tid, pid_nr(pid)) - ctf_integer(int, prio, current->prio - MAX_RT_PRIO) - ) -) - -/* - * Tracepoint for do_fork. - * Saving both TID and PID information, especially for the child, allows - * trace analyzers to distinguish between creation of a new process and - * creation of a new thread. Newly created processes will have child_tid - * == child_pid, while creation of a thread yields to child_tid != - * child_pid. - */ -LTTNG_TRACEPOINT_EVENT_CODE(sched_process_fork, - - TP_PROTO(struct task_struct *parent, struct task_struct *child), - - TP_ARGS(parent, child), - - TP_locvar( - pid_t vtids[LTTNG_MAX_PID_NS_LEVEL]; - unsigned int ns_level; - ), - - TP_code_pre( - if (child) { - struct pid *child_pid; - unsigned int i; - - child_pid = task_pid(child); - tp_locvar->ns_level = - min_t(unsigned int, child_pid->level + 1, - LTTNG_MAX_PID_NS_LEVEL); - for (i = 0; i < tp_locvar->ns_level; i++) - tp_locvar->vtids[i] = child_pid->numbers[i].nr; - } - ), - - TP_FIELDS( - ctf_array_text(char, parent_comm, parent->comm, TASK_COMM_LEN) - ctf_integer(pid_t, parent_tid, parent->pid) - ctf_integer(pid_t, parent_pid, parent->tgid) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) - ctf_integer(unsigned int, parent_ns_inum, - ({ - unsigned int parent_ns_inum = 0; - - if (parent) { - struct pid_namespace *pid_ns; - - pid_ns = task_active_pid_ns(parent); - if (pid_ns) - parent_ns_inum = - pid_ns->lttng_ns_inum; - } - parent_ns_inum; - })) -#endif - ctf_array_text(char, child_comm, child->comm, TASK_COMM_LEN) - ctf_integer(pid_t, child_tid, child->pid) - ctf_sequence(pid_t, vtids, tp_locvar->vtids, u8, tp_locvar->ns_level) - ctf_integer(pid_t, child_pid, child->tgid) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) - ctf_integer(unsigned int, child_ns_inum, - ({ - unsigned int child_ns_inum = 0; - - if (child) { - struct pid_namespace *pid_ns; - - pid_ns = task_active_pid_ns(child); - if (pid_ns) - child_ns_inum = - pid_ns->lttng_ns_inum; - } - child_ns_inum; - })) -#endif - ), - - TP_code_post() -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) -/* - * Tracepoint for exec: - */ -LTTNG_TRACEPOINT_EVENT(sched_process_exec, - - TP_PROTO(struct task_struct *p, pid_t old_pid, - struct linux_binprm *bprm), - - TP_ARGS(p, old_pid, bprm), - - TP_FIELDS( - ctf_string(filename, bprm->filename) - ctf_integer(pid_t, tid, p->pid) - ctf_integer(pid_t, old_tid, old_pid) - ) -) -#endif - -/* - * XXX the below sched_stat tracepoints only apply to SCHED_OTHER/BATCH/IDLE - * adding sched_stat support to SCHED_FIFO/RR would be welcome. - */ -LTTNG_TRACEPOINT_EVENT_CLASS(sched_stat_template, - - TP_PROTO(struct task_struct *tsk, u64 delay), - - TP_ARGS(tsk, delay), - - TP_FIELDS( - ctf_array_text(char, comm, tsk->comm, TASK_COMM_LEN) - ctf_integer(pid_t, tid, tsk->pid) - ctf_integer(u64, delay, delay) - ) -) - - -/* - * Tracepoint for accounting wait time (time the task is runnable - * but not actually running due to scheduler contention). - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_stat_template, sched_stat_wait, - TP_PROTO(struct task_struct *tsk, u64 delay), - TP_ARGS(tsk, delay)) - -/* - * Tracepoint for accounting sleep time (time the task is not runnable, - * including iowait, see below). - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_stat_template, sched_stat_sleep, - TP_PROTO(struct task_struct *tsk, u64 delay), - TP_ARGS(tsk, delay)) - -/* - * Tracepoint for accounting iowait time (time the task is not runnable - * due to waiting on IO to complete). - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_stat_template, sched_stat_iowait, - TP_PROTO(struct task_struct *tsk, u64 delay), - TP_ARGS(tsk, delay)) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) -/* - * Tracepoint for accounting blocked time (time the task is in uninterruptible). - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_stat_template, sched_stat_blocked, - TP_PROTO(struct task_struct *tsk, u64 delay), - TP_ARGS(tsk, delay)) -#endif - -/* - * Tracepoint for accounting runtime (time the task is executing - * on a CPU). - */ -LTTNG_TRACEPOINT_EVENT(sched_stat_runtime, - - TP_PROTO(struct task_struct *tsk, u64 runtime, u64 vruntime), - - TP_ARGS(tsk, runtime, vruntime), - - TP_FIELDS( - ctf_array_text(char, comm, tsk->comm, TASK_COMM_LEN) - ctf_integer(pid_t, tid, tsk->pid) - ctf_integer(u64, runtime, runtime) - ctf_integer(u64, vruntime, vruntime) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0) || \ - LTTNG_RT_KERNEL_RANGE(4,9,27,18, 4,10,0,0) || \ - LTTNG_RT_KERNEL_RANGE(4,11,5,1, 4,12,0,0)) -/* - * Tracepoint for showing priority inheritance modifying a tasks - * priority. - */ -LTTNG_TRACEPOINT_EVENT(sched_pi_setprio, - - TP_PROTO(struct task_struct *tsk, struct task_struct *pi_task), - - TP_ARGS(tsk, pi_task), - - TP_FIELDS( - ctf_array_text(char, comm, tsk->comm, TASK_COMM_LEN) - ctf_integer(pid_t, tid, tsk->pid) - ctf_integer(int, oldprio, tsk->prio - MAX_RT_PRIO) - ctf_integer(int, newprio, pi_task ? pi_task->prio - MAX_RT_PRIO : tsk->prio - MAX_RT_PRIO) - ) -) -#else -/* - * Tracepoint for showing priority inheritance modifying a tasks - * priority. - */ -LTTNG_TRACEPOINT_EVENT(sched_pi_setprio, - - TP_PROTO(struct task_struct *tsk, int newprio), - - TP_ARGS(tsk, newprio), - - TP_FIELDS( - ctf_array_text(char, comm, tsk->comm, TASK_COMM_LEN) - ctf_integer(pid_t, tid, tsk->pid) - ctf_integer(int, oldprio, tsk->prio - MAX_RT_PRIO) - ctf_integer(int, newprio, newprio - MAX_RT_PRIO) - ) -) -#endif - -#endif /* LTTNG_TRACE_SCHED_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/scsi.h b/include/instrumentation/events/lttng-module/scsi.h deleted file mode 100644 index 21637bc1..00000000 --- a/include/instrumentation/events/lttng-module/scsi.h +++ /dev/null @@ -1,490 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM scsi - -#if !defined(LTTNG_TRACE_SCSI_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_SCSI_H - -#include -#include -#include -#include -#include - -#ifndef _TRACE_SCSI_DEF -#define _TRACE_SCSI_DEF - -#define scsi_opcode_name(opcode) { opcode, #opcode } - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) \ - || LTTNG_SLE_KERNEL_RANGE(4,4,9,36,0,0, 4,5,0,0,0,0)) - -#define show_opcode_name(val) \ - __print_symbolic(val, \ - scsi_opcode_name(TEST_UNIT_READY), \ - scsi_opcode_name(REZERO_UNIT), \ - scsi_opcode_name(REQUEST_SENSE), \ - scsi_opcode_name(FORMAT_UNIT), \ - scsi_opcode_name(READ_BLOCK_LIMITS), \ - scsi_opcode_name(REASSIGN_BLOCKS), \ - scsi_opcode_name(INITIALIZE_ELEMENT_STATUS), \ - scsi_opcode_name(READ_6), \ - scsi_opcode_name(WRITE_6), \ - scsi_opcode_name(SEEK_6), \ - scsi_opcode_name(READ_REVERSE), \ - scsi_opcode_name(WRITE_FILEMARKS), \ - scsi_opcode_name(SPACE), \ - scsi_opcode_name(INQUIRY), \ - scsi_opcode_name(RECOVER_BUFFERED_DATA), \ - scsi_opcode_name(MODE_SELECT), \ - scsi_opcode_name(RESERVE), \ - scsi_opcode_name(RELEASE), \ - scsi_opcode_name(COPY), \ - scsi_opcode_name(ERASE), \ - scsi_opcode_name(MODE_SENSE), \ - scsi_opcode_name(START_STOP), \ - scsi_opcode_name(RECEIVE_DIAGNOSTIC), \ - scsi_opcode_name(SEND_DIAGNOSTIC), \ - scsi_opcode_name(ALLOW_MEDIUM_REMOVAL), \ - scsi_opcode_name(SET_WINDOW), \ - scsi_opcode_name(READ_CAPACITY), \ - scsi_opcode_name(READ_10), \ - scsi_opcode_name(WRITE_10), \ - scsi_opcode_name(SEEK_10), \ - scsi_opcode_name(POSITION_TO_ELEMENT), \ - scsi_opcode_name(WRITE_VERIFY), \ - scsi_opcode_name(VERIFY), \ - scsi_opcode_name(SEARCH_HIGH), \ - scsi_opcode_name(SEARCH_EQUAL), \ - scsi_opcode_name(SEARCH_LOW), \ - scsi_opcode_name(SET_LIMITS), \ - scsi_opcode_name(PRE_FETCH), \ - scsi_opcode_name(READ_POSITION), \ - scsi_opcode_name(SYNCHRONIZE_CACHE), \ - scsi_opcode_name(LOCK_UNLOCK_CACHE), \ - scsi_opcode_name(READ_DEFECT_DATA), \ - scsi_opcode_name(MEDIUM_SCAN), \ - scsi_opcode_name(COMPARE), \ - scsi_opcode_name(COPY_VERIFY), \ - scsi_opcode_name(WRITE_BUFFER), \ - scsi_opcode_name(READ_BUFFER), \ - scsi_opcode_name(UPDATE_BLOCK), \ - scsi_opcode_name(READ_LONG), \ - scsi_opcode_name(WRITE_LONG), \ - scsi_opcode_name(CHANGE_DEFINITION), \ - scsi_opcode_name(WRITE_SAME), \ - scsi_opcode_name(UNMAP), \ - scsi_opcode_name(READ_TOC), \ - scsi_opcode_name(LOG_SELECT), \ - scsi_opcode_name(LOG_SENSE), \ - scsi_opcode_name(XDWRITEREAD_10), \ - scsi_opcode_name(MODE_SELECT_10), \ - scsi_opcode_name(RESERVE_10), \ - scsi_opcode_name(RELEASE_10), \ - scsi_opcode_name(MODE_SENSE_10), \ - scsi_opcode_name(PERSISTENT_RESERVE_IN), \ - scsi_opcode_name(PERSISTENT_RESERVE_OUT), \ - scsi_opcode_name(VARIABLE_LENGTH_CMD), \ - scsi_opcode_name(REPORT_LUNS), \ - scsi_opcode_name(MAINTENANCE_IN), \ - scsi_opcode_name(MAINTENANCE_OUT), \ - scsi_opcode_name(MOVE_MEDIUM), \ - scsi_opcode_name(EXCHANGE_MEDIUM), \ - scsi_opcode_name(READ_12), \ - scsi_opcode_name(WRITE_12), \ - scsi_opcode_name(WRITE_VERIFY_12), \ - scsi_opcode_name(SEARCH_HIGH_12), \ - scsi_opcode_name(SEARCH_EQUAL_12), \ - scsi_opcode_name(SEARCH_LOW_12), \ - scsi_opcode_name(READ_ELEMENT_STATUS), \ - scsi_opcode_name(SEND_VOLUME_TAG), \ - scsi_opcode_name(WRITE_LONG_2), \ - scsi_opcode_name(READ_16), \ - scsi_opcode_name(WRITE_16), \ - scsi_opcode_name(VERIFY_16), \ - scsi_opcode_name(WRITE_SAME_16), \ - scsi_opcode_name(ZBC_OUT), \ - scsi_opcode_name(ZBC_IN), \ - scsi_opcode_name(SERVICE_ACTION_IN_16), \ - scsi_opcode_name(READ_32), \ - scsi_opcode_name(WRITE_32), \ - scsi_opcode_name(WRITE_SAME_32), \ - scsi_opcode_name(ATA_16), \ - scsi_opcode_name(ATA_12)) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) \ - || LTTNG_RHEL_KERNEL_RANGE(3,10,0,327,0,0, 3,11,0,0,0,0)) - -#define show_opcode_name(val) \ - __print_symbolic(val, \ - scsi_opcode_name(TEST_UNIT_READY), \ - scsi_opcode_name(REZERO_UNIT), \ - scsi_opcode_name(REQUEST_SENSE), \ - scsi_opcode_name(FORMAT_UNIT), \ - scsi_opcode_name(READ_BLOCK_LIMITS), \ - scsi_opcode_name(REASSIGN_BLOCKS), \ - scsi_opcode_name(INITIALIZE_ELEMENT_STATUS), \ - scsi_opcode_name(READ_6), \ - scsi_opcode_name(WRITE_6), \ - scsi_opcode_name(SEEK_6), \ - scsi_opcode_name(READ_REVERSE), \ - scsi_opcode_name(WRITE_FILEMARKS), \ - scsi_opcode_name(SPACE), \ - scsi_opcode_name(INQUIRY), \ - scsi_opcode_name(RECOVER_BUFFERED_DATA), \ - scsi_opcode_name(MODE_SELECT), \ - scsi_opcode_name(RESERVE), \ - scsi_opcode_name(RELEASE), \ - scsi_opcode_name(COPY), \ - scsi_opcode_name(ERASE), \ - scsi_opcode_name(MODE_SENSE), \ - scsi_opcode_name(START_STOP), \ - scsi_opcode_name(RECEIVE_DIAGNOSTIC), \ - scsi_opcode_name(SEND_DIAGNOSTIC), \ - scsi_opcode_name(ALLOW_MEDIUM_REMOVAL), \ - scsi_opcode_name(SET_WINDOW), \ - scsi_opcode_name(READ_CAPACITY), \ - scsi_opcode_name(READ_10), \ - scsi_opcode_name(WRITE_10), \ - scsi_opcode_name(SEEK_10), \ - scsi_opcode_name(POSITION_TO_ELEMENT), \ - scsi_opcode_name(WRITE_VERIFY), \ - scsi_opcode_name(VERIFY), \ - scsi_opcode_name(SEARCH_HIGH), \ - scsi_opcode_name(SEARCH_EQUAL), \ - scsi_opcode_name(SEARCH_LOW), \ - scsi_opcode_name(SET_LIMITS), \ - scsi_opcode_name(PRE_FETCH), \ - scsi_opcode_name(READ_POSITION), \ - scsi_opcode_name(SYNCHRONIZE_CACHE), \ - scsi_opcode_name(LOCK_UNLOCK_CACHE), \ - scsi_opcode_name(READ_DEFECT_DATA), \ - scsi_opcode_name(MEDIUM_SCAN), \ - scsi_opcode_name(COMPARE), \ - scsi_opcode_name(COPY_VERIFY), \ - scsi_opcode_name(WRITE_BUFFER), \ - scsi_opcode_name(READ_BUFFER), \ - scsi_opcode_name(UPDATE_BLOCK), \ - scsi_opcode_name(READ_LONG), \ - scsi_opcode_name(WRITE_LONG), \ - scsi_opcode_name(CHANGE_DEFINITION), \ - scsi_opcode_name(WRITE_SAME), \ - scsi_opcode_name(UNMAP), \ - scsi_opcode_name(READ_TOC), \ - scsi_opcode_name(LOG_SELECT), \ - scsi_opcode_name(LOG_SENSE), \ - scsi_opcode_name(XDWRITEREAD_10), \ - scsi_opcode_name(MODE_SELECT_10), \ - scsi_opcode_name(RESERVE_10), \ - scsi_opcode_name(RELEASE_10), \ - scsi_opcode_name(MODE_SENSE_10), \ - scsi_opcode_name(PERSISTENT_RESERVE_IN), \ - scsi_opcode_name(PERSISTENT_RESERVE_OUT), \ - scsi_opcode_name(VARIABLE_LENGTH_CMD), \ - scsi_opcode_name(REPORT_LUNS), \ - scsi_opcode_name(MAINTENANCE_IN), \ - scsi_opcode_name(MAINTENANCE_OUT), \ - scsi_opcode_name(MOVE_MEDIUM), \ - scsi_opcode_name(EXCHANGE_MEDIUM), \ - scsi_opcode_name(READ_12), \ - scsi_opcode_name(WRITE_12), \ - scsi_opcode_name(WRITE_VERIFY_12), \ - scsi_opcode_name(SEARCH_HIGH_12), \ - scsi_opcode_name(SEARCH_EQUAL_12), \ - scsi_opcode_name(SEARCH_LOW_12), \ - scsi_opcode_name(READ_ELEMENT_STATUS), \ - scsi_opcode_name(SEND_VOLUME_TAG), \ - scsi_opcode_name(WRITE_LONG_2), \ - scsi_opcode_name(READ_16), \ - scsi_opcode_name(WRITE_16), \ - scsi_opcode_name(VERIFY_16), \ - scsi_opcode_name(WRITE_SAME_16), \ - scsi_opcode_name(SERVICE_ACTION_IN_16), \ - scsi_opcode_name(SAI_READ_CAPACITY_16), \ - scsi_opcode_name(SAI_GET_LBA_STATUS), \ - scsi_opcode_name(MI_REPORT_TARGET_PGS), \ - scsi_opcode_name(MO_SET_TARGET_PGS), \ - scsi_opcode_name(READ_32), \ - scsi_opcode_name(WRITE_32), \ - scsi_opcode_name(WRITE_SAME_32), \ - scsi_opcode_name(ATA_16), \ - scsi_opcode_name(ATA_12)) - -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)) */ - -#define show_opcode_name(val) \ - __print_symbolic(val, \ - scsi_opcode_name(TEST_UNIT_READY), \ - scsi_opcode_name(REZERO_UNIT), \ - scsi_opcode_name(REQUEST_SENSE), \ - scsi_opcode_name(FORMAT_UNIT), \ - scsi_opcode_name(READ_BLOCK_LIMITS), \ - scsi_opcode_name(REASSIGN_BLOCKS), \ - scsi_opcode_name(INITIALIZE_ELEMENT_STATUS), \ - scsi_opcode_name(READ_6), \ - scsi_opcode_name(WRITE_6), \ - scsi_opcode_name(SEEK_6), \ - scsi_opcode_name(READ_REVERSE), \ - scsi_opcode_name(WRITE_FILEMARKS), \ - scsi_opcode_name(SPACE), \ - scsi_opcode_name(INQUIRY), \ - scsi_opcode_name(RECOVER_BUFFERED_DATA), \ - scsi_opcode_name(MODE_SELECT), \ - scsi_opcode_name(RESERVE), \ - scsi_opcode_name(RELEASE), \ - scsi_opcode_name(COPY), \ - scsi_opcode_name(ERASE), \ - scsi_opcode_name(MODE_SENSE), \ - scsi_opcode_name(START_STOP), \ - scsi_opcode_name(RECEIVE_DIAGNOSTIC), \ - scsi_opcode_name(SEND_DIAGNOSTIC), \ - scsi_opcode_name(ALLOW_MEDIUM_REMOVAL), \ - scsi_opcode_name(SET_WINDOW), \ - scsi_opcode_name(READ_CAPACITY), \ - scsi_opcode_name(READ_10), \ - scsi_opcode_name(WRITE_10), \ - scsi_opcode_name(SEEK_10), \ - scsi_opcode_name(POSITION_TO_ELEMENT), \ - scsi_opcode_name(WRITE_VERIFY), \ - scsi_opcode_name(VERIFY), \ - scsi_opcode_name(SEARCH_HIGH), \ - scsi_opcode_name(SEARCH_EQUAL), \ - scsi_opcode_name(SEARCH_LOW), \ - scsi_opcode_name(SET_LIMITS), \ - scsi_opcode_name(PRE_FETCH), \ - scsi_opcode_name(READ_POSITION), \ - scsi_opcode_name(SYNCHRONIZE_CACHE), \ - scsi_opcode_name(LOCK_UNLOCK_CACHE), \ - scsi_opcode_name(READ_DEFECT_DATA), \ - scsi_opcode_name(MEDIUM_SCAN), \ - scsi_opcode_name(COMPARE), \ - scsi_opcode_name(COPY_VERIFY), \ - scsi_opcode_name(WRITE_BUFFER), \ - scsi_opcode_name(READ_BUFFER), \ - scsi_opcode_name(UPDATE_BLOCK), \ - scsi_opcode_name(READ_LONG), \ - scsi_opcode_name(WRITE_LONG), \ - scsi_opcode_name(CHANGE_DEFINITION), \ - scsi_opcode_name(WRITE_SAME), \ - scsi_opcode_name(UNMAP), \ - scsi_opcode_name(READ_TOC), \ - scsi_opcode_name(LOG_SELECT), \ - scsi_opcode_name(LOG_SENSE), \ - scsi_opcode_name(XDWRITEREAD_10), \ - scsi_opcode_name(MODE_SELECT_10), \ - scsi_opcode_name(RESERVE_10), \ - scsi_opcode_name(RELEASE_10), \ - scsi_opcode_name(MODE_SENSE_10), \ - scsi_opcode_name(PERSISTENT_RESERVE_IN), \ - scsi_opcode_name(PERSISTENT_RESERVE_OUT), \ - scsi_opcode_name(VARIABLE_LENGTH_CMD), \ - scsi_opcode_name(REPORT_LUNS), \ - scsi_opcode_name(MAINTENANCE_IN), \ - scsi_opcode_name(MAINTENANCE_OUT), \ - scsi_opcode_name(MOVE_MEDIUM), \ - scsi_opcode_name(EXCHANGE_MEDIUM), \ - scsi_opcode_name(READ_12), \ - scsi_opcode_name(WRITE_12), \ - scsi_opcode_name(WRITE_VERIFY_12), \ - scsi_opcode_name(SEARCH_HIGH_12), \ - scsi_opcode_name(SEARCH_EQUAL_12), \ - scsi_opcode_name(SEARCH_LOW_12), \ - scsi_opcode_name(READ_ELEMENT_STATUS), \ - scsi_opcode_name(SEND_VOLUME_TAG), \ - scsi_opcode_name(WRITE_LONG_2), \ - scsi_opcode_name(READ_16), \ - scsi_opcode_name(WRITE_16), \ - scsi_opcode_name(VERIFY_16), \ - scsi_opcode_name(WRITE_SAME_16), \ - scsi_opcode_name(SERVICE_ACTION_IN), \ - scsi_opcode_name(SAI_READ_CAPACITY_16), \ - scsi_opcode_name(SAI_GET_LBA_STATUS), \ - scsi_opcode_name(MI_REPORT_TARGET_PGS), \ - scsi_opcode_name(MO_SET_TARGET_PGS), \ - scsi_opcode_name(READ_32), \ - scsi_opcode_name(WRITE_32), \ - scsi_opcode_name(WRITE_SAME_32), \ - scsi_opcode_name(ATA_16), \ - scsi_opcode_name(ATA_12)) - -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)) */ - -#define scsi_hostbyte_name(result) { result, #result } -#define show_hostbyte_name(val) \ - __print_symbolic(val, \ - scsi_hostbyte_name(DID_OK), \ - scsi_hostbyte_name(DID_NO_CONNECT), \ - scsi_hostbyte_name(DID_BUS_BUSY), \ - scsi_hostbyte_name(DID_TIME_OUT), \ - scsi_hostbyte_name(DID_BAD_TARGET), \ - scsi_hostbyte_name(DID_ABORT), \ - scsi_hostbyte_name(DID_PARITY), \ - scsi_hostbyte_name(DID_ERROR), \ - scsi_hostbyte_name(DID_RESET), \ - scsi_hostbyte_name(DID_BAD_INTR), \ - scsi_hostbyte_name(DID_PASSTHROUGH), \ - scsi_hostbyte_name(DID_SOFT_ERROR), \ - scsi_hostbyte_name(DID_IMM_RETRY), \ - scsi_hostbyte_name(DID_REQUEUE), \ - scsi_hostbyte_name(DID_TRANSPORT_DISRUPTED), \ - scsi_hostbyte_name(DID_TRANSPORT_FAILFAST)) - -#define scsi_driverbyte_name(result) { result, #result } -#define show_driverbyte_name(val) \ - __print_symbolic(val, \ - scsi_driverbyte_name(DRIVER_OK), \ - scsi_driverbyte_name(DRIVER_BUSY), \ - scsi_driverbyte_name(DRIVER_SOFT), \ - scsi_driverbyte_name(DRIVER_MEDIA), \ - scsi_driverbyte_name(DRIVER_ERROR), \ - scsi_driverbyte_name(DRIVER_INVALID), \ - scsi_driverbyte_name(DRIVER_TIMEOUT), \ - scsi_driverbyte_name(DRIVER_HARD), \ - scsi_driverbyte_name(DRIVER_SENSE)) - -#define scsi_msgbyte_name(result) { result, #result } -#define show_msgbyte_name(val) \ - __print_symbolic(val, \ - scsi_msgbyte_name(COMMAND_COMPLETE), \ - scsi_msgbyte_name(EXTENDED_MESSAGE), \ - scsi_msgbyte_name(SAVE_POINTERS), \ - scsi_msgbyte_name(RESTORE_POINTERS), \ - scsi_msgbyte_name(DISCONNECT), \ - scsi_msgbyte_name(INITIATOR_ERROR), \ - scsi_msgbyte_name(ABORT_TASK_SET), \ - scsi_msgbyte_name(MESSAGE_REJECT), \ - scsi_msgbyte_name(NOP), \ - scsi_msgbyte_name(MSG_PARITY_ERROR), \ - scsi_msgbyte_name(LINKED_CMD_COMPLETE), \ - scsi_msgbyte_name(LINKED_FLG_CMD_COMPLETE), \ - scsi_msgbyte_name(TARGET_RESET), \ - scsi_msgbyte_name(ABORT_TASK), \ - scsi_msgbyte_name(CLEAR_TASK_SET), \ - scsi_msgbyte_name(INITIATE_RECOVERY), \ - scsi_msgbyte_name(RELEASE_RECOVERY), \ - scsi_msgbyte_name(CLEAR_ACA), \ - scsi_msgbyte_name(LOGICAL_UNIT_RESET), \ - scsi_msgbyte_name(SIMPLE_QUEUE_TAG), \ - scsi_msgbyte_name(HEAD_OF_QUEUE_TAG), \ - scsi_msgbyte_name(ORDERED_QUEUE_TAG), \ - scsi_msgbyte_name(IGNORE_WIDE_RESIDUE), \ - scsi_msgbyte_name(ACA), \ - scsi_msgbyte_name(QAS_REQUEST), \ - scsi_msgbyte_name(BUS_DEVICE_RESET), \ - scsi_msgbyte_name(ABORT)) - -#define scsi_statusbyte_name(result) { result, #result } -#define show_statusbyte_name(val) \ - __print_symbolic(val, \ - scsi_statusbyte_name(SAM_STAT_GOOD), \ - scsi_statusbyte_name(SAM_STAT_CHECK_CONDITION), \ - scsi_statusbyte_name(SAM_STAT_CONDITION_MET), \ - scsi_statusbyte_name(SAM_STAT_BUSY), \ - scsi_statusbyte_name(SAM_STAT_INTERMEDIATE), \ - scsi_statusbyte_name(SAM_STAT_INTERMEDIATE_CONDITION_MET), \ - scsi_statusbyte_name(SAM_STAT_RESERVATION_CONFLICT), \ - scsi_statusbyte_name(SAM_STAT_COMMAND_TERMINATED), \ - scsi_statusbyte_name(SAM_STAT_TASK_SET_FULL), \ - scsi_statusbyte_name(SAM_STAT_ACA_ACTIVE), \ - scsi_statusbyte_name(SAM_STAT_TASK_ABORTED)) - -#define scsi_prot_op_name(result) { result, #result } -#define show_prot_op_name(val) \ - __print_symbolic(val, \ - scsi_prot_op_name(SCSI_PROT_NORMAL), \ - scsi_prot_op_name(SCSI_PROT_READ_INSERT), \ - scsi_prot_op_name(SCSI_PROT_WRITE_STRIP), \ - scsi_prot_op_name(SCSI_PROT_READ_STRIP), \ - scsi_prot_op_name(SCSI_PROT_WRITE_INSERT), \ - scsi_prot_op_name(SCSI_PROT_READ_PASS), \ - scsi_prot_op_name(SCSI_PROT_WRITE_PASS)) - -const char *scsi_trace_parse_cdb(struct trace_seq*, unsigned char*, int); -#define __parse_cdb(cdb, len) scsi_trace_parse_cdb(p, cdb, len) -#endif - -LTTNG_TRACEPOINT_EVENT(scsi_dispatch_cmd_start, - - TP_PROTO(struct scsi_cmnd *cmd), - - TP_ARGS(cmd), - - TP_FIELDS( - ctf_integer(unsigned int, host_no, cmd->device->host->host_no) - ctf_integer(unsigned int, channel, cmd->device->channel) - ctf_integer(unsigned int, id, cmd->device->id) - ctf_integer(unsigned int, lun, cmd->device->lun) - ctf_integer(unsigned int, opcode, cmd->cmnd[0]) - ctf_integer(unsigned int, cmd_len, cmd->cmd_len) - ctf_integer(unsigned int, data_sglen, scsi_sg_count(cmd)) - ctf_integer(unsigned int, prot_sglen, scsi_prot_sg_count(cmd)) - ctf_integer(unsigned char, prot_op, scsi_get_prot_op(cmd)) - ctf_sequence_hex(unsigned char, cmnd, cmd->cmnd, u32, cmd->cmd_len) - ) -) - -LTTNG_TRACEPOINT_EVENT(scsi_dispatch_cmd_error, - - TP_PROTO(struct scsi_cmnd *cmd, int rtn), - - TP_ARGS(cmd, rtn), - - TP_FIELDS( - ctf_integer(unsigned int, host_no, cmd->device->host->host_no) - ctf_integer(unsigned int, channel, cmd->device->channel) - ctf_integer(unsigned int, id, cmd->device->id) - ctf_integer(unsigned int, lun, cmd->device->lun) - ctf_integer(int, rtn, rtn) - ctf_integer(unsigned int, opcode, cmd->cmnd[0]) - ctf_integer(unsigned int, cmd_len, cmd->cmd_len) - ctf_integer(unsigned int, data_sglen, scsi_sg_count(cmd)) - ctf_integer(unsigned int, prot_sglen, scsi_prot_sg_count(cmd)) - ctf_integer(unsigned char, prot_op, scsi_get_prot_op(cmd)) - ctf_sequence_hex(unsigned char, cmnd, cmd->cmnd, u32, cmd->cmd_len) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(scsi_cmd_done_timeout_template, - - TP_PROTO(struct scsi_cmnd *cmd), - - TP_ARGS(cmd), - - TP_FIELDS( - ctf_integer(unsigned int, host_no, cmd->device->host->host_no) - ctf_integer(unsigned int, channel, cmd->device->channel) - ctf_integer(unsigned int, id, cmd->device->id) - ctf_integer(unsigned int, lun, cmd->device->lun) - ctf_integer(int, result, cmd->result) - ctf_integer(unsigned int, opcode, cmd->cmnd[0]) - ctf_integer(unsigned int, cmd_len, cmd->cmd_len) - ctf_integer(unsigned int, data_sglen, scsi_sg_count(cmd)) - ctf_integer(unsigned int, prot_sglen, scsi_prot_sg_count(cmd)) - ctf_integer(unsigned char, prot_op, scsi_get_prot_op(cmd)) - ctf_sequence_hex(unsigned char, cmnd, cmd->cmnd, u32, cmd->cmd_len) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(scsi_cmd_done_timeout_template, scsi_dispatch_cmd_done, - TP_PROTO(struct scsi_cmnd *cmd), - TP_ARGS(cmd)) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(scsi_cmd_done_timeout_template, scsi_dispatch_cmd_timeout, - TP_PROTO(struct scsi_cmnd *cmd), - TP_ARGS(cmd)) - -LTTNG_TRACEPOINT_EVENT(scsi_eh_wakeup, - - TP_PROTO(struct Scsi_Host *shost), - - TP_ARGS(shost), - - TP_FIELDS( - ctf_integer(unsigned int, host_no, shost->host_no) - ) -) - -#endif /* LTTNG_TRACE_SCSI_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/signal.h b/include/instrumentation/events/lttng-module/signal.h deleted file mode 100644 index 4a71d14b..00000000 --- a/include/instrumentation/events/lttng-module/signal.h +++ /dev/null @@ -1,202 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM signal - -#if !defined(LTTNG_TRACE_SIGNAL_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_SIGNAL_H - -#include -#include - -#ifndef _TRACE_SIGNAL_DEF -#define _TRACE_SIGNAL_DEF -#include -#include -#undef LTTNG_FIELDS_SIGINFO -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \ - LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0)) -#define LTTNG_FIELDS_SIGINFO(info) \ - ctf_integer(int, errno, \ - (info == SEND_SIG_NOINFO || info == SEND_SIG_PRIV) ? \ - 0 : \ - info->si_errno) \ - ctf_integer(int, code, \ - (info == SEND_SIG_NOINFO) ? \ - SI_USER : \ - ((info == SEND_SIG_PRIV) ? SI_KERNEL : info->si_code)) -#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) */ -#define LTTNG_FIELDS_SIGINFO(info) \ - ctf_integer(int, errno, \ - (info == SEND_SIG_NOINFO || info == SEND_SIG_FORCED || info == SEND_SIG_PRIV) ? \ - 0 : \ - info->si_errno) \ - ctf_integer(int, code, \ - (info == SEND_SIG_NOINFO || info == SEND_SIG_FORCED) ? \ - SI_USER : \ - ((info == SEND_SIG_PRIV) ? SI_KERNEL : info->si_code)) -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) */ -#endif /* _TRACE_SIGNAL_DEF */ - -/** - * signal_generate - called when a signal is generated - * @sig: signal number - * @info: pointer to struct siginfo - * @task: pointer to struct task_struct - * - * Current process sends a 'sig' signal to 'task' process with - * 'info' siginfo. If 'info' is SEND_SIG_NOINFO or SEND_SIG_PRIV, - * 'info' is not a pointer and you can't access its field. Instead, - * SEND_SIG_NOINFO means that si_code is SI_USER, and SEND_SIG_PRIV - * means that si_code is SI_KERNEL. - */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \ - LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0)) -LTTNG_TRACEPOINT_EVENT(signal_generate, - - TP_PROTO(int sig, struct kernel_siginfo *info, struct task_struct *task, - int group, int result), - - TP_ARGS(sig, info, task, group, result), - - TP_FIELDS( - ctf_integer(int, sig, sig) - LTTNG_FIELDS_SIGINFO(info) - ctf_array_text(char, comm, task->comm, TASK_COMM_LEN) - ctf_integer(pid_t, pid, task->pid) - ctf_integer(int, group, group) - ctf_integer(int, result, result) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) -LTTNG_TRACEPOINT_EVENT(signal_generate, - - TP_PROTO(int sig, struct siginfo *info, struct task_struct *task, - int group, int result), - - TP_ARGS(sig, info, task, group, result), - - TP_FIELDS( - ctf_integer(int, sig, sig) - LTTNG_FIELDS_SIGINFO(info) - ctf_array_text(char, comm, task->comm, TASK_COMM_LEN) - ctf_integer(pid_t, pid, task->pid) - ctf_integer(int, group, group) - ctf_integer(int, result, result) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(signal_generate, - - TP_PROTO(int sig, struct siginfo *info, struct task_struct *task), - - TP_ARGS(sig, info, task), - - TP_FIELDS( - ctf_integer(int, sig, sig) - LTTNG_FIELDS_SIGINFO(info) - ctf_array_text(char, comm, task->comm, TASK_COMM_LEN) - ctf_integer(pid_t, pid, task->pid) - ) -) -#endif - -/** - * signal_deliver - called when a signal is delivered - * @sig: signal number - * @info: pointer to struct siginfo - * @ka: pointer to struct k_sigaction - * - * A 'sig' signal is delivered to current process with 'info' siginfo, - * and it will be handled by 'ka'. ka->sa.sa_handler can be SIG_IGN or - * SIG_DFL. - * Note that some signals reported by signal_generate tracepoint can be - * lost, ignored or modified (by debugger) before hitting this tracepoint. - * This means, this can show which signals are actually delivered, but - * matching generated signals and delivered signals may not be correct. - */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \ - LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0)) -LTTNG_TRACEPOINT_EVENT(signal_deliver, - - TP_PROTO(int sig, struct kernel_siginfo *info, struct k_sigaction *ka), - - TP_ARGS(sig, info, ka), - - TP_FIELDS( - ctf_integer(int, sig, sig) - LTTNG_FIELDS_SIGINFO(info) - ctf_integer(unsigned long, sa_handler, (unsigned long) ka->sa.sa_handler) - ctf_integer(unsigned long, sa_flags, ka->sa.sa_flags) - ) -) -#else -LTTNG_TRACEPOINT_EVENT(signal_deliver, - - TP_PROTO(int sig, struct siginfo *info, struct k_sigaction *ka), - - TP_ARGS(sig, info, ka), - - TP_FIELDS( - ctf_integer(int, sig, sig) - LTTNG_FIELDS_SIGINFO(info) - ctf_integer(unsigned long, sa_handler, (unsigned long) ka->sa.sa_handler) - ctf_integer(unsigned long, sa_flags, ka->sa.sa_flags) - ) -) -#endif - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(signal_queue_overflow, - - TP_PROTO(int sig, int group, struct siginfo *info), - - TP_ARGS(sig, group, info), - - TP_FIELDS( - ctf_integer(int, sig, sig) - ctf_integer(int, group, group) - LTTNG_FIELDS_SIGINFO(info) - ) -) - -/** - * signal_overflow_fail - called when signal queue is overflow - * @sig: signal number - * @group: signal to process group or not (bool) - * @info: pointer to struct siginfo - * - * Kernel fails to generate 'sig' signal with 'info' siginfo, because - * siginfo queue is overflow, and the signal is dropped. - * 'group' is not 0 if the signal will be sent to a process group. - * 'sig' is always one of RT signals. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(signal_queue_overflow, signal_overflow_fail, - - TP_PROTO(int sig, int group, struct siginfo *info), - - TP_ARGS(sig, group, info) -) - -/** - * signal_lose_info - called when siginfo is lost - * @sig: signal number - * @group: signal to process group or not (bool) - * @info: pointer to struct siginfo - * - * Kernel generates 'sig' signal but loses 'info' siginfo, because siginfo - * queue is overflow. - * 'group' is not 0 if the signal will be sent to a process group. - * 'sig' is always one of non-RT signals. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(signal_queue_overflow, signal_lose_info, - - TP_PROTO(int sig, int group, struct siginfo *info), - - TP_ARGS(sig, group, info) -) -#endif - -#endif /* LTTNG_TRACE_SIGNAL_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/skb.h b/include/instrumentation/events/lttng-module/skb.h deleted file mode 100644 index 2be9d83f..00000000 --- a/include/instrumentation/events/lttng-module/skb.h +++ /dev/null @@ -1,59 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM skb - -#if !defined(LTTNG_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_SKB_H - -#include -#include -#include -#include - -/* - * Tracepoint for free an sk_buff: - */ -LTTNG_TRACEPOINT_EVENT_MAP(kfree_skb, - - skb_kfree, - - TP_PROTO(struct sk_buff *skb, void *location), - - TP_ARGS(skb, location), - - TP_FIELDS( - ctf_integer_hex(void *, skbaddr, skb) - ctf_integer_hex(void *, location, location) - ctf_integer_network(unsigned short, protocol, skb->protocol) - ) -) - -LTTNG_TRACEPOINT_EVENT_MAP(consume_skb, - - skb_consume, - - TP_PROTO(struct sk_buff *skb), - - TP_ARGS(skb), - - TP_FIELDS( - ctf_integer_hex(void *, skbaddr, skb) - ) -) - -LTTNG_TRACEPOINT_EVENT(skb_copy_datagram_iovec, - - TP_PROTO(const struct sk_buff *skb, int len), - - TP_ARGS(skb, len), - - TP_FIELDS( - ctf_integer_hex(const void *, skbaddr, skb) - ctf_integer(int, len, len) - ) -) - -#endif /* LTTNG_TRACE_SKB_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/sock.h b/include/instrumentation/events/lttng-module/sock.h deleted file mode 100644 index 955bc1a3..00000000 --- a/include/instrumentation/events/lttng-module/sock.h +++ /dev/null @@ -1,85 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM sock - -#if !defined(LTTNG_TRACE_SOCK_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_SOCK_H - -#include -#include -#include - -LTTNG_TRACEPOINT_EVENT(sock_rcvqueue_full, - - TP_PROTO(struct sock *sk, struct sk_buff *skb), - - TP_ARGS(sk, skb), - - TP_FIELDS( - ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc)) - ctf_integer(unsigned int, truesize, skb->truesize) - ctf_integer(int, sk_rcvbuf, sk->sk_rcvbuf) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)) - -LTTNG_TRACEPOINT_EVENT(sock_exceed_buf_limit, - - TP_PROTO(struct sock *sk, struct proto *prot, long allocated, int kind), - - TP_ARGS(sk, prot, allocated, kind), - - TP_FIELDS( - ctf_string(name, prot->name) - ctf_array(long, sysctl_mem, prot->sysctl_mem, 3) - ctf_integer(long, allocated, allocated) - ctf_integer(int, sysctl_rmem, sk_get_rmem0(sk, prot)) - ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc)) - ctf_integer(int, sysctl_wmem, sk_get_wmem0(sk, prot)) - ctf_integer(int, wmem_alloc, refcount_read(&sk->sk_wmem_alloc)) - ctf_integer(int, wmem_queued, sk->sk_wmem_queued) - ctf_integer(int, kind, kind) - ) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) - -LTTNG_TRACEPOINT_EVENT(sock_exceed_buf_limit, - - TP_PROTO(struct sock *sk, struct proto *prot, long allocated), - - TP_ARGS(sk, prot, allocated), - - TP_FIELDS( - ctf_string(name, prot->name) - ctf_array(long, sysctl_mem, prot->sysctl_mem, 3) - ctf_integer(long, allocated, allocated) - ctf_integer(int, sysctl_rmem, sk_get_rmem0(sk, prot)) - ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc)) - ) -) - -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) */ - -LTTNG_TRACEPOINT_EVENT(sock_exceed_buf_limit, - - TP_PROTO(struct sock *sk, struct proto *prot, long allocated), - - TP_ARGS(sk, prot, allocated), - - TP_FIELDS( - ctf_string(name, prot->name) - ctf_array(long, sysctl_mem, prot->sysctl_mem, 3) - ctf_integer(long, allocated, allocated) - ctf_integer(int, sysctl_rmem, prot->sysctl_rmem[0]) - ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc)) - ) -) - -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) */ - -#endif /* LTTNG_TRACE_SOCK_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/timer.h b/include/instrumentation/events/lttng-module/timer.h deleted file mode 100644 index 503c5bc2..00000000 --- a/include/instrumentation/events/lttng-module/timer.h +++ /dev/null @@ -1,397 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM timer - -#if !defined(LTTNG_TRACE_TIMER_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_TIMER_H - -#include - -#ifndef _TRACE_TIMER_DEF_ -#define _TRACE_TIMER_DEF_ -#include -#include -#include - -struct timer_list; - -#endif /* _TRACE_TIMER_DEF_ */ - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) -#define lttng_ktime_get_tv64(kt) (kt) -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ -#define lttng_ktime_get_tv64(kt) ((kt).tv64) -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ - -LTTNG_TRACEPOINT_EVENT_CLASS(timer_class, - - TP_PROTO(struct timer_list *timer), - - TP_ARGS(timer), - - TP_FIELDS( - ctf_integer_hex(void *, timer, timer) - ) -) - -/** - * timer_init - called when the timer is initialized - * @timer: pointer to struct timer_list - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(timer_class, timer_init, - - TP_PROTO(struct timer_list *timer), - - TP_ARGS(timer) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) || \ - LTTNG_RHEL_KERNEL_RANGE(3,10,0,957,0,0, 3,11,0,0,0,0)) -/** - * timer_start - called when the timer is started - * @timer: pointer to struct timer_list - * @expires: the timers expiry time - * @flags: the timers expiry time - */ -LTTNG_TRACEPOINT_EVENT(timer_start, - - TP_PROTO(struct timer_list *timer, unsigned long expires, - unsigned int flags), - - TP_ARGS(timer, expires, flags), - - TP_FIELDS( - ctf_integer_hex(void *, timer, timer) - ctf_integer_hex(void *, function, timer->function) - ctf_integer(unsigned long, expires, expires) - ctf_integer(unsigned long, now, jiffies) - ctf_integer(unsigned int, flags, flags) - ) -) -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ -/** - * timer_start - called when the timer is started - * @timer: pointer to struct timer_list - * @expires: the timers expiry time - */ -LTTNG_TRACEPOINT_EVENT(timer_start, - - TP_PROTO(struct timer_list *timer, unsigned long expires), - - TP_ARGS(timer, expires), - - TP_FIELDS( - ctf_integer_hex(void *, timer, timer) - ctf_integer_hex(void *, function, timer->function) - ctf_integer(unsigned long, expires, expires) - ctf_integer(unsigned long, now, jiffies) - ) -) -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)) -/** - * timer_expire_entry - called immediately before the timer callback - * @timer: pointer to struct timer_list - * - * Allows to determine the timer latency. - */ -LTTNG_TRACEPOINT_EVENT(timer_expire_entry, - - TP_PROTO(struct timer_list *timer, unsigned long baseclk), - - TP_ARGS(timer, baseclk), - - TP_FIELDS( - ctf_integer_hex(void *, timer, timer) - ctf_integer(unsigned long, now, jiffies) - ctf_integer_hex(void *, function, timer->function) - ctf_integer(unsigned long, baseclk, baseclk) - ) -) -#else -/** - * timer_expire_entry - called immediately before the timer callback - * @timer: pointer to struct timer_list - * - * Allows to determine the timer latency. - */ -LTTNG_TRACEPOINT_EVENT(timer_expire_entry, - - TP_PROTO(struct timer_list *timer), - - TP_ARGS(timer), - - TP_FIELDS( - ctf_integer_hex(void *, timer, timer) - ctf_integer(unsigned long, now, jiffies) - ctf_integer_hex(void *, function, timer->function) - ) -) -#endif - -/** - * timer_expire_exit - called immediately after the timer callback returns - * @timer: pointer to struct timer_list - * - * When used in combination with the timer_expire_entry tracepoint we can - * determine the runtime of the timer callback function. - * - * NOTE: Do NOT derefernce timer in TP_fast_assign. The pointer might - * be invalid. We solely track the pointer. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(timer_class, timer_expire_exit, - - TP_PROTO(struct timer_list *timer), - - TP_ARGS(timer) -) - -/** - * timer_cancel - called when the timer is canceled - * @timer: pointer to struct timer_list - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(timer_class, timer_cancel, - - TP_PROTO(struct timer_list *timer), - - TP_ARGS(timer) -) - -/** - * hrtimer_init - called when the hrtimer is initialized - * @timer: pointer to struct hrtimer - * @clockid: the hrtimers clock - * @mode: the hrtimers mode - */ -LTTNG_TRACEPOINT_EVENT_MAP(hrtimer_init, - - timer_hrtimer_init, - - TP_PROTO(struct hrtimer *hrtimer, clockid_t clockid, - enum hrtimer_mode mode), - - TP_ARGS(hrtimer, clockid, mode), - - TP_FIELDS( - ctf_integer_hex(void *, hrtimer, hrtimer) - ctf_integer(clockid_t, clockid, clockid) - ctf_integer(enum hrtimer_mode, mode, mode) - ) -) - -/** - * hrtimer_start - called when the hrtimer is started - * @timer: pointer to struct hrtimer - */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0) || \ - LTTNG_RT_KERNEL_RANGE(4,14,0,0, 4,15,0,0)) -LTTNG_TRACEPOINT_EVENT_MAP(hrtimer_start, - - timer_hrtimer_start, - - TP_PROTO(struct hrtimer *hrtimer, enum hrtimer_mode mode), - - TP_ARGS(hrtimer, mode), - - TP_FIELDS( - ctf_integer_hex(void *, hrtimer, hrtimer) - ctf_integer_hex(void *, function, hrtimer->function) - ctf_integer(s64, expires, - lttng_ktime_get_tv64(hrtimer_get_expires(hrtimer))) - ctf_integer(s64, softexpires, - lttng_ktime_get_tv64(hrtimer_get_softexpires(hrtimer))) - ctf_integer(enum hrtimer_mode, mode, mode) - ) -) -#else -LTTNG_TRACEPOINT_EVENT_MAP(hrtimer_start, - - timer_hrtimer_start, - - TP_PROTO(struct hrtimer *hrtimer), - - TP_ARGS(hrtimer), - - TP_FIELDS( - ctf_integer_hex(void *, hrtimer, hrtimer) - ctf_integer_hex(void *, function, hrtimer->function) - ctf_integer(s64, expires, - lttng_ktime_get_tv64(hrtimer_get_expires(hrtimer))) - ctf_integer(s64, softexpires, - lttng_ktime_get_tv64(hrtimer_get_softexpires(hrtimer))) - ) -) -#endif - -/** - * htimmer_expire_entry - called immediately before the hrtimer callback - * @timer: pointer to struct hrtimer - * @now: pointer to variable which contains current time of the - * timers base. - * - * Allows to determine the timer latency. - */ -LTTNG_TRACEPOINT_EVENT_MAP(hrtimer_expire_entry, - - timer_hrtimer_expire_entry, - - TP_PROTO(struct hrtimer *hrtimer, ktime_t *now), - - TP_ARGS(hrtimer, now), - - TP_FIELDS( - ctf_integer_hex(void *, hrtimer, hrtimer) - ctf_integer(s64, now, lttng_ktime_get_tv64(*now)) - ctf_integer_hex(void *, function, hrtimer->function) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(timer_hrtimer_class, - - TP_PROTO(struct hrtimer *hrtimer), - - TP_ARGS(hrtimer), - - TP_FIELDS( - ctf_integer_hex(void *, hrtimer, hrtimer) - ) -) - -/** - * hrtimer_expire_exit - called immediately after the hrtimer callback returns - * @timer: pointer to struct hrtimer - * - * When used in combination with the hrtimer_expire_entry tracepoint we can - * determine the runtime of the callback function. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(timer_hrtimer_class, hrtimer_expire_exit, - - timer_hrtimer_expire_exit, - - TP_PROTO(struct hrtimer *hrtimer), - - TP_ARGS(hrtimer) -) - -/** - * hrtimer_cancel - called when the hrtimer is canceled - * @hrtimer: pointer to struct hrtimer - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(timer_hrtimer_class, hrtimer_cancel, - - timer_hrtimer_cancel, - - TP_PROTO(struct hrtimer *hrtimer), - - TP_ARGS(hrtimer) -) - -/** - * itimer_state - called when itimer is started or canceled - * @which: name of the interval timer - * @value: the itimers value, itimer is canceled if value->it_value is - * zero, otherwise it is started - * @expires: the itimers expiry time - */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) -LTTNG_TRACEPOINT_EVENT_MAP(itimer_state, - - timer_itimer_state, - - TP_PROTO(int which, const struct itimerspec64 *const value, - unsigned long long expires), - - TP_ARGS(which, value, expires), - - TP_FIELDS( - ctf_integer(int, which, which) - ctf_integer(unsigned long long, expires, expires) - ctf_integer(long, value_sec, value->it_value.tv_sec) - ctf_integer(long, value_nsec, value->it_value.tv_nsec) - ctf_integer(long, interval_sec, value->it_interval.tv_sec) - ctf_integer(long, interval_nsec, value->it_interval.tv_nsec) - ) -) -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) -LTTNG_TRACEPOINT_EVENT_MAP(itimer_state, - - timer_itimer_state, - - TP_PROTO(int which, const struct itimerval *const value, - unsigned long long expires), - - TP_ARGS(which, value, expires), - - TP_FIELDS( - ctf_integer(int, which, which) - ctf_integer(unsigned long long, expires, expires) - ctf_integer(long, value_sec, value->it_value.tv_sec) - ctf_integer(long, value_usec, value->it_value.tv_usec) - ctf_integer(long, interval_sec, value->it_interval.tv_sec) - ctf_integer(long, interval_usec, value->it_interval.tv_usec) - ) -) -#else /* if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ -LTTNG_TRACEPOINT_EVENT_MAP(itimer_state, - - timer_itimer_state, - - TP_PROTO(int which, const struct itimerval *const value, - cputime_t expires), - - TP_ARGS(which, value, expires), - - TP_FIELDS( - ctf_integer(int, which, which) - ctf_integer(cputime_t, expires, expires) - ctf_integer(long, value_sec, value->it_value.tv_sec) - ctf_integer(long, value_usec, value->it_value.tv_usec) - ctf_integer(long, interval_sec, value->it_interval.tv_sec) - ctf_integer(long, interval_usec, value->it_interval.tv_usec) - ) -) -#endif /* #else (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ - -/** - * itimer_expire - called when itimer expires - * @which: type of the interval timer - * @pid: pid of the process which owns the timer - * @now: current time, used to calculate the latency of itimer - */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) -LTTNG_TRACEPOINT_EVENT_MAP(itimer_expire, - - timer_itimer_expire, - - TP_PROTO(int which, struct pid *pid, unsigned long long now), - - TP_ARGS(which, pid, now), - - TP_FIELDS( - ctf_integer(int , which, which) - ctf_integer(pid_t, pid, pid_nr(pid)) - ctf_integer(unsigned long long, now, now) - ) -) -#else /* if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ -LTTNG_TRACEPOINT_EVENT_MAP(itimer_expire, - - timer_itimer_expire, - - TP_PROTO(int which, struct pid *pid, cputime_t now), - - TP_ARGS(which, pid, now), - - TP_FIELDS( - ctf_integer(int , which, which) - ctf_integer(pid_t, pid, pid_nr(pid)) - ctf_integer(cputime_t, now, now) - ) -) -#endif /* #else (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ - -#endif /* LTTNG_TRACE_TIMER_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/udp.h b/include/instrumentation/events/lttng-module/udp.h deleted file mode 100644 index b63a1bb5..00000000 --- a/include/instrumentation/events/lttng-module/udp.h +++ /dev/null @@ -1,26 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM udp - -#if !defined(LTTNG_TRACE_UDP_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_UDP_H - -#include -#include - -LTTNG_TRACEPOINT_EVENT(udp_fail_queue_rcv_skb, - - TP_PROTO(int rc, struct sock *sk), - - TP_ARGS(rc, sk), - - TP_FIELDS( - ctf_integer(int, rc, rc) - ctf_integer(__u16, lport, inet_sk(sk)->inet_num) - ) -) - -#endif /* LTTNG_TRACE_UDP_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/v4l2.h b/include/instrumentation/events/lttng-module/v4l2.h deleted file mode 100644 index dd7551e8..00000000 --- a/include/instrumentation/events/lttng-module/v4l2.h +++ /dev/null @@ -1,82 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM v4l2 - -#if !defined(LTTNG_TRACE_V4L2_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_V4L2_H - -#include - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(v4l2_class, - - TP_PROTO(int minor, struct v4l2_buffer *buf), - - TP_ARGS(minor, buf), - - TP_FIELDS( - ctf_integer(int, minor, minor) - ctf_integer(u32, index, buf->index) - ctf_integer(u32, type, buf->type) - ctf_integer(u32, bytesused, buf->bytesused) - ctf_integer(u32, flags, buf->flags) - ctf_integer(u32, field, buf->field) - ctf_integer(s64, timestamp, v4l2_buffer_get_timestamp(buf)) - ctf_integer(u32, timecode_type, buf->timecode.type) - ctf_integer(u32, timecode_flags, buf->timecode.flags) - ctf_integer(u8, timecode_frames, buf->timecode.frames) - ctf_integer(u8, timecode_seconds, buf->timecode.seconds) - ctf_integer(u8, timecode_minutes, buf->timecode.minutes) - ctf_integer(u8, timecode_hours, buf->timecode.hours) - ctf_array(u8, timecode_userbits, buf->timecode.userbits, 4) - ctf_integer(u32, sequence, buf->sequence) - ) -) -#else -LTTNG_TRACEPOINT_EVENT_CLASS(v4l2_class, - - TP_PROTO(int minor, struct v4l2_buffer *buf), - - TP_ARGS(minor, buf), - - TP_FIELDS( - ctf_integer(int, minor, minor) - ctf_integer(u32, index, buf->index) - ctf_integer(u32, type, buf->type) - ctf_integer(u32, bytesused, buf->bytesused) - ctf_integer(u32, flags, buf->flags) - ctf_integer(u32, field, buf->field) - ctf_integer(s64, timestamp, timeval_to_ns(&buf->timestamp)) - ctf_integer(u32, timecode_type, buf->timecode.type) - ctf_integer(u32, timecode_flags, buf->timecode.flags) - ctf_integer(u8, timecode_frames, buf->timecode.frames) - ctf_integer(u8, timecode_seconds, buf->timecode.seconds) - ctf_integer(u8, timecode_minutes, buf->timecode.minutes) - ctf_integer(u8, timecode_hours, buf->timecode.hours) - ctf_array(u8, timecode_userbits, buf->timecode.userbits, 4) - ctf_integer(u32, sequence, buf->sequence) - ) -) -#endif - -LTTNG_TRACEPOINT_EVENT_INSTANCE(v4l2_class, - v4l2_dqbuf, - - TP_PROTO(int minor, struct v4l2_buffer *buf), - - TP_ARGS(minor, buf) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(v4l2_class, - - v4l2_qbuf, - - TP_PROTO(int minor, struct v4l2_buffer *buf), - - TP_ARGS(minor, buf) -) - -#endif /* if !defined(LTTNG_TRACE_V4L2_H) || defined(TRACE_HEADER_MULTI_READ) */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/workqueue.h b/include/instrumentation/events/lttng-module/workqueue.h deleted file mode 100644 index 8ca0d6bf..00000000 --- a/include/instrumentation/events/lttng-module/workqueue.h +++ /dev/null @@ -1,132 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM workqueue - -#if !defined(LTTNG_TRACE_WORKQUEUE_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_WORKQUEUE_H - -#include -#include -#include - -#ifndef _TRACE_WORKQUEUE_DEF_ -#define _TRACE_WORKQUEUE_DEF_ - -struct worker; -struct global_cwq; - -#endif - -LTTNG_TRACEPOINT_EVENT_CLASS(workqueue_work, - - TP_PROTO(struct work_struct *work), - - TP_ARGS(work), - - TP_FIELDS( - ctf_integer_hex(void *, work, work) - ) -) - -/** - * workqueue_queue_work - called when a work gets queued - * @req_cpu: the requested cpu - * @cwq: pointer to struct cpu_workqueue_struct - * @work: pointer to struct work_struct - * - * This event occurs when a work is queued immediately or once a - * delayed work is actually queued on a workqueue (ie: once the delay - * has been reached). - */ -LTTNG_TRACEPOINT_EVENT(workqueue_queue_work, - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) - TP_PROTO(unsigned int req_cpu, struct pool_workqueue *pwq, - struct work_struct *work), - - TP_ARGS(req_cpu, pwq, work), -#else - TP_PROTO(unsigned int req_cpu, struct cpu_workqueue_struct *cwq, - struct work_struct *work), - - TP_ARGS(req_cpu, cwq, work), -#endif - - TP_FIELDS( - ctf_integer_hex(void *, work, work) - ctf_integer_hex(void *, function, work->func) - ctf_integer(unsigned int, req_cpu, req_cpu) - ) -) - -/** - * workqueue_activate_work - called when a work gets activated - * @work: pointer to struct work_struct - * - * This event occurs when a queued work is put on the active queue, - * which happens immediately after queueing unless @max_active limit - * is reached. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(workqueue_work, workqueue_activate_work, - - TP_PROTO(struct work_struct *work), - - TP_ARGS(work) -) - -/** - * workqueue_execute_start - called immediately before the workqueue callback - * @work: pointer to struct work_struct - * - * Allows to track workqueue execution. - */ -LTTNG_TRACEPOINT_EVENT(workqueue_execute_start, - - TP_PROTO(struct work_struct *work), - - TP_ARGS(work), - - TP_FIELDS( - ctf_integer_hex(void *, work, work) - ctf_integer_hex(void *, function, work->func) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) -/** - * workqueue_execute_end - called immediately after the workqueue callback - * @work: pointer to struct work_struct - * @function: pointer to worker function - * - * Allows to track workqueue execution. - */ -LTTNG_TRACEPOINT_EVENT(workqueue_execute_end, - - TP_PROTO(struct work_struct *work, work_func_t function), - - TP_ARGS(work, function), - - TP_FIELDS( - ctf_integer_hex(void *, work, work) - ctf_integer_hex(void *, function, function) - ) -) -#else -/** - * workqueue_execute_end - called immediately after the workqueue callback - * @work: pointer to struct work_struct - * - * Allows to track workqueue execution. - */ -LTTNG_TRACEPOINT_EVENT_INSTANCE(workqueue_work, workqueue_execute_end, - - TP_PROTO(struct work_struct *work), - - TP_ARGS(work) -) -#endif - -#endif /* LTTNG_TRACE_WORKQUEUE_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-module/writeback.h b/include/instrumentation/events/lttng-module/writeback.h deleted file mode 100644 index fd898c51..00000000 --- a/include/instrumentation/events/lttng-module/writeback.h +++ /dev/null @@ -1,732 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM writeback - -#if !defined(LTTNG_TRACE_WRITEBACK_H) || defined(TRACE_HEADER_MULTI_READ) -#define LTTNG_TRACE_WRITEBACK_H - -#include -#include -#include -#include -#include - -#ifndef _TRACE_WRITEBACK_DEF_ -#define _TRACE_WRITEBACK_DEF_ - -/* - * Vanilla kernels before 4.0 do not implement inode_to_bdi - * RHEL kernels before 3.10.0-327.10.1 do not implement inode_to_bdi - * RHEL kernel 3.10.0-327.10.1 has inode_to_bdi - * RHEL kernel 3.10.0-327.13.1 includes a partial merge of upstream - * commit a212b105b07d75b48b1a166378282e8a77fbf53d which inlines - * inode_to_bdi but not sb_is_blkdev_sb making it unusable by modules. - */ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)) -static inline struct backing_dev_info *lttng_inode_to_bdi(struct inode *inode) -{ - struct super_block *sb; - - if (!inode) - return &noop_backing_dev_info; - - sb = inode->i_sb; - - if (strcmp(sb->s_type->name, "bdev") == 0) - return inode->i_mapping->backing_dev_info; - - return sb->s_bdi; -} -#else -static inline struct backing_dev_info *lttng_inode_to_bdi(struct inode *inode) -{ - return inode_to_bdi(inode); -} -#endif /* #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)) */ - -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) -#define show_inode_state(state) \ - __print_flags(state, "|", \ - {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \ - {I_DIRTY_DATASYNC, "I_DIRTY_DATASYNC"}, \ - {I_DIRTY_PAGES, "I_DIRTY_PAGES"}, \ - {I_NEW, "I_NEW"}, \ - {I_WILL_FREE, "I_WILL_FREE"}, \ - {I_FREEING, "I_FREEING"}, \ - {I_CLEAR, "I_CLEAR"}, \ - {I_SYNC, "I_SYNC"}, \ - {I_DIRTY_TIME, "I_DIRTY_TIME"}, \ - {I_DIRTY_TIME_EXPIRED, "I_DIRTY_TIME_EXPIRED"}, \ - {I_REFERENCED, "I_REFERENCED"} \ - ) -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */ -#define show_inode_state(state) \ - __print_flags(state, "|", \ - {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \ - {I_DIRTY_DATASYNC, "I_DIRTY_DATASYNC"}, \ - {I_DIRTY_PAGES, "I_DIRTY_PAGES"}, \ - {I_NEW, "I_NEW"}, \ - {I_WILL_FREE, "I_WILL_FREE"}, \ - {I_FREEING, "I_FREEING"}, \ - {I_CLEAR, "I_CLEAR"}, \ - {I_SYNC, "I_SYNC"}, \ - {I_REFERENCED, "I_REFERENCED"} \ - ) -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */ - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) - -LTTNG_TRACEPOINT_EVENT(writeback_dirty_page, - TP_PROTO(struct page *page, struct address_space *mapping), - TP_ARGS(page, mapping), - TP_FIELDS( - ctf_array_text(char, name, - mapping ? dev_name(lttng_inode_to_bdi(mapping->host)->dev) : "(unknown)", 32) - ctf_integer(unsigned long, ino, mapping ? mapping->host->i_ino : 0) - ctf_integer(pgoff_t, index, page->index) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(writeback_dirty_inode_template, - TP_PROTO(struct inode *inode, int flags), - TP_ARGS(inode, flags), - TP_FIELDS( - /* may be called for files on pseudo FSes w/ unregistered bdi */ - ctf_array_text(char, name, - lttng_inode_to_bdi(inode)->dev ? - dev_name(lttng_inode_to_bdi(inode)->dev) : "(unknown)", 32) - ctf_integer(unsigned long, ino, inode->i_ino) - ctf_integer(unsigned long, state, inode->i_state) - ctf_integer(unsigned long, flags, flags) - ) -) -#define LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(name) \ -LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_dirty_inode_template, name, \ - TP_PROTO(struct inode *inode, int flags), \ - TP_ARGS(inode, flags)) -LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode_start) -LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode) -LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_mark_inode_dirty) - -LTTNG_TRACEPOINT_EVENT_CLASS(writeback_write_inode_template, - TP_PROTO(struct inode *inode, struct writeback_control *wbc), - TP_ARGS(inode, wbc), - TP_FIELDS( - ctf_array_text(char, name, - dev_name(lttng_inode_to_bdi(inode)->dev), 32) - ctf_integer(unsigned long, ino, inode->i_ino) - ctf_integer(int, sync_mode, wbc->sync_mode) - ) -) - -#define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(name) \ -LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_write_inode_template, name, \ - TP_PROTO(struct inode *inode, struct writeback_control *wbc), \ - TP_ARGS(inode, wbc)) -LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode_start) -LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) - -LTTNG_TRACEPOINT_EVENT(writeback_dirty_page, - TP_PROTO(struct page *page, struct address_space *mapping), - TP_ARGS(page, mapping), - TP_FIELDS( - ctf_array_text(char, name, - mapping ? dev_name(mapping->backing_dev_info->dev) : "(unknown)", 32) - ctf_integer(unsigned long, ino, mapping ? mapping->host->i_ino : 0) - ctf_integer(pgoff_t, index, page->index) - ) -) - -LTTNG_TRACEPOINT_EVENT_CLASS(writeback_dirty_inode_template, - TP_PROTO(struct inode *inode, int flags), - TP_ARGS(inode, flags), - TP_FIELDS( - /* may be called for files on pseudo FSes w/ unregistered bdi */ - ctf_array_text(char, name, - inode->i_mapping->backing_dev_info->dev ? - dev_name(inode->i_mapping->backing_dev_info->dev) - : "(unknown)", 32) - ctf_integer(unsigned long, ino, inode->i_ino) - ctf_integer(unsigned long, flags, flags) - ) -) -#define LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(name) \ -LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_dirty_inode_template, name, \ - TP_PROTO(struct inode *inode, int flags), \ - TP_ARGS(inode, flags)) -LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode_start) -LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode) - -LTTNG_TRACEPOINT_EVENT_CLASS(writeback_write_inode_template, - TP_PROTO(struct inode *inode, struct writeback_control *wbc), - TP_ARGS(inode, wbc), - TP_FIELDS( - ctf_array_text(char, name, - dev_name(inode->i_mapping->backing_dev_info->dev), 32) - ctf_integer(unsigned long, ino, inode->i_ino) - ctf_integer(int, sync_mode, wbc->sync_mode) - ) -) - -#define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(name) \ -LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_write_inode_template, name, \ - TP_PROTO(struct inode *inode, struct writeback_control *wbc), \ - TP_ARGS(inode, wbc)) -LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode_start) -LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode) - -#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) */ - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) - -LTTNG_TRACEPOINT_EVENT_CLASS(writeback_work_class, - TP_PROTO(struct bdi_writeback *wb, struct wb_writeback_work *work), - TP_ARGS(wb, work), - TP_FIELDS( - ctf_array_text(char, name, wb->bdi->dev ? dev_name(wb->bdi->dev) : - "(unknown)", 32) - ) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) - -LTTNG_TRACEPOINT_EVENT_CLASS(writeback_work_class, - TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work), - TP_ARGS(bdi, work), - TP_FIELDS( - ctf_array_text(char, name, bdi->dev ? dev_name(bdi->dev) : - "(unknown)", 32) - ) -) - -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */ - -LTTNG_TRACEPOINT_EVENT_CLASS(writeback_work_class, - TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work), - TP_ARGS(bdi, work), - TP_FIELDS( - ctf_array_text(char, name, - dev_name(bdi->dev ? bdi->dev : - default_backing_dev_info.dev), 32) - ) -) - -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */ - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) - -#define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(name) \ -LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_work_class, name, \ - TP_PROTO(struct bdi_writeback *wb, struct wb_writeback_work *work), \ - TP_ARGS(wb, work)) - -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ - -#define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(name) \ -LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_work_class, name, \ - TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work), \ - TP_ARGS(bdi, work)) - -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ - -LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_nothread) -LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_queue) -LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_exec) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) -LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_start) -LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_written) -LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_wait) -#endif - -LTTNG_TRACEPOINT_EVENT(writeback_pages_written, - TP_PROTO(long pages_written), - TP_ARGS(pages_written), - TP_FIELDS( - ctf_integer(long, pages, pages_written) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) - -LTTNG_TRACEPOINT_EVENT_CLASS(writeback_class, - TP_PROTO(struct bdi_writeback *wb), - TP_ARGS(wb), - TP_FIELDS( - ctf_array_text(char, name, - dev_name(wb->bdi->dev), 32) - ) -) - -#undef DEFINE_WRITEBACK_EVENT -#define DEFINE_WRITEBACK_EVENT(name) \ -LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_class, name, \ - TP_PROTO(struct bdi_writeback *wb), \ - TP_ARGS(wb)) - -#define DEFINE_WRITEBACK_EVENT_MAP(name, map) \ -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(writeback_class, name, map, \ - TP_PROTO(struct bdi_writeback *wb), \ - TP_ARGS(wb)) - -LTTNG_TRACEPOINT_EVENT(writeback_bdi_register, - TP_PROTO(struct backing_dev_info *bdi), - TP_ARGS(bdi), - TP_FIELDS( - ctf_array_text(char, name, - dev_name(bdi->dev), 32) - ) -) - -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ - -LTTNG_TRACEPOINT_EVENT_CLASS(writeback_class, - TP_PROTO(struct backing_dev_info *bdi), - TP_ARGS(bdi), - TP_FIELDS( - ctf_array_text(char, name, - dev_name(bdi->dev), 32) - ) -) - -#undef DEFINE_WRITEBACK_EVENT -#define DEFINE_WRITEBACK_EVENT(name) \ -LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_class, name, \ - TP_PROTO(struct backing_dev_info *bdi), \ - TP_ARGS(bdi)) - -#define DEFINE_WRITEBACK_EVENT_MAP(name, map) \ -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(writeback_class, name, map, \ - TP_PROTO(struct backing_dev_info *bdi), \ - TP_ARGS(bdi)) - -DEFINE_WRITEBACK_EVENT(writeback_bdi_register) - -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ - -DEFINE_WRITEBACK_EVENT(writeback_nowork) -DEFINE_WRITEBACK_EVENT(writeback_wake_background) -DEFINE_WRITEBACK_EVENT(writeback_wake_thread) -DEFINE_WRITEBACK_EVENT(writeback_wake_forker_thread) -DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister) -DEFINE_WRITEBACK_EVENT(writeback_thread_start) -DEFINE_WRITEBACK_EVENT(writeback_thread_stop) -#if (LTTNG_KERNEL_RANGE(3,1,0, 3,2,0)) -DEFINE_WRITEBACK_EVENT_MAP(balance_dirty_start, writeback_balance_dirty_start) -DEFINE_WRITEBACK_EVENT_MAP(balance_dirty_wait, writeback_balance_dirty_wait) - -LTTNG_TRACEPOINT_EVENT_MAP(balance_dirty_written, - - writeback_balance_dirty_written, - - TP_PROTO(struct backing_dev_info *bdi, int written), - - TP_ARGS(bdi, written), - - TP_FIELDS( - ctf_array_text(char, name, dev_name(bdi->dev), 32) - ctf_integer(int, written, written) - ) -) -#endif - -LTTNG_TRACEPOINT_EVENT_CLASS(writeback_wbc_class, - TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), - TP_ARGS(wbc, bdi), - TP_FIELDS( - ctf_array_text(char, name, dev_name(bdi->dev), 32) - ctf_integer(long, nr_to_write, wbc->nr_to_write) - ctf_integer(long, pages_skipped, wbc->pages_skipped) - ctf_integer(int, sync_mode, wbc->sync_mode) - ctf_integer(int, for_kupdate, wbc->for_kupdate) - ctf_integer(int, for_background, wbc->for_background) - ctf_integer(int, for_reclaim, wbc->for_reclaim) - ctf_integer(int, range_cyclic, wbc->range_cyclic) -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)) - ctf_integer(int, more_io, wbc->more_io) - ctf_integer(unsigned long, older_than_this, - wbc->older_than_this ? *wbc->older_than_this : 0) -#endif - ctf_integer(long, range_start, (long) wbc->range_start) - ctf_integer(long, range_end, (long) wbc->range_end) - ) -) - -#undef DEFINE_WBC_EVENT -#define LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(name, map) \ -LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(writeback_wbc_class, name, map, \ - TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \ - TP_ARGS(wbc, bdi)) -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)) -LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writeback_start, writeback_wbc_writeback_start) -LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writeback_written, writeback_wbc_writeback_written) -LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writeback_wait, writeback_wbc_writeback_wait) -LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_balance_dirty_start, writeback_wbc_balance_dirty_start) -LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_balance_dirty_written, writeback_wbc_balance_dirty_written) -LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_balance_dirty_wait, writeback_wbc_balance_dirty_wait) -#endif -LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writepage, writeback_wbc_writepage) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) -LTTNG_TRACEPOINT_EVENT(writeback_queue_io, - TP_PROTO(struct bdi_writeback *wb, -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) - struct wb_writeback_work *work, -#else - unsigned long *older_than_this, -#endif - int moved), -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) - TP_ARGS(wb, work, moved), -#else - TP_ARGS(wb, older_than_this, moved), -#endif - TP_FIELDS( - ctf_array_text(char, name, dev_name(wb->bdi->dev), 32) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) -#else - ctf_integer(unsigned long, older, - older_than_this ? *older_than_this : 0) - ctf_integer(long, age, - older_than_this ? - (jiffies - *older_than_this) * 1000 / HZ - : -1) -#endif - ctf_integer(int, moved, moved) - ) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) -LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_state, - - writeback_global_dirty_state, - - TP_PROTO(unsigned long background_thresh, - unsigned long dirty_thresh - ), - - TP_ARGS(background_thresh, - dirty_thresh - ), - - TP_FIELDS( - ctf_integer(unsigned long, nr_dirty, global_node_page_state(NR_FILE_DIRTY)) - ctf_integer(unsigned long, nr_writeback, global_node_page_state(NR_WRITEBACK)) - ctf_integer(unsigned long, nr_unstable, global_node_page_state(NR_UNSTABLE_NFS)) - ctf_integer(unsigned long, nr_dirtied, global_node_page_state(NR_DIRTIED)) - ctf_integer(unsigned long, nr_written, global_node_page_state(NR_WRITTEN)) - ctf_integer(unsigned long, background_thresh, background_thresh) - ctf_integer(unsigned long, dirty_thresh, dirty_thresh) - ctf_integer(unsigned long, dirty_limit, global_dirty_limit) - ) -) -#else -LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_state, - - writeback_global_dirty_state, - - TP_PROTO(unsigned long background_thresh, - unsigned long dirty_thresh - ), - - TP_ARGS(background_thresh, - dirty_thresh - ), - - TP_FIELDS( - ctf_integer(unsigned long, nr_dirty, global_page_state(NR_FILE_DIRTY)) - ctf_integer(unsigned long, nr_writeback, global_page_state(NR_WRITEBACK)) - ctf_integer(unsigned long, nr_unstable, global_page_state(NR_UNSTABLE_NFS)) - ctf_integer(unsigned long, nr_dirtied, global_page_state(NR_DIRTIED)) - ctf_integer(unsigned long, nr_written, global_page_state(NR_WRITTEN)) - ctf_integer(unsigned long, background_thresh, background_thresh) - ctf_integer(unsigned long, dirty_thresh, dirty_thresh) - ctf_integer(unsigned long, dirty_limit, global_dirty_limit) - ) -) -#endif -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) - -#define KBps(x) ((x) << (PAGE_SHIFT - 10)) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) - -LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit, - - writeback_bdi_dirty_ratelimit, - - TP_PROTO(struct bdi_writeback *wb, - unsigned long dirty_rate, - unsigned long task_ratelimit), - - TP_ARGS(wb, dirty_rate, task_ratelimit), - - TP_FIELDS( - ctf_array_text(char, bdi, dev_name(wb->bdi->dev), 32) - ctf_integer(unsigned long, write_bw, KBps(wb->bdi->wb.write_bandwidth)) - ctf_integer(unsigned long, avg_write_bw, KBps(wb->bdi->wb.avg_write_bandwidth)) - ctf_integer(unsigned long, dirty_rate, KBps(dirty_rate)) - ctf_integer(unsigned long, dirty_ratelimit, KBps(wb->bdi->wb.dirty_ratelimit)) - ctf_integer(unsigned long, task_ratelimit, KBps(task_ratelimit)) - ctf_integer(unsigned long, balanced_dirty_ratelimit, - KBps(wb->bdi->wb.balanced_dirty_ratelimit)) - ) -) - -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) - -LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit, - - writeback_bdi_dirty_ratelimit, - - TP_PROTO(struct backing_dev_info *bdi, - unsigned long dirty_rate, - unsigned long task_ratelimit), - - TP_ARGS(bdi, dirty_rate, task_ratelimit), - - TP_FIELDS( - ctf_array_text(char, bdi, dev_name(bdi->dev), 32) - ctf_integer(unsigned long, write_bw, KBps(bdi->wb.write_bandwidth)) - ctf_integer(unsigned long, avg_write_bw, KBps(bdi->wb.avg_write_bandwidth)) - ctf_integer(unsigned long, dirty_rate, KBps(dirty_rate)) - ctf_integer(unsigned long, dirty_ratelimit, KBps(bdi->wb.dirty_ratelimit)) - ctf_integer(unsigned long, task_ratelimit, KBps(task_ratelimit)) - ctf_integer(unsigned long, balanced_dirty_ratelimit, - KBps(bdi->wb.balanced_dirty_ratelimit)) - ) -) - -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ - -LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit, - - writeback_bdi_dirty_ratelimit, - - TP_PROTO(struct backing_dev_info *bdi, - unsigned long dirty_rate, - unsigned long task_ratelimit), - - TP_ARGS(bdi, dirty_rate, task_ratelimit), - - TP_FIELDS( - ctf_array_text(char, bdi, dev_name(bdi->dev), 32) - ctf_integer(unsigned long, write_bw, KBps(bdi->write_bandwidth)) - ctf_integer(unsigned long, avg_write_bw, KBps(bdi->avg_write_bandwidth)) - ctf_integer(unsigned long, dirty_rate, KBps(dirty_rate)) - ctf_integer(unsigned long, dirty_ratelimit, KBps(bdi->dirty_ratelimit)) - ctf_integer(unsigned long, task_ratelimit, KBps(task_ratelimit)) - ctf_integer(unsigned long, balanced_dirty_ratelimit, - KBps(bdi->balanced_dirty_ratelimit)) - ) -) - -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) - -LTTNG_TRACEPOINT_EVENT_MAP(balance_dirty_pages, - - writeback_balance_dirty_pages, - - TP_PROTO(struct bdi_writeback *wb, - unsigned long thresh, - unsigned long bg_thresh, - unsigned long dirty, - unsigned long bdi_thresh, - unsigned long bdi_dirty, - unsigned long dirty_ratelimit, - unsigned long task_ratelimit, - unsigned long dirtied, - unsigned long period, - long pause, - unsigned long start_time), - - TP_ARGS(wb, thresh, bg_thresh, dirty, bdi_thresh, bdi_dirty, - dirty_ratelimit, task_ratelimit, - dirtied, period, pause, start_time - ), - - TP_FIELDS( - ctf_array_text(char, bdi, dev_name(wb->bdi->dev), 32) - ctf_integer(unsigned long, limit, global_dirty_limit) - ctf_integer(unsigned long, setpoint, - (global_dirty_limit + (thresh + bg_thresh) / 2) / 2) - ctf_integer(unsigned long, dirty, dirty) - ctf_integer(unsigned long, bdi_setpoint, - ((global_dirty_limit + (thresh + bg_thresh) / 2) / 2) * - bdi_thresh / (thresh + 1)) - ctf_integer(unsigned long, bdi_dirty, bdi_dirty) - ctf_integer(unsigned long, dirty_ratelimit, - KBps(dirty_ratelimit)) - ctf_integer(unsigned long, task_ratelimit, - KBps(task_ratelimit)) - ctf_integer(unsigned int, dirtied, dirtied) - ctf_integer(unsigned int, dirtied_pause, - current->nr_dirtied_pause) - ctf_integer(unsigned long, paused, - (jiffies - start_time) * 1000 / HZ) - ctf_integer(long, pause, pause * 1000 / HZ) - ctf_integer(unsigned long, period, - period * 1000 / HZ) - ctf_integer(long, think, - current->dirty_paused_when == 0 ? 0 : - (long)(jiffies - current->dirty_paused_when) * 1000/HZ) - ) -) - -#else /* #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ - -LTTNG_TRACEPOINT_EVENT_MAP(balance_dirty_pages, - - writeback_balance_dirty_pages, - - TP_PROTO(struct backing_dev_info *bdi, - unsigned long thresh, - unsigned long bg_thresh, - unsigned long dirty, - unsigned long bdi_thresh, - unsigned long bdi_dirty, - unsigned long dirty_ratelimit, - unsigned long task_ratelimit, - unsigned long dirtied, -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) - unsigned long period, -#endif - long pause, - unsigned long start_time), - - TP_ARGS(bdi, thresh, bg_thresh, dirty, bdi_thresh, bdi_dirty, - dirty_ratelimit, task_ratelimit, -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) - dirtied, period, pause, start_time -#else - dirtied, pause, start_time -#endif - ), - - TP_FIELDS( - ctf_array_text(char, bdi, dev_name(bdi->dev), 32) - ctf_integer(unsigned long, limit, global_dirty_limit) - ctf_integer(unsigned long, setpoint, - (global_dirty_limit + (thresh + bg_thresh) / 2) / 2) - ctf_integer(unsigned long, dirty, dirty) - ctf_integer(unsigned long, bdi_setpoint, - ((global_dirty_limit + (thresh + bg_thresh) / 2) / 2) * - bdi_thresh / (thresh + 1)) - ctf_integer(unsigned long, bdi_dirty, bdi_dirty) - ctf_integer(unsigned long, dirty_ratelimit, - KBps(dirty_ratelimit)) - ctf_integer(unsigned long, task_ratelimit, - KBps(task_ratelimit)) - ctf_integer(unsigned int, dirtied, dirtied) - ctf_integer(unsigned int, dirtied_pause, - current->nr_dirtied_pause) - ctf_integer(unsigned long, paused, - (jiffies - start_time) * 1000 / HZ) - ctf_integer(long, pause, pause * 1000 / HZ) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) - ctf_integer(unsigned long, period, - period * 1000 / HZ) - ctf_integer(long, think, - current->dirty_paused_when == 0 ? 0 : - (long)(jiffies - current->dirty_paused_when) * 1000/HZ) -#endif - ) -) -#endif /* #else #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ - -#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) */ - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) -LTTNG_TRACEPOINT_EVENT(writeback_sb_inodes_requeue, - - TP_PROTO(struct inode *inode), - TP_ARGS(inode), - - TP_FIELDS( - ctf_array_text(char, name, - dev_name(lttng_inode_to_bdi(inode)->dev), 32) - ctf_integer(unsigned long, ino, inode->i_ino) - ctf_integer(unsigned long, state, inode->i_state) - ctf_integer(unsigned long, dirtied_when, inode->dirtied_when) - ) -) -#endif - -LTTNG_TRACEPOINT_EVENT_CLASS(writeback_congest_waited_template, - - TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), - - TP_ARGS(usec_timeout, usec_delayed), - - TP_FIELDS( - ctf_integer(unsigned int, usec_timeout, usec_timeout) - ctf_integer(unsigned int, usec_delayed, usec_delayed) - ) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_congest_waited_template, writeback_congestion_wait, - - TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), - - TP_ARGS(usec_timeout, usec_delayed) -) - -LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_congest_waited_template, writeback_wait_iff_congested, - - TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), - - TP_ARGS(usec_timeout, usec_delayed) -) - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) -LTTNG_TRACEPOINT_EVENT_CLASS(writeback_single_inode_template, - - TP_PROTO(struct inode *inode, - struct writeback_control *wbc, - unsigned long nr_to_write - ), - - TP_ARGS(inode, wbc, nr_to_write), - - TP_FIELDS( - ctf_array_text(char, name, - dev_name(lttng_inode_to_bdi(inode)->dev), 32) - ctf_integer(unsigned long, ino, inode->i_ino) - ctf_integer(unsigned long, state, inode->i_state) - ctf_integer(unsigned long, dirtied_when, inode->dirtied_when) - ctf_integer(unsigned long, writeback_index, - inode->i_mapping->writeback_index) - ctf_integer(long, nr_to_write, nr_to_write) - ctf_integer(unsigned long, wrote, - nr_to_write - wbc->nr_to_write) - ) -) - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) -LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_single_inode_template, writeback_single_inode_requeue, - TP_PROTO(struct inode *inode, - struct writeback_control *wbc, - unsigned long nr_to_write), - TP_ARGS(inode, wbc, nr_to_write) -) -#endif - -LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_single_inode_template, writeback_single_inode, - TP_PROTO(struct inode *inode, - struct writeback_control *wbc, - unsigned long nr_to_write), - TP_ARGS(inode, wbc, nr_to_write) -) -#endif - -#endif /* LTTNG_TRACE_WRITEBACK_H */ - -/* This part must be outside protection */ -#include diff --git a/include/instrumentation/events/lttng-statedump.h b/include/instrumentation/events/lttng-statedump.h new file mode 100644 index 00000000..23fdd0e8 --- /dev/null +++ b/include/instrumentation/events/lttng-statedump.h @@ -0,0 +1,271 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM lttng_statedump + +#if !defined(LTTNG_TRACE_LTTNG_STATEDUMP_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_LTTNG_STATEDUMP_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef LTTNG_MNT_NS_MISSING_HEADER +# ifndef ONCE_LTTNG_FS_MOUNT_H +# define ONCE_LTTNG_FS_MOUNT_H +# include <../fs/mount.h> +# endif +#endif + +LTTNG_TRACEPOINT_EVENT(lttng_statedump_start, + TP_PROTO(struct lttng_session *session), + TP_ARGS(session), + TP_FIELDS() +) + +LTTNG_TRACEPOINT_EVENT(lttng_statedump_end, + TP_PROTO(struct lttng_session *session), + TP_ARGS(session), + TP_FIELDS() +) + +LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_state, + TP_PROTO(struct lttng_session *session, + struct task_struct *p, + int type, int mode, int submode, int status, + struct files_struct *files), + TP_ARGS(session, p, type, mode, submode, status, files), + TP_FIELDS( + ctf_integer(pid_t, tid, p->pid) + ctf_integer(pid_t, pid, p->tgid) + ctf_integer(pid_t, ppid, + ({ + pid_t ret; + + rcu_read_lock(); + ret = task_tgid_nr(p->real_parent); + rcu_read_unlock(); + ret; + })) + ctf_array_text(char, name, p->comm, TASK_COMM_LEN) + ctf_integer(int, type, type) + ctf_integer(int, mode, mode) + ctf_integer(int, submode, submode) + ctf_integer(int, status, status) + ctf_integer(unsigned int, cpu, task_cpu(p)) + ctf_integer_hex(struct files_struct *, file_table_address, files) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)) +LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_cgroup_ns, + TP_PROTO(struct lttng_session *session, + struct task_struct *p, + struct cgroup_namespace *cgroup_ns), + TP_ARGS(session, p, cgroup_ns), + TP_FIELDS( + ctf_integer(pid_t, tid, p->pid) + ctf_integer(unsigned int, ns_inum, cgroup_ns ? cgroup_ns->lttng_ns_inum : 0) + ) +) +#endif + +LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_ipc_ns, + TP_PROTO(struct lttng_session *session, + struct task_struct *p, + struct ipc_namespace *ipc_ns), + TP_ARGS(session, p, ipc_ns), + TP_FIELDS( + ctf_integer(pid_t, tid, p->pid) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) + ctf_integer(unsigned int, ns_inum, ipc_ns ? ipc_ns->lttng_ns_inum : 0) +#endif + ) +) + +#if !defined(LTTNG_MNT_NS_MISSING_HEADER) +LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_mnt_ns, + TP_PROTO(struct lttng_session *session, + struct task_struct *p, + struct mnt_namespace *mnt_ns), + TP_ARGS(session, p, mnt_ns), + TP_FIELDS( + ctf_integer(pid_t, tid, p->pid) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) + ctf_integer(unsigned int, ns_inum, mnt_ns ? mnt_ns->lttng_ns_inum : 0) +#endif + ) +) +#endif + +LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_net_ns, + TP_PROTO(struct lttng_session *session, + struct task_struct *p, + struct net *net_ns), + TP_ARGS(session, p, net_ns), + TP_FIELDS( + ctf_integer(pid_t, tid, p->pid) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) + ctf_integer(unsigned int, ns_inum, net_ns ? net_ns->lttng_ns_inum : 0) +#endif + ) +) + +LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_pid_ns, + TP_PROTO(struct lttng_session *session, + struct task_struct *p, + struct pid_namespace *pid_ns), + TP_ARGS(session, p, pid_ns), + TP_FIELDS( + ctf_integer(pid_t, tid, p->pid) + ctf_integer(pid_t, vtid, pid_ns ? task_pid_nr_ns(p, pid_ns) : 0) + ctf_integer(pid_t, vpid, pid_ns ? task_tgid_nr_ns(p, pid_ns) : 0) + ctf_integer(pid_t, vppid, + ({ + struct task_struct *parent; + pid_t ret = 0; + + if (pid_ns) { + rcu_read_lock(); + parent = rcu_dereference(p->real_parent); + ret = task_tgid_nr_ns(parent, pid_ns); + rcu_read_unlock(); + } + ret; + })) + ctf_integer(int, ns_level, pid_ns ? pid_ns->level : 0) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) + ctf_integer(unsigned int, ns_inum, pid_ns ? pid_ns->lttng_ns_inum : 0) +#endif + ) +) + +LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_user_ns, + TP_PROTO(struct lttng_session *session, + struct task_struct *p, + struct user_namespace *user_ns), + TP_ARGS(session, p, user_ns), + TP_FIELDS( + ctf_integer(pid_t, tid, p->pid) + ctf_integer(uid_t, vuid, user_ns ? lttng_task_vuid(p, user_ns) : 0) + ctf_integer(gid_t, vgid, user_ns ? lttng_task_vgid(p, user_ns) : 0) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) + ctf_integer(int, ns_level, user_ns ? user_ns->level : 0) +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) + ctf_integer(unsigned int, ns_inum, user_ns ? user_ns->lttng_ns_inum : 0) +#endif + ) +) + +LTTNG_TRACEPOINT_EVENT(lttng_statedump_process_uts_ns, + TP_PROTO(struct lttng_session *session, + struct task_struct *p, + struct uts_namespace *uts_ns), + TP_ARGS(session, p, uts_ns), + TP_FIELDS( + ctf_integer(pid_t, tid, p->pid) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) + ctf_integer(unsigned int, ns_inum, uts_ns ? uts_ns->lttng_ns_inum : 0) +#endif + ) +) + +LTTNG_TRACEPOINT_EVENT(lttng_statedump_file_descriptor, + TP_PROTO(struct lttng_session *session, + struct files_struct *files, + int fd, const char *filename, + unsigned int flags, fmode_t fmode), + TP_ARGS(session, files, fd, filename, flags, fmode), + TP_FIELDS( + ctf_integer_hex(struct files_struct *, file_table_address, files) + ctf_integer(int, fd, fd) + ctf_integer_oct(unsigned int, flags, flags) + ctf_integer_hex(fmode_t, fmode, fmode) + ctf_string(filename, filename) + ) +) + +LTTNG_TRACEPOINT_EVENT(lttng_statedump_vm_map, + TP_PROTO(struct lttng_session *session, + struct task_struct *p, struct vm_area_struct *map, + unsigned long inode), + TP_ARGS(session, p, map, inode), + TP_FIELDS( + ctf_integer(pid_t, pid, p->tgid) + ctf_integer_hex(unsigned long, start, map->vm_start) + ctf_integer_hex(unsigned long, end, map->vm_end) + ctf_integer_hex(unsigned long, flags, map->vm_flags) + ctf_integer(unsigned long, inode, inode) + ctf_integer(unsigned long, pgoff, map->vm_pgoff << PAGE_SHIFT) + ) +) + +LTTNG_TRACEPOINT_EVENT(lttng_statedump_network_interface, + TP_PROTO(struct lttng_session *session, + struct net_device *dev, struct in_ifaddr *ifa), + TP_ARGS(session, dev, ifa), + TP_FIELDS( + ctf_string(name, dev->name) + ctf_integer_network_hex(uint32_t, address_ipv4, + ifa ? ifa->ifa_address : 0U) + ) +) + +LTTNG_TRACEPOINT_EVENT(lttng_statedump_block_device, + TP_PROTO(struct lttng_session *session, + dev_t dev, const char *diskname), + TP_ARGS(session, dev, diskname), + TP_FIELDS( + ctf_integer(dev_t, dev, dev) + ctf_string(diskname, diskname) + ) +) + +/* Called with desc->lock held */ +LTTNG_TRACEPOINT_EVENT(lttng_statedump_interrupt, + TP_PROTO(struct lttng_session *session, + unsigned int irq, const char *chip_name, + struct irqaction *action), + TP_ARGS(session, irq, chip_name, action), + TP_FIELDS( + ctf_integer(unsigned int, irq, irq) + ctf_string(name, chip_name) + ctf_string(action, action->name ? : "") + ctf_integer(pid_t, tid, action->thread ? action->thread->pid : 0) + ) +) + +#if defined(CONFIG_X86_32) || defined(CONFIG_X86_64) + +#define LTTNG_HAVE_STATEDUMP_CPU_TOPOLOGY + +LTTNG_TRACEPOINT_EVENT(lttng_statedump_cpu_topology, + TP_PROTO(struct lttng_session *session, struct cpuinfo_x86 *c), + TP_ARGS(session, c), + TP_FIELDS( + ctf_string(architecture, "x86") + ctf_integer(uint16_t, cpu_id, c->cpu_index) + ctf_string(vendor, c->x86_vendor_id[0] ? c->x86_vendor_id : "unknown") + ctf_integer(uint8_t, family, c->x86) + ctf_integer(uint8_t, model, c->x86_model) + ctf_string(model_name, c->x86_model_id[0] ? c->x86_model_id : "unknown") + ctf_integer(uint16_t, physical_id, c->phys_proc_id) + ctf_integer(uint16_t, core_id, c->cpu_core_id) + ctf_integer(uint16_t, cores, c->booted_cores) + ) +) +#endif /* CONFIG_X86_32 || CONFIG_X86_64 */ + +#endif /* LTTNG_TRACE_LTTNG_STATEDUMP_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/lttng-test.h b/include/instrumentation/events/lttng-test.h new file mode 100644 index 00000000..7d2b1f7c --- /dev/null +++ b/include/instrumentation/events/lttng-test.h @@ -0,0 +1,58 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM lttng_test + +#if !defined(LTTNG_TRACE_LTTNG_TEST_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_LTTNG_TEST_H + +#include +#include +#include + +LTTNG_TRACEPOINT_ENUM( + lttng_test_filter_event_enum, + TP_ENUM_VALUES( + ctf_enum_auto("AUTO: EXPECT 0") + ctf_enum_value("VALUE: 23", 23) + ctf_enum_value("VALUE: 27", 27) + ctf_enum_auto("AUTO: EXPECT 28") + ctf_enum_range("RANGE: 101 TO 303", 101, 303) + ctf_enum_auto("AUTO: EXPECT 304") + ) +) + +LTTNG_TRACEPOINT_EVENT(lttng_test_filter_event, + TP_PROTO(int anint, int netint, long *values, + char *text, size_t textlen, + char *etext, uint32_t * net_values), + TP_ARGS(anint, netint, values, text, textlen, etext, net_values), + TP_FIELDS( + ctf_integer(int, intfield, anint) + ctf_integer_hex(int, intfield2, anint) + ctf_integer(long, longfield, anint) + ctf_integer_network(int, netintfield, netint) + ctf_integer_network_hex(int, netintfieldhex, netint) + ctf_array(long, arrfield1, values, 3) + ctf_array_text(char, arrfield2, text, 10) + ctf_array_network(uint32_t, arrfield3, net_values, 3) + ctf_sequence(char, seqfield1, text, size_t, textlen) + ctf_sequence_text(char, seqfield2, text, size_t, textlen) + ctf_sequence_network(uint32_t, seqfield3, net_values, size_t, 3) + ctf_sequence(long, seqfield4, values, size_t, 3) + ctf_string(stringfield, text) + ctf_string(stringfield2, etext) + ctf_sequence_bitfield(long, bitfield_seq, values, uint8_t, 3) + ctf_array_bitfield(long, bitfield_array, values, 3) + ctf_enum(lttng_test_filter_event_enum, int, enum0, 0) + ctf_enum(lttng_test_filter_event_enum, int, enum23, 23) + ctf_enum(lttng_test_filter_event_enum, int, enum27, 27) + ctf_enum(lttng_test_filter_event_enum, int, enum28, 28) + ctf_enum(lttng_test_filter_event_enum, int, enum202, 202) + ctf_enum(lttng_test_filter_event_enum, int, enum304, 304) + ) +) + +#endif /* LTTNG_TRACE_LTTNG_TEST_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/lttng.h b/include/instrumentation/events/lttng.h new file mode 100644 index 00000000..91eb4608 --- /dev/null +++ b/include/instrumentation/events/lttng.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM lttng + +#if !defined(LTTNG_TRACE_LTTNG_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_LTTNG_H + +#include + +LTTNG_TRACEPOINT_EVENT(lttng_logger, + TP_PROTO(const char __user *text, size_t len), + TP_ARGS(text, len), + TP_FIELDS( + ctf_user_sequence_text(char, msg, text, size_t, len) + ) +) + +#endif /* LTTNG_TRACE_LTTNG_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/mm_vmscan.h b/include/instrumentation/events/mm_vmscan.h new file mode 100644 index 00000000..8bdd65d2 --- /dev/null +++ b/include/instrumentation/events/mm_vmscan.h @@ -0,0 +1,825 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM mm_vmscan + +#if !defined(LTTNG_TRACE_MM_VMSCAN_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_MM_VMSCAN_H + +#include +#include +#include +#include +#include + +#ifndef _TRACE_VMSCAN_DEF +#define _TRACE_VMSCAN_DEF +#define RECLAIM_WB_ANON 0x0001u +#define RECLAIM_WB_FILE 0x0002u +#define RECLAIM_WB_MIXED 0x0010u +#define RECLAIM_WB_SYNC 0x0004u /* Unused, all reclaim async */ +#define RECLAIM_WB_ASYNC 0x0008u + +#if ((LINUX_VERSION_CODE <= KERNEL_VERSION(3,0,38)) || \ + LTTNG_KERNEL_RANGE(3,1,0, 3,2,0)) +typedef int isolate_mode_t; +#endif + +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)) + +#include + +#define trace_reclaim_flags(file) ( \ + (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \ + (RECLAIM_WB_ASYNC) \ + ) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)) + +#include + +#define trace_reclaim_flags(page) ( \ + (page_is_file_cache(page) ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \ + (RECLAIM_WB_ASYNC) \ + ) + +#define trace_shrink_flags(file) \ + ( \ + (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \ + (RECLAIM_WB_ASYNC) \ + ) + +#endif + +LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_sleep, + + TP_PROTO(int nid), + + TP_ARGS(nid), + + TP_FIELDS( + ctf_integer(int, nid, nid) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) + +LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake, + + TP_PROTO(int nid, int zid, int order), + + TP_ARGS(nid, zid, order), + + TP_FIELDS( + ctf_integer(int, nid, nid) + ctf_integer(int, zid, zid) + ctf_integer(int, order, order) + ) +) + +#else + +LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake, + + TP_PROTO(int nid, int order), + + TP_ARGS(nid, order), + + TP_FIELDS( + ctf_integer(int, nid, nid) + ctf_integer(int, order, order) + ) +) + +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) +LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd, + + TP_PROTO(int nid, int zid, int order, gfp_t gfp_flags), + + TP_ARGS(nid, zid, order, gfp_flags), + + TP_FIELDS( + ctf_integer(int, nid, nid) + ctf_integer(int, zid, zid) + ctf_integer(int, order, order) + ctf_integer(gfp_t, gfp_flags, gfp_flags) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd, + + TP_PROTO(int nid, int zid, int order), + + TP_ARGS(nid, zid, order), + + TP_FIELDS( + ctf_integer(int, nid, nid) + ctf_integer(int, zid, zid) + ctf_integer(int, order, order) + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)) + +LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template, + + TP_PROTO(int order, gfp_t gfp_flags), + + TP_ARGS(order, gfp_flags), + + TP_FIELDS( + ctf_integer(int, order, order) + ctf_integer(gfp_t, gfp_flags, gfp_flags) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin, + + TP_PROTO(int order, gfp_t gfp_flags), + + TP_ARGS(order, gfp_flags) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin, + + TP_PROTO(int order, gfp_t gfp_flags), + + TP_ARGS(order, gfp_flags) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin, + + TP_PROTO(int order, gfp_t gfp_flags), + + TP_ARGS(order, gfp_flags) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) + +LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template, + + TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), + + TP_ARGS(order, may_writepage, gfp_flags, classzone_idx), + + TP_FIELDS( + ctf_integer(int, order, order) + ctf_integer(int, may_writepage, may_writepage) + ctf_integer(gfp_t, gfp_flags, gfp_flags) + ctf_integer(int, classzone_idx, classzone_idx) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin, + + TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), + + TP_ARGS(order, may_writepage, gfp_flags, classzone_idx) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin, + + TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), + + TP_ARGS(order, may_writepage, gfp_flags, classzone_idx) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin, + + TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), + + TP_ARGS(order, may_writepage, gfp_flags, classzone_idx) +) + +#else + +LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template, + + TP_PROTO(int order, int may_writepage, gfp_t gfp_flags), + + TP_ARGS(order, may_writepage, gfp_flags), + + TP_FIELDS( + ctf_integer(int, order, order) + ctf_integer(int, may_writepage, may_writepage) + ctf_integer(gfp_t, gfp_flags, gfp_flags) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin, + + TP_PROTO(int order, int may_writepage, gfp_t gfp_flags), + + TP_ARGS(order, may_writepage, gfp_flags) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin, + + TP_PROTO(int order, int may_writepage, gfp_t gfp_flags), + + TP_ARGS(order, may_writepage, gfp_flags) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin, + + TP_PROTO(int order, int may_writepage, gfp_t gfp_flags), + + TP_ARGS(order, may_writepage, gfp_flags) +) + +#endif + +LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_end_template, + + TP_PROTO(unsigned long nr_reclaimed), + + TP_ARGS(nr_reclaimed), + + TP_FIELDS( + ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template, mm_vmscan_direct_reclaim_end, + + TP_PROTO(unsigned long nr_reclaimed), + + TP_ARGS(nr_reclaimed) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_reclaim_end, + + TP_PROTO(unsigned long nr_reclaimed), + + TP_ARGS(nr_reclaimed) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_softlimit_reclaim_end, + + TP_PROTO(unsigned long nr_reclaimed), + + TP_ARGS(nr_reclaimed) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0)) +LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start, + + mm_vmscan_shrink_slab_start, + + TP_PROTO(struct shrinker *shr, struct shrink_control *sc, + long nr_objects_to_shrink, unsigned long cache_items, + unsigned long long delta, unsigned long total_scan, + int priority), + + TP_ARGS(shr, sc, nr_objects_to_shrink, cache_items, delta, total_scan, + priority), + + TP_FIELDS( + ctf_integer_hex(struct shrinker *, shr, shr) + ctf_integer_hex(void *, shrink, shr->scan_objects) + ctf_integer(int, nid, sc->nid) + ctf_integer(long, nr_objects_to_shrink, nr_objects_to_shrink) + ctf_integer(gfp_t, gfp_flags, sc->gfp_mask) + ctf_integer(unsigned long, cache_items, cache_items) + ctf_integer(unsigned long long, delta, delta) + ctf_integer(unsigned long, total_scan, total_scan) + ctf_integer(int, priority, priority) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) +LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start, + + mm_vmscan_shrink_slab_start, + + TP_PROTO(struct shrinker *shr, struct shrink_control *sc, + long nr_objects_to_shrink, unsigned long pgs_scanned, + unsigned long lru_pgs, unsigned long cache_items, + unsigned long long delta, unsigned long total_scan), + + TP_ARGS(shr, sc, nr_objects_to_shrink, pgs_scanned, lru_pgs, + cache_items, delta, total_scan), + + TP_FIELDS( + ctf_integer_hex(struct shrinker *, shr, shr) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) + ctf_integer_hex(void *, shrink, shr->scan_objects) +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ + ctf_integer_hex(void *, shrink, shr->shrink) +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ + ctf_integer(long, nr_objects_to_shrink, nr_objects_to_shrink) + ctf_integer(gfp_t, gfp_flags, sc->gfp_mask) + ctf_integer(unsigned long, pgs_scanned, pgs_scanned) + ctf_integer(unsigned long, lru_pgs, lru_pgs) + ctf_integer(unsigned long, cache_items, cache_items) + ctf_integer(unsigned long long, delta, delta) + ctf_integer(unsigned long, total_scan, total_scan) + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)) +LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end, + + mm_vmscan_shrink_slab_end, + + TP_PROTO(struct shrinker *shr, int nid, int shrinker_retval, + long unused_scan_cnt, long new_scan_cnt, long total_scan), + + TP_ARGS(shr, nid, shrinker_retval, unused_scan_cnt, new_scan_cnt, + total_scan), + + TP_FIELDS( + ctf_integer_hex(struct shrinker *, shr, shr) + ctf_integer(int, nid, nid) + ctf_integer_hex(void *, shrink, shr->scan_objects) + ctf_integer(long, unused_scan, unused_scan_cnt) + ctf_integer(long, new_scan, new_scan_cnt) + ctf_integer(int, retval, shrinker_retval) + ctf_integer(long, total_scan, total_scan) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) +LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end, + + mm_vmscan_shrink_slab_end, + + TP_PROTO(struct shrinker *shr, int shrinker_retval, + long unused_scan_cnt, long new_scan_cnt), + + TP_ARGS(shr, shrinker_retval, unused_scan_cnt, new_scan_cnt), + + TP_FIELDS( + ctf_integer_hex(struct shrinker *, shr, shr) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) + ctf_integer_hex(void *, shrink, shr->scan_objects) +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ + ctf_integer_hex(void *, shrink, shr->shrink) +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ + ctf_integer(long, unused_scan, unused_scan_cnt) + ctf_integer(long, new_scan, new_scan_cnt) + ctf_integer(int, retval, shrinker_retval) + ctf_integer(long, total_scan, new_scan_cnt - unused_scan_cnt) + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) +LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_isolate, + + TP_PROTO(int classzone_idx, + int order, + unsigned long nr_requested, + unsigned long nr_scanned, + unsigned long nr_skipped, + unsigned long nr_taken, + isolate_mode_t isolate_mode, + int lru + ), + + TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_skipped, + nr_taken, isolate_mode, lru + ), + + TP_FIELDS( + ctf_integer(int, classzone_idx, classzone_idx) + ctf_integer(int, order, order) + ctf_integer(unsigned long, nr_requested, nr_requested) + ctf_integer(unsigned long, nr_scanned, nr_scanned) + ctf_integer(unsigned long, nr_skipped, nr_skipped) + ctf_integer(unsigned long, nr_taken, nr_taken) + ctf_integer(isolate_mode_t, isolate_mode, isolate_mode) + ctf_integer(int, lru, lru) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template, + + TP_PROTO(int classzone_idx, + int order, + unsigned long nr_requested, + unsigned long nr_scanned, + unsigned long nr_taken, + isolate_mode_t isolate_mode, + int file + ), + + TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken, + isolate_mode, file + ), + + + TP_FIELDS( + ctf_integer(int, classzone_idx, classzone_idx) + ctf_integer(int, order, order) + ctf_integer(unsigned long, nr_requested, nr_requested) + ctf_integer(unsigned long, nr_scanned, nr_scanned) + ctf_integer(unsigned long, nr_taken, nr_taken) + ctf_integer(isolate_mode_t, isolate_mode, isolate_mode) + ctf_integer(int, file, file) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate, + + TP_PROTO(int classzone_idx, + int order, + unsigned long nr_requested, + unsigned long nr_scanned, + unsigned long nr_taken, + isolate_mode_t isolate_mode, + int file + ), + + TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken, + isolate_mode, file + ) + +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate, + + TP_PROTO(int classzone_idx, + int order, + unsigned long nr_requested, + unsigned long nr_scanned, + unsigned long nr_taken, + isolate_mode_t isolate_mode, + int file + ), + + TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken, + isolate_mode, file + ) +) +#else +LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template, + + TP_PROTO(int order, + unsigned long nr_requested, + unsigned long nr_scanned, + unsigned long nr_taken, +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) + unsigned long nr_lumpy_taken, + unsigned long nr_lumpy_dirty, + unsigned long nr_lumpy_failed, +#endif +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) + isolate_mode_t isolate_mode +#else + isolate_mode_t isolate_mode, + int file +#endif + ), + + TP_ARGS(order, nr_requested, nr_scanned, nr_taken, +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) + nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, +#endif +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) + isolate_mode +#else + isolate_mode, file +#endif + ), + + + TP_FIELDS( + ctf_integer(int, order, order) + ctf_integer(unsigned long, nr_requested, nr_requested) + ctf_integer(unsigned long, nr_scanned, nr_scanned) + ctf_integer(unsigned long, nr_taken, nr_taken) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) + ctf_integer(unsigned long, nr_lumpy_taken, nr_lumpy_taken) + ctf_integer(unsigned long, nr_lumpy_dirty, nr_lumpy_dirty) + ctf_integer(unsigned long, nr_lumpy_failed, nr_lumpy_failed) +#endif + ctf_integer(isolate_mode_t, isolate_mode, isolate_mode) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) + ctf_integer(int, file, file) +#endif + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate, + + TP_PROTO(int order, + unsigned long nr_requested, + unsigned long nr_scanned, + unsigned long nr_taken, +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) + unsigned long nr_lumpy_taken, + unsigned long nr_lumpy_dirty, + unsigned long nr_lumpy_failed, +#endif +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) + isolate_mode_t isolate_mode +#else + isolate_mode_t isolate_mode, + int file +#endif + ), + + TP_ARGS(order, nr_requested, nr_scanned, nr_taken, +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) + nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, +#endif +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) + isolate_mode +#else + isolate_mode, file +#endif + ) + +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate, + + TP_PROTO(int order, + unsigned long nr_requested, + unsigned long nr_scanned, + unsigned long nr_taken, +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) + unsigned long nr_lumpy_taken, + unsigned long nr_lumpy_dirty, + unsigned long nr_lumpy_failed, +#endif +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) + isolate_mode_t isolate_mode +#else + isolate_mode_t isolate_mode, + int file +#endif + ), + + TP_ARGS(order, nr_requested, nr_scanned, nr_taken, +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) + nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, +#endif +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) + isolate_mode +#else + isolate_mode, file +#endif + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) +LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage, + + TP_PROTO(struct page *page), + + TP_ARGS(page), + + TP_FIELDS( + ctf_integer_hex(struct page *, page, page) + ctf_integer(int, reclaim_flags, trace_reclaim_flags( + page_is_file_lru(page))) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)) +LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage, + + TP_PROTO(struct page *page), + + TP_ARGS(page), + + TP_FIELDS( + ctf_integer_hex(struct page *, page, page) + ctf_integer(int, reclaim_flags, trace_reclaim_flags( + page_is_file_cache(page))) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)) +LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage, + + TP_PROTO(struct page *page), + + TP_ARGS(page), + + TP_FIELDS( + ctf_integer_hex(struct page *, page, page) + ctf_integer(int, reclaim_flags, trace_reclaim_flags(page)) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage, + + TP_PROTO(struct page *page, + int reclaim_flags), + + TP_ARGS(page, reclaim_flags), + + TP_FIELDS( + ctf_integer_hex(struct page *, page, page) + ctf_integer(int, reclaim_flags, reclaim_flags) + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)) +LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, + + TP_PROTO(int nid, + unsigned long nr_scanned, unsigned long nr_reclaimed, + struct reclaim_stat *stat, int priority, int file), + + TP_ARGS(nid, nr_scanned, nr_reclaimed, stat, priority, file), + + TP_FIELDS( + ctf_integer(int, nid, nid) + ctf_integer(unsigned long, nr_scanned, nr_scanned) + ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) + ctf_integer(unsigned long, nr_dirty, stat->nr_dirty) + ctf_integer(unsigned long, nr_writeback, stat->nr_writeback) + ctf_integer(unsigned long, nr_congested, stat->nr_congested) + ctf_integer(unsigned long, nr_immediate, stat->nr_immediate) + ctf_integer(unsigned long, nr_activate_anon, stat->nr_activate[0]) + ctf_integer(unsigned long, nr_activate_file, stat->nr_activate[1]) + ctf_integer(unsigned long, nr_ref_keep, stat->nr_ref_keep) + ctf_integer(unsigned long, nr_unmap_fail, stat->nr_unmap_fail) + ctf_integer(int, priority, priority) + ctf_integer(int, reclaim_flags, trace_reclaim_flags(file)) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) +LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, + + TP_PROTO(int nid, + unsigned long nr_scanned, unsigned long nr_reclaimed, + struct reclaim_stat *stat, int priority, int file), + + TP_ARGS(nid, nr_scanned, nr_reclaimed, stat, priority, file), + + TP_FIELDS( + ctf_integer(int, nid, nid) + ctf_integer(unsigned long, nr_scanned, nr_scanned) + ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) + ctf_integer(unsigned long, nr_dirty, stat->nr_dirty) + ctf_integer(unsigned long, nr_writeback, stat->nr_writeback) + ctf_integer(unsigned long, nr_congested, stat->nr_congested) + ctf_integer(unsigned long, nr_immediate, stat->nr_immediate) + ctf_integer(unsigned long, nr_activate, stat->nr_activate) + ctf_integer(unsigned long, nr_ref_keep, stat->nr_ref_keep) + ctf_integer(unsigned long, nr_unmap_fail, stat->nr_unmap_fail) + ctf_integer(int, priority, priority) + ctf_integer(int, reclaim_flags, trace_shrink_flags(file)) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) +LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, + + TP_PROTO(int nid, + unsigned long nr_scanned, unsigned long nr_reclaimed, + unsigned long nr_dirty, unsigned long nr_writeback, + unsigned long nr_congested, unsigned long nr_immediate, + unsigned long nr_activate, unsigned long nr_ref_keep, + unsigned long nr_unmap_fail, + int priority, int file), + + TP_ARGS(nid, nr_scanned, nr_reclaimed, nr_dirty, nr_writeback, + nr_congested, nr_immediate, nr_activate, nr_ref_keep, + nr_unmap_fail, priority, file), + + TP_FIELDS( + ctf_integer(int, nid, nid) + ctf_integer(unsigned long, nr_scanned, nr_scanned) + ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) + ctf_integer(unsigned long, nr_dirty, nr_dirty) + ctf_integer(unsigned long, nr_writeback, nr_writeback) + ctf_integer(unsigned long, nr_congested, nr_congested) + ctf_integer(unsigned long, nr_immediate, nr_immediate) + ctf_integer(unsigned long, nr_activate, nr_activate) + ctf_integer(unsigned long, nr_ref_keep, nr_ref_keep) + ctf_integer(unsigned long, nr_unmap_fail, nr_unmap_fail) + ctf_integer(int, priority, priority) + ctf_integer(int, reclaim_flags, trace_shrink_flags(file)) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) +LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, + + TP_PROTO(int nid, + unsigned long nr_scanned, unsigned long nr_reclaimed, + int priority, int file), + + TP_ARGS(nid, nr_scanned, nr_reclaimed, priority, file), + + TP_FIELDS( + ctf_integer(int, nid, nid) + ctf_integer(unsigned long, nr_scanned, nr_scanned) + ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) + ctf_integer(int, priority, priority) + ctf_integer(int, reclaim_flags, trace_shrink_flags(file)) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)) +LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, + + TP_PROTO(struct zone *zone, + unsigned long nr_scanned, unsigned long nr_reclaimed, + int priority, int file), + + TP_ARGS(zone, nr_scanned, nr_reclaimed, priority, file), + + TP_FIELDS( + ctf_integer(int, nid, zone_to_nid(zone)) + ctf_integer(int, zid, zone_idx(zone)) + ctf_integer(unsigned long, nr_scanned, nr_scanned) + ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) + ctf_integer(int, priority, priority) + ctf_integer(int, reclaim_flags, trace_shrink_flags(file)) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive, + + TP_PROTO(int nid, int zid, + unsigned long nr_scanned, unsigned long nr_reclaimed, + int priority, int reclaim_flags), + + TP_ARGS(nid, zid, nr_scanned, nr_reclaimed, priority, reclaim_flags), + + TP_FIELDS( + ctf_integer(int, nid, nid) + ctf_integer(int, zid, zid) + ctf_integer(unsigned long, nr_scanned, nr_scanned) + ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed) + ctf_integer(int, priority, priority) + ctf_integer(int, reclaim_flags, reclaim_flags) + ) +) +#endif + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) +LTTNG_TRACEPOINT_EVENT_MAP(replace_swap_token, + + mm_vmscan_replace_swap_token, + + TP_PROTO(struct mm_struct *old_mm, + struct mm_struct *new_mm), + + TP_ARGS(old_mm, new_mm), + + TP_FIELDS( + ctf_integer_hex(struct mm_struct *, old_mm, old_mm) + ctf_integer(unsigned int, old_prio, old_mm ? old_mm->token_priority : 0) + ctf_integer_hex(struct mm_struct *, new_mm, new_mm) + ctf_integer(unsigned int, new_prio, new_mm->token_priority) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_put_swap_token_template, + TP_PROTO(struct mm_struct *swap_token_mm), + + TP_ARGS(swap_token_mm), + + TP_FIELDS( + ctf_integer_hex(struct mm_struct*, swap_token_mm, swap_token_mm) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template, put_swap_token, + + mm_vmscan_put_swap_token, + + TP_PROTO(struct mm_struct *swap_token_mm), + TP_ARGS(swap_token_mm) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template, disable_swap_token, + + mm_vmscan_disable_swap_token, + + TP_PROTO(struct mm_struct *swap_token_mm), + TP_ARGS(swap_token_mm) +) + +LTTNG_TRACEPOINT_EVENT_MAP(update_swap_token_priority, + + mm_vmscan_update_swap_token_priority, + + TP_PROTO(struct mm_struct *mm, + unsigned int old_prio, + struct mm_struct *swap_token_mm), + + TP_ARGS(mm, old_prio, swap_token_mm), + + TP_FIELDS( + ctf_integer_hex(struct mm_struct *, mm, mm) + ctf_integer(unsigned int, old_prio, old_prio) + ctf_integer(unsigned int, new_prio, mm->token_priority) + ctf_integer_hex(struct mm_struct *, swap_token_mm, swap_token_mm) + ctf_integer(unsigned int, swap_token_prio, swap_token_mm ? swap_token_mm->token_priority : 0) + ) +) +#endif + +#endif /* LTTNG_TRACE_MM_VMSCAN_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/module.h b/include/instrumentation/events/module.h new file mode 100644 index 00000000..5831650b --- /dev/null +++ b/include/instrumentation/events/module.h @@ -0,0 +1,105 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Because linux/module.h has tracepoints in the header, and ftrace.h + * eventually includes this file, define_trace.h includes linux/module.h + * But we do not want the module.h to override the TRACE_SYSTEM macro + * variable that define_trace.h is processing, so we only set it + * when module events are being processed, which would happen when + * CREATE_TRACE_POINTS is defined. + */ +#ifdef CREATE_TRACE_POINTS +#undef TRACE_SYSTEM +#define TRACE_SYSTEM module +#endif + +#if !defined(LTTNG_TRACE_MODULE_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_MODULE_H + +#include +#include + +#ifdef CONFIG_MODULES + +#ifndef _TRACE_MODULE_DEF +#define _TRACE_MODULE_DEF +struct module; + +#endif + +LTTNG_TRACEPOINT_EVENT(module_load, + + TP_PROTO(struct module *mod), + + TP_ARGS(mod), + + TP_FIELDS( + ctf_integer(unsigned int, taints, mod->taints) + ctf_string(name, mod->name) + ) +) + +LTTNG_TRACEPOINT_EVENT(module_free, + + TP_PROTO(struct module *mod), + + TP_ARGS(mod), + + TP_FIELDS( + ctf_string(name, mod->name) + ) +) + +#ifdef CONFIG_MODULE_UNLOAD +/* trace_module_get/put are only used if CONFIG_MODULE_UNLOAD is defined */ + +LTTNG_TRACEPOINT_EVENT_CLASS(module_refcnt, + + TP_PROTO(struct module *mod, unsigned long ip), + + TP_ARGS(mod, ip), + + TP_FIELDS( + ctf_integer_hex(unsigned long, ip, ip) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)) + ctf_integer(int, refcnt, atomic_read(&mod->refcnt)) +#else + ctf_integer(int, refcnt, __this_cpu_read(mod->refptr->incs) + __this_cpu_read(mod->refptr->decs)) +#endif + ctf_string(name, mod->name) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(module_refcnt, module_get, + + TP_PROTO(struct module *mod, unsigned long ip), + + TP_ARGS(mod, ip) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(module_refcnt, module_put, + + TP_PROTO(struct module *mod, unsigned long ip), + + TP_ARGS(mod, ip) +) +#endif /* CONFIG_MODULE_UNLOAD */ + +LTTNG_TRACEPOINT_EVENT(module_request, + + TP_PROTO(char *name, bool wait, unsigned long ip), + + TP_ARGS(name, wait, ip), + + TP_FIELDS( + ctf_integer_hex(unsigned long, ip, ip) + ctf_integer(bool, wait, wait) + ctf_string(name, name) + ) +) + +#endif /* CONFIG_MODULES */ + +#endif /* LTTNG_TRACE_MODULE_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/napi.h b/include/instrumentation/events/napi.h new file mode 100644 index 00000000..8a32993f --- /dev/null +++ b/include/instrumentation/events/napi.h @@ -0,0 +1,51 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM napi + +#if !defined(LTTNG_TRACE_NAPI_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_NAPI_H + +#include +#include +#include + +#define NO_DEV "(no_device)" + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) + +LTTNG_TRACEPOINT_EVENT(napi_poll, + + TP_PROTO(struct napi_struct *napi, int work, int budget), + + TP_ARGS(napi, work, budget), + + TP_FIELDS( + ctf_integer_hex(struct napi_struct *, napi, napi) + ctf_string(dev_name, napi->dev ? napi->dev->name : NO_DEV) + ctf_integer(int, work, work) + ctf_integer(int, budget, budget) + ) +) + +#else + +LTTNG_TRACEPOINT_EVENT(napi_poll, + + TP_PROTO(struct napi_struct *napi), + + TP_ARGS(napi), + + TP_FIELDS( + ctf_integer_hex(struct napi_struct *, napi, napi) + ctf_string(dev_name, napi->dev ? napi->dev->name : NO_DEV) + ) +) + +#endif + +#undef NO_DEV + +#endif /* LTTNG_TRACE_NAPI_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/net.h b/include/instrumentation/events/net.h new file mode 100644 index 00000000..c2d8c67b --- /dev/null +++ b/include/instrumentation/events/net.h @@ -0,0 +1,871 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM net + +#if !defined(LTTNG_TRACE_NET_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_NET_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef ONCE_LTTNG_NET_H +#define ONCE_LTTNG_NET_H + +static inline unsigned char __has_network_hdr(struct sk_buff *skb) +{ + /* + * If the header is not set yet, the network header will point + * to the head. + */ + return skb_network_header(skb) != skb->head; +} + +static struct lttng_event_field emptyfields[] = { +}; + +/* Structures for transport headers. */ + +static struct lttng_event_field tcpfields[] = { + [0] = { + .name = "source_port", + .type = __type_integer(uint16_t, 0, 0, 0, + __BIG_ENDIAN, 10, none), + }, + [1] = { + .name = "dest_port", + .type = __type_integer(uint16_t, 0, 0, 0, + __BIG_ENDIAN, 10, none), + }, + [2] = { + .name = "seq", + .type = __type_integer(uint32_t, 0, 0, 0, + __BIG_ENDIAN, 10, none), + }, + [3] = { + .name = "ack_seq", + .type = __type_integer(uint32_t, 0, 0, 0, + __BIG_ENDIAN, 10, none), + }, + [4] = { + .name = "data_offset", + .type = __type_integer(uint8_t, 4, 4, 0, + __BIG_ENDIAN, 10, none), + }, + [5] = { + .name = "reserved", + .type = __type_integer(uint8_t, 3, 1, 0, + __BIG_ENDIAN, 10, none), + }, + [6] = { + .name = "flags", + .type = __type_integer(uint8_t, 9, 1, 0, + __BIG_ENDIAN, 16, none), + }, + [7] = { + .name = "window_size", + .type = __type_integer(uint16_t, 0, 0, 0, + __BIG_ENDIAN, 10, none), + }, + [8] = { + .name = "checksum", + .type = __type_integer(uint16_t, 0, 0, 0, + __BIG_ENDIAN, 16, none), + }, + [9] = { + .name = "urg_ptr", + .type = __type_integer(uint16_t, 0, 0, 0, + __BIG_ENDIAN, 10, none), + }, +}; + +static struct lttng_event_field udpfields[] = { + [0] = { + .name = "source_port", + .type = __type_integer(uint16_t, 0, 0, 0, + __BIG_ENDIAN, 10, none), + }, + [1] = { + .name = "dest_port", + .type = __type_integer(uint16_t, 0, 0, 0, + __BIG_ENDIAN, 10, none), + }, + [2] = { + .name = "len", + .type = __type_integer(uint16_t, 0, 0, 0, + __BIG_ENDIAN, 10, none), + }, + [3] = { + .name = "check", + .type = __type_integer(uint16_t, 0, 0, 0, + __BIG_ENDIAN, 10, none), + }, +}; + +static struct lttng_event_field icmpfields[] = { + [0] = { + .name = "type", + .type = __type_integer(uint8_t, 0, 0, 0, + __BIG_ENDIAN, 10, none), + }, + [1] = { + .name = "code", + .type = __type_integer(uint8_t, 0, 0, 0, + __BIG_ENDIAN, 10, none), + }, + [2] = { + .name = "checksum", + .type = __type_integer(uint16_t, 0, 0, 0, + __BIG_ENDIAN, 10, none), + }, + [3] = { + .name = "gateway", + .type = __type_integer(uint32_t, 0, 0, 0, + __BIG_ENDIAN, 10, none), + }, +}; + + +static struct lttng_event_field transport_fields[] = { + [0] = { + .name = "unknown", + .type = { + .atype = atype_struct_nestable, + .u.struct_nestable.nr_fields = ARRAY_SIZE(emptyfields), + .u.struct_nestable.fields = emptyfields, + .u.struct_nestable.alignment = 0, + }, + .nofilter = 1, + }, + [1] = { + .name = "tcp", + .type = { + .atype = atype_struct_nestable, + .u.struct_nestable.nr_fields = ARRAY_SIZE(tcpfields), + .u.struct_nestable.fields = tcpfields, + .u.struct_nestable.alignment = 0, + }, + .nofilter = 1, + }, + [2] = { + .name = "udp", + .type = { + .atype = atype_struct_nestable, + .u.struct_nestable.nr_fields = ARRAY_SIZE(udpfields), + .u.struct_nestable.fields = udpfields, + .u.struct_nestable.alignment = 0, + }, + .nofilter = 1, + }, + [3] = { + .name = "icmp", + .type = { + .atype = atype_struct_nestable, + .u.struct_nestable.nr_fields = ARRAY_SIZE(icmpfields), + .u.struct_nestable.fields = icmpfields, + .u.struct_nestable.alignment = 0, + }, + .nofilter = 1, + }, +}; + +enum transport_header_types { + TH_NONE = 0, + TH_TCP = 1, + TH_UDP = 2, + TH_ICMP = 3, +}; + +static inline enum transport_header_types __get_transport_header_type_ip(struct sk_buff *skb) +{ + switch (ip_hdr(skb)->protocol) { + case IPPROTO_TCP: + return TH_TCP; + case IPPROTO_UDP: + return TH_UDP; + case IPPROTO_ICMP: + return TH_ICMP; + } + return TH_NONE; +} + +static inline enum transport_header_types __get_transport_header_type_ipv6(struct sk_buff *skb) +{ + switch (ipv6_hdr(skb)->nexthdr) { + case IPPROTO_TCP: + return TH_TCP; + case IPPROTO_UDP: + return TH_UDP; + case IPPROTO_ICMP: + return TH_ICMP; + } + return TH_NONE; +} + +static inline enum transport_header_types __get_transport_header_type(struct sk_buff *skb) +{ + if (__has_network_hdr(skb)) { + /* + * When both transport and network headers are set, + * transport header is greater than network header, + * otherwise it points to head. + */ + if (skb->transport_header > skb->network_header) { + /* + * Get the transport protocol from the network + * header's data. This method works both for + * sent and received packets. + */ + if (skb->protocol == htons(ETH_P_IP)) { + return __get_transport_header_type_ip(skb); + } else if(skb->protocol == htons(ETH_P_IPV6)) { + return __get_transport_header_type_ipv6(skb); + } + } + /* Fallthrough for other cases where header is not recognized. */ + } + return TH_NONE; +} + +static struct lttng_enum_entry proto_transport_enum_entries[] = { + [0] = { + .start = { .value = 0, .signedness = 0, }, + .end = { .value = IPPROTO_ICMP - 1, .signedness = 0, }, + .string = "_unknown", + }, + [1] = { + .start = { .value = IPPROTO_ICMP, .signedness = 0, }, + .end = { .value = IPPROTO_ICMP, .signedness = 0, }, + .string = "_icmp", + }, + [2] = { + .start = { .value = IPPROTO_ICMP + 1, .signedness = 0, }, + .end = { .value = IPPROTO_TCP - 1, .signedness = 0, }, + .string = "_unknown", + }, + [3] = { + .start = { .value = IPPROTO_TCP, .signedness = 0, }, + .end = { .value = IPPROTO_TCP, .signedness = 0, }, + .string = "_tcp", + }, + [4] = { + .start = { .value = IPPROTO_TCP + 1, .signedness = 0, }, + .end = { .value = IPPROTO_UDP - 1, .signedness = 0, }, + .string = "_unknown", + }, + [5] = { + .start = { .value = IPPROTO_UDP, .signedness = 0, }, + .end = { .value = IPPROTO_UDP, .signedness = 0, }, + .string = "_udp", + }, + [6] = { + .start = { .value = IPPROTO_UDP + 1, .signedness = 0, }, + .end = { .value = 255, .signedness = 0, }, + .string = "_unknown", + }, +}; + +static const struct lttng_enum_desc proto_transport_header_type = { + .name = "proto_transport_header_type", + .entries = proto_transport_enum_entries, + .nr_entries = ARRAY_SIZE(proto_transport_enum_entries), +}; + +static struct lttng_enum_entry transport_enum_entries[] = { + [0] = { + .start = { .value = TH_NONE, .signedness = 0, }, + .end = { .value = TH_NONE, .signedness = 0, }, + .string = "_unknown", + }, + [1] = { + .start = { .value = TH_TCP, .signedness = 0, }, + .end = { .value = TH_TCP, .signedness = 0, }, + .string = "_tcp", + }, + [2] = { + .start = { .value = TH_UDP, .signedness = 0, }, + .end = { .value = TH_UDP, .signedness = 0, }, + .string = "_udp", + }, + [3] = { + .start = { .value = TH_ICMP, .signedness = 0, }, + .end = { .value = TH_ICMP, .signedness = 0, }, + .string = "_icmp", + }, +}; + +static const struct lttng_enum_desc transport_header_type = { + .name = "transport_header_type", + .entries = transport_enum_entries, + .nr_entries = ARRAY_SIZE(transport_enum_entries), +}; + +/* Structures for network headers. */ + +static struct lttng_event_field ipv4fields[] = { + [0] = { + .name = "version", + .type = __type_integer(uint8_t, 4, 4, 0, + __BIG_ENDIAN, 10, none), + }, + [1] = { + .name = "ihl", + .type = __type_integer(uint8_t, 4, 4, 0, + __BIG_ENDIAN, 10, none), + }, + [2] = { + .name = "tos", + .type = __type_integer(uint8_t, 0, 0, 0, + __BIG_ENDIAN, 10, none), + }, + [3] = { + .name = "tot_len", + .type = __type_integer(uint16_t, 0, 0, 0, + __BIG_ENDIAN, 10, none), + }, + [4] = { + .name = "id", + .type = __type_integer(uint16_t, 0, 0, 0, + __BIG_ENDIAN, 16, none), + }, + [5] = { + .name = "frag_off", + .type = __type_integer(uint16_t, 0, 0, 0, + __BIG_ENDIAN, 10, none), + }, + [6] = { + .name = "ttl", + .type = __type_integer(uint8_t, 0, 0, 0, + __BIG_ENDIAN, 10, none), + }, + [7] = { + .name = "protocol", + .type = { + .atype = atype_enum_nestable, + .u.enum_nestable.desc = + &proto_transport_header_type, + .u.enum_nestable.container_type = + __LTTNG_COMPOUND_LITERAL(struct lttng_type, + __type_integer(uint8_t, 0, 0, -1, + __BIG_ENDIAN, 10, none)), + }, + }, + [8] = { + .name = "checksum", + .type = __type_integer(uint16_t, 0, 0, 0, + __BIG_ENDIAN, 16, none), + }, + [9] = { + .name = "saddr", + .type = { + .atype = atype_array_nestable, + .u.array_nestable.elem_type = + __LTTNG_COMPOUND_LITERAL(struct lttng_type, + __type_integer(uint8_t, 0, 0, 0, + __BIG_ENDIAN, 10, none)), + .u.array_nestable.length = 4, + .u.array_nestable.alignment = lttng_alignof(uint8_t), + }, + }, + [10] = { + .name = "daddr", + .type = { + .atype = atype_array_nestable, + .u.array_nestable.elem_type = + __LTTNG_COMPOUND_LITERAL(struct lttng_type, + __type_integer(uint8_t, 0, 0, 0, + __BIG_ENDIAN, 10, none)), + .u.array_nestable.length = 4, + .u.array_nestable.alignment = lttng_alignof(uint8_t), + }, + }, + [11] = { + .name = "transport_header_type", + .type = { + .atype = atype_enum_nestable, + .u.enum_nestable.desc = &transport_header_type, + .u.enum_nestable.container_type = + __LTTNG_COMPOUND_LITERAL(struct lttng_type, + __type_integer(uint8_t, 0, 0, -1, + __BYTE_ORDER, 10, none)), + }, + }, + [12] = { + .name = "transport_header", + .type = { + .atype = atype_variant_nestable, + .u.variant_nestable.tag_name = "transport_header_type", + .u.variant_nestable.choices = transport_fields, + .u.variant_nestable.nr_choices = ARRAY_SIZE(transport_fields), + .u.variant_nestable.alignment = 0, + }, + }, +}; + +static struct lttng_event_field ipv6fields[] = { + [0] = { + .name = "version", + .type = __type_integer(uint8_t, 4, 4, 0, + __BIG_ENDIAN, 10, none), + }, + [1] = { + .name = "prio", + .type = __type_integer(uint8_t, 4, 4, 0, + __BIG_ENDIAN, 10, none), + }, + [2] = { + .name = "flow_lbl", + .type = { + .atype = atype_array_nestable, + .u.array_nestable.elem_type = + __LTTNG_COMPOUND_LITERAL(struct lttng_type, + __type_integer(uint8_t, 0, 0, 0, + __BIG_ENDIAN, 16, none)), + .u.array_nestable.length = 3, + .u.array_nestable.alignment = lttng_alignof(uint8_t), + }, + }, + [3] = { + .name = "payload_len", + .type = __type_integer(uint16_t, 0, 0, 0, + __BIG_ENDIAN, 10, none), + }, + [4] = { + .name = "nexthdr", + .type = { + .atype = atype_enum_nestable, + .u.enum_nestable.desc = + &proto_transport_header_type, + .u.enum_nestable.container_type = + __LTTNG_COMPOUND_LITERAL(struct lttng_type, + __type_integer(uint8_t, 0, 0, -1, + __BIG_ENDIAN, 10, none)), + }, + }, + [5] = { + .name = "hop_limit", + .type = __type_integer(uint8_t, 0, 0, 0, + __BIG_ENDIAN, 10, none), + }, + [6] = { + .name = "saddr", + .type = { + .atype = atype_array_nestable, + .u.array_nestable.elem_type = + __LTTNG_COMPOUND_LITERAL(struct lttng_type, + __type_integer(uint16_t, 0, 0, 0, + __BIG_ENDIAN, 16, none)), + .u.array_nestable.length = 8, + .u.array_nestable.alignment = lttng_alignof(uint16_t), + }, + }, + [7] = { + .name = "daddr", + .type = { + .atype = atype_array_nestable, + .u.array_nestable.elem_type = + __LTTNG_COMPOUND_LITERAL(struct lttng_type, + __type_integer(uint16_t, 0, 0, 0, + __BIG_ENDIAN, 16, none)), + .u.array_nestable.length = 8, + .u.array_nestable.alignment = lttng_alignof(uint16_t), + }, + }, + [8] = { + .name = "transport_header_type", + .type = { + .atype = atype_enum_nestable, + .u.enum_nestable.desc = &transport_header_type, + .u.enum_nestable.container_type = + __LTTNG_COMPOUND_LITERAL(struct lttng_type, + __type_integer(uint8_t, 0, 0, -1, + __BYTE_ORDER, 10, none)), + }, + }, + [9] = { + .name = "transport_header", + .type = { + .atype = atype_variant_nestable, + .u.variant_nestable.tag_name = "transport_header_type", + .u.variant_nestable.choices = transport_fields, + .u.variant_nestable.nr_choices = ARRAY_SIZE(transport_fields), + .u.variant_nestable.alignment = 0, + }, + }, +}; + +static struct lttng_event_field network_fields[] = { + [0] = { + .name = "unknown", + .type = { + .atype = atype_struct_nestable, + .u.struct_nestable.nr_fields = 0, + .u.struct_nestable.fields = emptyfields, + .u.struct_nestable.alignment = 0, + }, + }, + [1] = { + .name = "ipv4", + .type = { + .atype = atype_struct_nestable, + .u.struct_nestable.nr_fields = ARRAY_SIZE(ipv4fields), + .u.struct_nestable.fields = ipv4fields, + .u.struct_nestable.alignment = 0, + }, + }, + [2] = { + .name = "ipv6", + .type = { + .atype = atype_struct_nestable, + .u.struct_nestable.nr_fields = ARRAY_SIZE(ipv6fields), + .u.struct_nestable.fields = ipv6fields, + .u.struct_nestable.alignment = 0, + }, + }, +}; + +enum network_header_types { + NH_NONE, + NH_IPV4, + NH_IPV6, +}; + +static inline unsigned char __get_network_header_type(struct sk_buff *skb) +{ + if (__has_network_hdr(skb)) { + if (skb->protocol == htons(ETH_P_IPV6)) + return NH_IPV6; + else if (skb->protocol == htons(ETH_P_IP)) + return NH_IPV4; + /* Fallthrough for other header types. */ + } + return NH_NONE; +} + +#endif + +LTTNG_TRACEPOINT_ENUM(net_network_header, + TP_ENUM_VALUES( + ctf_enum_value("_unknown", NH_NONE) + ctf_enum_value("_ipv4", NH_IPV4) + ctf_enum_value("_ipv6", NH_IPV6) + ) +) + +LTTNG_TRACEPOINT_EVENT(net_dev_xmit, + + TP_PROTO(struct sk_buff *skb, + int rc, + struct net_device *dev, + unsigned int skb_len), + + TP_ARGS(skb, rc, dev, skb_len), + + TP_FIELDS( + ctf_integer_hex(void *, skbaddr, skb) + ctf_integer(int, rc, rc) + ctf_integer(unsigned int, len, skb_len) + ctf_string(name, dev->name) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(net_dev_template, + + TP_PROTO(struct sk_buff *skb), + + TP_ARGS(skb), + + TP_FIELDS( + ctf_integer_hex(void *, skbaddr, skb) + ctf_integer(unsigned int, len, skb->len) + ctf_string(name, skb->dev->name) + ctf_enum(net_network_header, unsigned char, + network_header_type, __get_network_header_type(skb)) + ctf_custom_field( + ctf_custom_type( + { + .atype = atype_variant_nestable, + .u.variant_nestable.tag_name = "network_header_type", + .u.variant_nestable.choices = network_fields, + .u.variant_nestable.nr_choices = + ARRAY_SIZE(network_fields), + .u.variant_nestable.alignment = 0, + } + ), + network_header, + ctf_custom_code( + bool has_network_header = false; + + /* Copy the network header. */ + switch (__get_network_header_type(skb)) { + case NH_IPV4: { + ctf_align(uint16_t) + ctf_array_type(uint8_t, ip_hdr(skb), + sizeof(struct iphdr)) + has_network_header = true; + break; + } + case NH_IPV6: { + ctf_align(uint16_t) + ctf_array_type(uint8_t, ipv6_hdr(skb), + sizeof(struct ipv6hdr)) + has_network_header = true; + break; + } + default: + /* + * For any other network header + * type, there is nothing to do. + */ + break; + } + + if (has_network_header) { + enum transport_header_types th_type = + __get_transport_header_type(skb); + + /* Transport header type field. */ + ctf_integer_type(unsigned char, th_type) + + /* Copy the transport header. */ + switch (th_type) { + case TH_TCP: { + ctf_align(uint32_t) + ctf_array_type(uint8_t, tcp_hdr(skb), + sizeof(struct tcphdr)) + break; + } + case TH_UDP: { + ctf_align(uint32_t) + ctf_array_type(uint8_t, udp_hdr(skb), + sizeof(struct udphdr)) + break; + } + case TH_ICMP: { + ctf_align(uint32_t) + ctf_array_type(uint8_t, icmp_hdr(skb), + sizeof(struct icmphdr)) + break; + } + default: + /* + * For any other transport header type, + * there is nothing to do. + */ + break; + } + } + ) + ) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(net_dev_template, net_dev_queue, + + TP_PROTO(struct sk_buff *skb), + + TP_ARGS(skb) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_template, + + netif_receive_skb, + + net_if_receive_skb, + + TP_PROTO(struct sk_buff *skb), + + TP_ARGS(skb) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_template, + + netif_rx, + + net_if_rx, + + TP_PROTO(struct sk_buff *skb), + + TP_ARGS(skb) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + +/* Trace events for the receive entry points */ +LTTNG_TRACEPOINT_EVENT_CLASS(net_dev_receive_entry_template, + + TP_PROTO(const struct sk_buff *skb), + + TP_ARGS(skb), + + TP_FIELDS( + ctf_integer_hex(const void *, skbaddr, skb) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_entry_template, + + napi_gro_frags_entry, + + net_napi_gro_frags_entry, + + TP_PROTO(const struct sk_buff *skb), + + TP_ARGS(skb) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_entry_template, + + napi_gro_receive_entry, + + net_napi_gro_receive_entry, + + TP_PROTO(const struct sk_buff *skb), + + TP_ARGS(skb) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_entry_template, + + netif_receive_skb_entry, + + net_if_receive_skb_entry, + + TP_PROTO(const struct sk_buff *skb), + + TP_ARGS(skb) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_entry_template, + + netif_rx_entry, + + net_if_rx_entry, + + TP_PROTO(const struct sk_buff *skb), + + TP_ARGS(skb) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_entry_template, + + netif_rx_ni_entry, + + net_if_rx_ni_entry, + + TP_PROTO(const struct sk_buff *skb), + + TP_ARGS(skb) +) + +#endif /* kernel > 3.14 */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_entry_template, + + netif_receive_skb_list_entry, + + net_if_receive_skb_list_entry, + + TP_PROTO(const struct sk_buff *skb), + + TP_ARGS(skb) +) + +#endif /* kernel > 4.19 */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)) + +/* Trace events for the receive exit points */ +LTTNG_TRACEPOINT_EVENT_CLASS(net_dev_receive_exit_template, + + TP_PROTO(int ret), + + TP_ARGS(ret), + + TP_FIELDS( + ctf_integer(int, ret, ret) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_exit_template, + + napi_gro_frags_exit, + + net_napi_gro_frags_exit, + + TP_PROTO(int ret), + + TP_ARGS(ret) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_exit_template, + + napi_gro_receive_exit, + + net_napi_gro_receive_exit, + + TP_PROTO(int ret), + + TP_ARGS(ret) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_exit_template, + + netif_receive_skb_exit, + + net_if_receive_skb_exit, + + TP_PROTO(int ret), + + TP_ARGS(ret) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_exit_template, + + netif_rx_exit, + + net_if_rx_exit, + + TP_PROTO(int ret), + + TP_ARGS(ret) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_exit_template, + + netif_rx_ni_exit, + + net_if_rx_ni_exit, + + TP_PROTO(int ret), + + TP_ARGS(ret) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(net_dev_receive_exit_template, + + netif_receive_skb_list_exit, + + net_if_receive_skb_list_exit, + + TP_PROTO(int ret), + + TP_ARGS(ret) +) + +#endif /* kernel > 5.0.0 */ + +#endif /* LTTNG_TRACE_NET_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/power.h b/include/instrumentation/events/power.h new file mode 100644 index 00000000..dd03d60a --- /dev/null +++ b/include/instrumentation/events/power.h @@ -0,0 +1,242 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM power + +#if !defined(LTTNG_TRACE_POWER_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_POWER_H + +#include +#include +#include + +LTTNG_TRACEPOINT_EVENT_CLASS(power_cpu, + + TP_PROTO(unsigned int state, unsigned int cpu_id), + + TP_ARGS(state, cpu_id), + + TP_FIELDS( + ctf_integer(u32, state, state) + ctf_integer(u32, cpu_id, cpu_id) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(power_cpu, cpu_idle, + + power_cpu_idle, + + TP_PROTO(unsigned int state, unsigned int cpu_id), + + TP_ARGS(state, cpu_id) +) + +/* This file can get included multiple times, TRACE_HEADER_MULTI_READ at top */ +#ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING +#define _PWR_EVENT_AVOID_DOUBLE_DEFINING + +#define PWR_EVENT_EXIT -1 +#endif + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(power_cpu, cpu_frequency, + + power_cpu_frequency, + + TP_PROTO(unsigned int frequency, unsigned int cpu_id), + + TP_ARGS(frequency, cpu_id) +) + +LTTNG_TRACEPOINT_EVENT_MAP(machine_suspend, + + power_machine_suspend, + + TP_PROTO(unsigned int state), + + TP_ARGS(state), + + TP_FIELDS( + ctf_integer(u32, state, state) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(power_wakeup_source, + + TP_PROTO(const char *name, unsigned int state), + + TP_ARGS(name, state), + + TP_FIELDS( + ctf_string(name, name) + ctf_integer(u64, state, state) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(power_wakeup_source, wakeup_source_activate, + + power_wakeup_source_activate, + + TP_PROTO(const char *name, unsigned int state), + + TP_ARGS(name, state) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(power_wakeup_source, wakeup_source_deactivate, + + power_wakeup_source_deactivate, + + TP_PROTO(const char *name, unsigned int state), + + TP_ARGS(name, state) +) +#endif + +#ifdef CONFIG_EVENT_POWER_TRACING_DEPRECATED + +/* + * The power events are used for cpuidle & suspend (power_start, power_end) + * and for cpufreq (power_frequency) + */ +LTTNG_TRACEPOINT_EVENT_CLASS(power, + + TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), + + TP_ARGS(type, state, cpu_id), + + TP_FIELDS( + ctf_integer(u64, type, type) + ctf_integer(u64, state, state) + ctf_integer(u64, cpu_id, cpu_id) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(power, power_start, + + TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), + + TP_ARGS(type, state, cpu_id) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(power, power_frequency, + + TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), + + TP_ARGS(type, state, cpu_id) +) + +LTTNG_TRACEPOINT_EVENT(power_end, + + TP_PROTO(unsigned int cpu_id), + + TP_ARGS(cpu_id), + + TP_FIELDS( + ctf_integer(u64, cpu_id, cpu_id) + ) +) + +/* Deprecated dummy functions must be protected against multi-declartion */ +#ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED +#define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED + +enum { + POWER_NONE = 0, + POWER_CSTATE = 1, + POWER_PSTATE = 2, +}; +#endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */ + +#else /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */ + +#ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED +#define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED +enum { + POWER_NONE = 0, + POWER_CSTATE = 1, + POWER_PSTATE = 2, +}; + +/* These dummy declaration have to be ripped out when the deprecated + events get removed */ +static inline void trace_power_start(u64 type, u64 state, u64 cpuid) {}; +static inline void trace_power_end(u64 cpuid) {}; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) +static inline void trace_power_start_rcuidle(u64 type, u64 state, u64 cpuid) {}; +static inline void trace_power_end_rcuidle(u64 cpuid) {}; +#endif +static inline void trace_power_frequency(u64 type, u64 state, u64 cpuid) {}; +#endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */ + +#endif /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */ + +/* + * The clock events are used for clock enable/disable and for + * clock rate change + */ +LTTNG_TRACEPOINT_EVENT_CLASS(power_clock, + + TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), + + TP_ARGS(name, state, cpu_id), + + TP_FIELDS( + ctf_string(name, name) + ctf_integer(u64, state, state) + ctf_integer(u64, cpu_id, cpu_id) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(power_clock, clock_enable, + + power_clock_enable, + + TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), + + TP_ARGS(name, state, cpu_id) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(power_clock, clock_disable, + + power_clock_disable, + + TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), + + TP_ARGS(name, state, cpu_id) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(power_clock, clock_set_rate, + + power_clock_set_rate, + + TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), + + TP_ARGS(name, state, cpu_id) +) + +/* + * The power domain events are used for power domains transitions + */ +LTTNG_TRACEPOINT_EVENT_CLASS(power_domain, + + TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), + + TP_ARGS(name, state, cpu_id), + + TP_FIELDS( + ctf_string(name, name) + ctf_integer(u64, state, state) + ctf_integer(u64, cpu_id, cpu_id) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(power_domain, power_domain_target, + + TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id), + + TP_ARGS(name, state, cpu_id) +) + +#endif /* LTTNG_TRACE_POWER_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/preemptirq.h b/include/instrumentation/events/preemptirq.h new file mode 100644 index 00000000..36aa36cb --- /dev/null +++ b/include/instrumentation/events/preemptirq.h @@ -0,0 +1,100 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifdef CONFIG_PREEMPTIRQ_EVENTS + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM preemptirq + +#if !defined(LTTNG_TRACE_PREEMPTIRQ_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_PREEMPTIRQ_H + +#include +#include +#include +#include + +/* + * The preemptirq probe is built when CONFIG_PREEMPTIRQ_EVENTS is defined. + */ + +LTTNG_TRACEPOINT_EVENT_CLASS(preemptirq_template, + + TP_PROTO(unsigned long ip, unsigned long parent_ip), + + TP_ARGS(ip, parent_ip), + + TP_FIELDS( + ctf_integer_hex(unsigned long, caller, ip) + ctf_integer_hex(unsigned long, parent, parent_ip) + ) +) + +/* + * Tracing of irq enable / disable events is enabled + * on >= 4.19 when CONFIG_TRACE_IRQFLAGS is defined. + * on previous kernels when CONFIG_PROVE_LOCKING is NOT defined. + */ +#if defined(CONFIG_TRACE_IRQFLAGS) +#define LTTNG_TRACE_IRQ +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(4,19,0) && \ + !defined(CONFIG_PROVE_LOCKING)) +#define LTTNG_TRACE_IRQ +#endif + +#ifdef LTTNG_TRACE_IRQ +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(preemptirq_template, irq_disable, + + preemptirq_irq_disable, + + TP_PROTO(unsigned long ip, unsigned long parent_ip), + + TP_ARGS(ip, parent_ip) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(preemptirq_template, irq_enable, + + preemptirq_irq_enable, + + TP_PROTO(unsigned long ip, unsigned long parent_ip), + + TP_ARGS(ip, parent_ip) +) +#endif /* LTTNG_TRACE_IRQ */ + +/* + * Tracing of preempt enable / disable events is enabled + * on >= 4.19 when CONFIG_TRACE_PREEMPT_TOGGLE is defined. + * on previous kernels when CONFIG_DEBUG_PREEMPT is defined. + */ +#if defined(CONFIG_TRACE_PREEMPT_TOGGLE) +#define LTTNG_TRACE_PREEMPT +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(4,19,0) && \ + defined(CONFIG_DEBUG_PREEMPT)) +#define LTTNG_TRACE_PREEMPT +#endif + +#ifdef LTTNG_TRACE_PREEMPT +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(preemptirq_template, preempt_disable, + + preemptirq_preempt_disable, + + TP_PROTO(unsigned long ip, unsigned long parent_ip), + + TP_ARGS(ip, parent_ip) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(preemptirq_template, preempt_enable, + + preemptirq_preempt_enable, + + TP_PROTO(unsigned long ip, unsigned long parent_ip), + + TP_ARGS(ip, parent_ip) +) +#endif /* LTTNG_TRACE_PREEMPT */ + +#endif /* LTTNG_TRACE_PREEMPTIRQ_H */ + +/* This part must be outside protection */ +#include + +#endif /* CONFIG_PREEMPTIRQ_EVENTS */ diff --git a/include/instrumentation/events/printk.h b/include/instrumentation/events/printk.h new file mode 100644 index 00000000..75b4ee92 --- /dev/null +++ b/include/instrumentation/events/printk.h @@ -0,0 +1,76 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM printk + +#if !defined(LTTNG_TRACE_PRINTK_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_PRINTK_H + +#include +#include + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)) + +LTTNG_TRACEPOINT_EVENT_MAP(console, + + printk_console, + + TP_PROTO(const char *text, size_t len), + + TP_ARGS(text, len), + + TP_FIELDS( + ctf_sequence_text(char, msg, text, size_t, len) + ) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + +LTTNG_TRACEPOINT_EVENT_MAP(console, + + printk_console, + + TP_PROTO(const char *log_buf, unsigned start, unsigned end, + unsigned log_buf_len), + + TP_ARGS(log_buf, start, end, log_buf_len), + + TP_FIELDS( + ctf_sequence_text(char, msg, log_buf + start, + size_t, end - start) + ) +) + +#else /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) */ + +LTTNG_TRACEPOINT_EVENT_MAP(console, + + printk_console, + + TP_PROTO(const char *log_buf, unsigned start, unsigned end, + unsigned log_buf_len), + + TP_ARGS(log_buf, start, end, log_buf_len), + + TP_FIELDS( + /* + * printk buffer is gathered from two segments on older kernels. + */ + ctf_sequence_text(char, msg1, + log_buf + (start & (log_buf_len - 1)), + size_t, (start & (log_buf_len - 1)) > (end & (log_buf_len - 1)) + ? log_buf_len - (start & (log_buf_len - 1)) + : end - start) + ctf_sequence_text(char, msg2, + log_buf, + size_t, (start & (log_buf_len - 1)) > (end & (log_buf_len - 1)) + ? end & (log_buf_len - 1) + : 0) + ) +) + +#endif + +#endif /* LTTNG_TRACE_PRINTK_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/random.h b/include/instrumentation/events/random.h new file mode 100644 index 00000000..7cf0908f --- /dev/null +++ b/include/instrumentation/events/random.h @@ -0,0 +1,132 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM random + +#if !defined(LTTNG_TRACE_RANDOM_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_RANDOM_H + +#include +#include + +LTTNG_TRACEPOINT_EVENT_CLASS(random__mix_pool_bytes, + TP_PROTO(const char *pool_name, int bytes, unsigned long IP), + + TP_ARGS(pool_name, bytes, IP), + + TP_FIELDS( + ctf_string(pool_name, pool_name) + ctf_integer(int, bytes, bytes) + ctf_integer_hex(unsigned long, IP, IP) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(random__mix_pool_bytes, mix_pool_bytes, + + random_mix_pool_bytes, + + TP_PROTO(const char *pool_name, int bytes, unsigned long IP), + + TP_ARGS(pool_name, bytes, IP) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(random__mix_pool_bytes, mix_pool_bytes_nolock, + + random_mix_pool_bytes_nolock, + + TP_PROTO(const char *pool_name, int bytes, unsigned long IP), + + TP_ARGS(pool_name, bytes, IP) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)) +LTTNG_TRACEPOINT_EVENT_MAP(credit_entropy_bits, + + random_credit_entropy_bits, + + TP_PROTO(const char *pool_name, int bits, int entropy_count, + unsigned long IP), + + TP_ARGS(pool_name, bits, entropy_count, IP), + + TP_FIELDS( + ctf_string(pool_name, pool_name) + ctf_integer(int, bits, bits) + ctf_integer(int, entropy_count, entropy_count) + ctf_integer_hex(unsigned long, IP, IP) + ) +) +#else +LTTNG_TRACEPOINT_EVENT_MAP(credit_entropy_bits, + + random_credit_entropy_bits, + + TP_PROTO(const char *pool_name, int bits, int entropy_count, + int entropy_total, unsigned long IP), + + TP_ARGS(pool_name, bits, entropy_count, entropy_total, IP), + + TP_FIELDS( + ctf_string(pool_name, pool_name) + ctf_integer(int, bits, bits) + ctf_integer(int, entropy_count, entropy_count) + ctf_integer(int, entropy_total, entropy_total) + ctf_integer_hex(unsigned long, IP, IP) + ) +) +#endif + +LTTNG_TRACEPOINT_EVENT_MAP(get_random_bytes, + + random_get_random_bytes, + + TP_PROTO(int nbytes, unsigned long IP), + + TP_ARGS(nbytes, IP), + + TP_FIELDS( + ctf_integer(int, nbytes, nbytes) + ctf_integer_hex(unsigned long, IP, IP) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(random__extract_entropy, + TP_PROTO(const char *pool_name, int nbytes, int entropy_count, + unsigned long IP), + + TP_ARGS(pool_name, nbytes, entropy_count, IP), + + TP_FIELDS( + ctf_string(pool_name, pool_name) + ctf_integer(int, nbytes, nbytes) + ctf_integer(int, entropy_count, entropy_count) + ctf_integer_hex(unsigned long, IP, IP) + ) +) + + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(random__extract_entropy, extract_entropy, + + random_extract_entropy, + + TP_PROTO(const char *pool_name, int nbytes, int entropy_count, + unsigned long IP), + + TP_ARGS(pool_name, nbytes, entropy_count, IP) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(random__extract_entropy, extract_entropy_user, + + random_extract_entropy_user, + + TP_PROTO(const char *pool_name, int nbytes, int entropy_count, + unsigned long IP), + + TP_ARGS(pool_name, nbytes, entropy_count, IP) +) + + + +#endif /* LTTNG_TRACE_RANDOM_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/rcu.h b/include/instrumentation/events/rcu.h new file mode 100644 index 00000000..9c7a6de1 --- /dev/null +++ b/include/instrumentation/events/rcu.h @@ -0,0 +1,964 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM rcu + +#if !defined(LTTNG_TRACE_RCU_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_RCU_H + +#include +#include + +/* + * Tracepoint for start/end markers used for utilization calculations. + * By convention, the string is of the following forms: + * + * "Start " -- Mark the start of the specified activity, + * such as "context switch". Nesting is permitted. + * "End " -- Mark the end of the specified activity. + * + * An "@" character within "" is a comment character: Data + * reduction scripts will ignore the "@" and the remainder of the line. + */ +LTTNG_TRACEPOINT_EVENT(rcu_utilization, + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) + TP_PROTO(const char *s), +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ + TP_PROTO(char *s), +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ + + TP_ARGS(s), + + TP_FIELDS( + ctf_string(s, s) + ) +) + +#ifdef CONFIG_RCU_TRACE + +#if defined(CONFIG_TREE_RCU) \ + || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) \ + && defined(CONFIG_PREEMPT_RCU)) \ + || defined(CONFIG_TREE_PREEMPT_RCU) + +/* + * Tracepoint for grace-period events: starting and ending a grace + * period ("start" and "end", respectively), a CPU noting the start + * of a new grace period or the end of an old grace period ("cpustart" + * and "cpuend", respectively), a CPU passing through a quiescent + * state ("cpuqs"), a CPU coming online or going offline ("cpuonl" + * and "cpuofl", respectively), and a CPU being kicked for being too + * long in dyntick-idle mode ("kick"). + */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \ + LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0)) +LTTNG_TRACEPOINT_EVENT(rcu_grace_period, + + TP_PROTO(const char *rcuname, unsigned long gp_seq, const char *gpevent), + + TP_ARGS(rcuname, gp_seq, gpevent), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer(unsigned long, gp_seq, gp_seq) + ctf_string(gpevent, gpevent) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) +LTTNG_TRACEPOINT_EVENT(rcu_grace_period, + + TP_PROTO(const char *rcuname, unsigned long gpnum, const char *gpevent), + + TP_ARGS(rcuname, gpnum, gpevent), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer(unsigned long, gpnum, gpnum) + ctf_string(gpevent, gpevent) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(rcu_grace_period, + + TP_PROTO(char *rcuname, unsigned long gpnum, char *gpevent), + + TP_ARGS(rcuname, gpnum, gpevent), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer(unsigned long, gpnum, gpnum) + ctf_string(gpevent, gpevent) + ) +) +#endif + +/* + * Tracepoint for grace-period-initialization events. These are + * distinguished by the type of RCU, the new grace-period number, the + * rcu_node structure level, the starting and ending CPU covered by the + * rcu_node structure, and the mask of CPUs that will be waited for. + * All but the type of RCU are extracted from the rcu_node structure. + */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \ + LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0)) +LTTNG_TRACEPOINT_EVENT(rcu_grace_period_init, + + TP_PROTO(const char *rcuname, unsigned long gp_seq, u8 level, + int grplo, int grphi, unsigned long qsmask), + + TP_ARGS(rcuname, gp_seq, level, grplo, grphi, qsmask), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer(unsigned long, gp_seq, gp_seq) + ctf_integer(u8, level, level) + ctf_integer(int, grplo, grplo) + ctf_integer(int, grphi, grphi) + ctf_integer(unsigned long, qsmask, qsmask) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) +LTTNG_TRACEPOINT_EVENT(rcu_grace_period_init, + + TP_PROTO(const char *rcuname, unsigned long gpnum, u8 level, + int grplo, int grphi, unsigned long qsmask), + + TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer(unsigned long, gpnum, gpnum) + ctf_integer(u8, level, level) + ctf_integer(int, grplo, grplo) + ctf_integer(int, grphi, grphi) + ctf_integer(unsigned long, qsmask, qsmask) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(rcu_grace_period_init, + + TP_PROTO(char *rcuname, unsigned long gpnum, u8 level, + int grplo, int grphi, unsigned long qsmask), + + TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer(unsigned long, gpnum, gpnum) + ctf_integer(u8, level, level) + ctf_integer(int, grplo, grplo) + ctf_integer(int, grphi, grphi) + ctf_integer(unsigned long, qsmask, qsmask) + ) +) +#endif + +/* + * Tracepoint for tasks blocking within preemptible-RCU read-side + * critical sections. Track the type of RCU (which one day might + * include SRCU), the grace-period number that the task is blocking + * (the current or the next), and the task's PID. + */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \ + LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0)) +LTTNG_TRACEPOINT_EVENT(rcu_preempt_task, + + TP_PROTO(const char *rcuname, int pid, unsigned long gp_seq), + + TP_ARGS(rcuname, pid, gp_seq), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer(unsigned long, gp_seq, gp_seq) + ctf_integer(int, pid, pid) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) +LTTNG_TRACEPOINT_EVENT(rcu_preempt_task, + + TP_PROTO(const char *rcuname, int pid, unsigned long gpnum), + + TP_ARGS(rcuname, pid, gpnum), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer(unsigned long, gpnum, gpnum) + ctf_integer(int, pid, pid) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(rcu_preempt_task, + + TP_PROTO(char *rcuname, int pid, unsigned long gpnum), + + TP_ARGS(rcuname, pid, gpnum), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer(unsigned long, gpnum, gpnum) + ctf_integer(int, pid, pid) + ) +) +#endif + +/* + * Tracepoint for tasks that blocked within a given preemptible-RCU + * read-side critical section exiting that critical section. Track the + * type of RCU (which one day might include SRCU) and the task's PID. + */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \ + LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0)) +LTTNG_TRACEPOINT_EVENT(rcu_unlock_preempted_task, + + TP_PROTO(const char *rcuname, unsigned long gp_seq, int pid), + + TP_ARGS(rcuname, gp_seq, pid), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer(unsigned long, gp_seq, gp_seq) + ctf_integer(int, pid, pid) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) +LTTNG_TRACEPOINT_EVENT(rcu_unlock_preempted_task, + + TP_PROTO(const char *rcuname, unsigned long gpnum, int pid), + + TP_ARGS(rcuname, gpnum, pid), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer(unsigned long, gpnum, gpnum) + ctf_integer(int, pid, pid) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(rcu_unlock_preempted_task, + + TP_PROTO(char *rcuname, unsigned long gpnum, int pid), + + TP_ARGS(rcuname, gpnum, pid), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer(unsigned long, gpnum, gpnum) + ctf_integer(int, pid, pid) + ) +) +#endif + +/* + * Tracepoint for quiescent-state-reporting events. These are + * distinguished by the type of RCU, the grace-period number, the + * mask of quiescent lower-level entities, the rcu_node structure level, + * the starting and ending CPU covered by the rcu_node structure, and + * whether there are any blocked tasks blocking the current grace period. + * All but the type of RCU are extracted from the rcu_node structure. + */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \ + LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0)) +LTTNG_TRACEPOINT_EVENT(rcu_quiescent_state_report, + + TP_PROTO(const char *rcuname, unsigned long gp_seq, + unsigned long mask, unsigned long qsmask, + u8 level, int grplo, int grphi, int gp_tasks), + + TP_ARGS(rcuname, gp_seq, mask, qsmask, level, grplo, grphi, gp_tasks), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer(unsigned long, gp_seq, gp_seq) + ctf_integer(unsigned long, mask, mask) + ctf_integer(unsigned long, qsmask, qsmask) + ctf_integer(u8, level, level) + ctf_integer(int, grplo, grplo) + ctf_integer(int, grphi, grphi) + ctf_integer(u8, gp_tasks, gp_tasks) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) +LTTNG_TRACEPOINT_EVENT(rcu_quiescent_state_report, + + TP_PROTO(const char *rcuname, unsigned long gpnum, + unsigned long mask, unsigned long qsmask, + u8 level, int grplo, int grphi, int gp_tasks), + + TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer(unsigned long, gpnum, gpnum) + ctf_integer(unsigned long, mask, mask) + ctf_integer(unsigned long, qsmask, qsmask) + ctf_integer(u8, level, level) + ctf_integer(int, grplo, grplo) + ctf_integer(int, grphi, grphi) + ctf_integer(u8, gp_tasks, gp_tasks) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(rcu_quiescent_state_report, + + TP_PROTO(char *rcuname, unsigned long gpnum, + unsigned long mask, unsigned long qsmask, + u8 level, int grplo, int grphi, int gp_tasks), + + TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer(unsigned long, gpnum, gpnum) + ctf_integer(unsigned long, mask, mask) + ctf_integer(unsigned long, qsmask, qsmask) + ctf_integer(u8, level, level) + ctf_integer(int, grplo, grplo) + ctf_integer(int, grphi, grphi) + ctf_integer(u8, gp_tasks, gp_tasks) + ) +) +#endif + +/* + * Tracepoint for quiescent states detected by force_quiescent_state(). + * These trace events include the type of RCU, the grace-period number + * that was blocked by the CPU, the CPU itself, and the type of quiescent + * state, which can be "dti" for dyntick-idle mode, "ofl" for CPU offline, + * or "kick" when kicking a CPU that has been in dyntick-idle mode for + * too long. + */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \ + LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0)) +LTTNG_TRACEPOINT_EVENT(rcu_fqs, + + TP_PROTO(const char *rcuname, unsigned long gp_seq, int cpu, const char *qsevent), + + TP_ARGS(rcuname, gp_seq, cpu, qsevent), + + TP_FIELDS( + ctf_integer(unsigned long, gp_seq, gp_seq) + ctf_integer(int, cpu, cpu) + ctf_string(rcuname, rcuname) + ctf_string(qsevent, qsevent) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) +LTTNG_TRACEPOINT_EVENT(rcu_fqs, + + TP_PROTO(const char *rcuname, unsigned long gpnum, int cpu, const char *qsevent), + + TP_ARGS(rcuname, gpnum, cpu, qsevent), + + TP_FIELDS( + ctf_integer(unsigned long, gpnum, gpnum) + ctf_integer(int, cpu, cpu) + ctf_string(rcuname, rcuname) + ctf_string(qsevent, qsevent) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(rcu_fqs, + + TP_PROTO(char *rcuname, unsigned long gpnum, int cpu, char *qsevent), + + TP_ARGS(rcuname, gpnum, cpu, qsevent), + + TP_FIELDS( + ctf_integer(unsigned long, gpnum, gpnum) + ctf_integer(int, cpu, cpu) + ctf_string(rcuname, rcuname) + ctf_string(qsevent, qsevent) + ) +) +#endif + +#endif /* + * #if defined(CONFIG_TREE_RCU) + * || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) + * && defined(CONFIG_PREEMPT_RCU)) + * || defined(CONFIG_TREE_PREEMPT_RCU) + */ + +/* + * Tracepoint for dyntick-idle entry/exit events. These take a string + * as argument: "Start" for entering dyntick-idle mode, "End" for + * leaving it, "--=" for events moving towards idle, and "++=" for events + * moving away from idle. "Error on entry: not idle task" and "Error on + * exit: not idle task" indicate that a non-idle task is erroneously + * toying with the idle loop. + * + * These events also take a pair of numbers, which indicate the nesting + * depth before and after the event of interest. Note that task-related + * events use the upper bits of each number, while interrupt-related + * events use the lower bits. + */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) \ + || LTTNG_KERNEL_RANGE(5,5,6, 5,6,0) \ + || LTTNG_KERNEL_RANGE(5,4,22, 5,5,0) +LTTNG_TRACEPOINT_EVENT(rcu_dyntick, + + TP_PROTO(const char *polarity, long oldnesting, long newnesting, int dynticks), + + TP_ARGS(polarity, oldnesting, newnesting, dynticks), + + TP_FIELDS( + ctf_string(polarity, polarity) + ctf_integer(long, oldnesting, oldnesting) + ctf_integer(long, newnesting, newnesting) + ctf_integer(int, dynticks, dynticks) + ) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0)) +LTTNG_TRACEPOINT_EVENT(rcu_dyntick, + + TP_PROTO(const char *polarity, long oldnesting, long newnesting, atomic_t dynticks), + + TP_ARGS(polarity, oldnesting, newnesting, dynticks), + + TP_FIELDS( + ctf_string(polarity, polarity) + ctf_integer(long, oldnesting, oldnesting) + ctf_integer(long, newnesting, newnesting) + ctf_integer(int, dynticks, atomic_read(&dynticks)) + ) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) +LTTNG_TRACEPOINT_EVENT(rcu_dyntick, + + TP_PROTO(const char *polarity, long long oldnesting, long long newnesting), + + TP_ARGS(polarity, oldnesting, newnesting), + + TP_FIELDS( + ctf_string(polarity, polarity) + ctf_integer(long long, oldnesting, oldnesting) + ctf_integer(long long, newnesting, newnesting) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) +LTTNG_TRACEPOINT_EVENT(rcu_dyntick, + + TP_PROTO(char *polarity, long long oldnesting, long long newnesting), + + TP_ARGS(polarity, oldnesting, newnesting), + + TP_FIELDS( + ctf_string(polarity, polarity) + ctf_integer(long long, oldnesting, oldnesting) + ctf_integer(long long, newnesting, newnesting) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(rcu_dyntick, + + TP_PROTO(char *polarity), + + TP_ARGS(polarity), + + TP_FIELDS( + ctf_string(polarity, polarity) + ) +) +#endif + + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) +/* + * Tracepoint for RCU preparation for idle, the goal being to get RCU + * processing done so that the current CPU can shut off its scheduling + * clock and enter dyntick-idle mode. One way to accomplish this is + * to drain all RCU callbacks from this CPU, and the other is to have + * done everything RCU requires for the current grace period. In this + * latter case, the CPU will be awakened at the end of the current grace + * period in order to process the remainder of its callbacks. + * + * These tracepoints take a string as argument: + * + * "No callbacks": Nothing to do, no callbacks on this CPU. + * "In holdoff": Nothing to do, holding off after unsuccessful attempt. + * "Begin holdoff": Attempt failed, don't retry until next jiffy. + * "Dyntick with callbacks": Entering dyntick-idle despite callbacks. + * "Dyntick with lazy callbacks": Entering dyntick-idle w/lazy callbacks. + * "More callbacks": Still more callbacks, try again to clear them out. + * "Callbacks drained": All callbacks processed, off to dyntick idle! + * "Timer": Timer fired to cause CPU to continue processing callbacks. + * "Demigrate": Timer fired on wrong CPU, woke up correct CPU. + * "Cleanup after idle": Idle exited, timer canceled. + */ +LTTNG_TRACEPOINT_EVENT(rcu_prep_idle, + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) + TP_PROTO(const char *reason), +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ + TP_PROTO(char *reason), +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ + + TP_ARGS(reason), + + TP_FIELDS( + ctf_string(reason, reason) + ) +) +#endif + +/* + * Tracepoint for the registration of a single RCU callback function. + * The first argument is the type of RCU, the second argument is + * a pointer to the RCU callback itself, the third element is the + * number of lazy callbacks queued, and the fourth element is the + * total number of callbacks queued. + */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) +LTTNG_TRACEPOINT_EVENT(rcu_callback, + + TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen), + + TP_ARGS(rcuname, rhp, qlen), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer_hex(void *, rhp, rhp) + ctf_integer_hex(void *, func, rhp->func) + ctf_integer(long, qlen, qlen) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) +LTTNG_TRACEPOINT_EVENT(rcu_callback, + + TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen_lazy, + long qlen), + + TP_ARGS(rcuname, rhp, qlen_lazy, qlen), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer_hex(void *, rhp, rhp) + ctf_integer_hex(void *, func, rhp->func) + ctf_integer(long, qlen_lazy, qlen_lazy) + ctf_integer(long, qlen, qlen) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) +LTTNG_TRACEPOINT_EVENT(rcu_callback, + + TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen_lazy, + long qlen), + + TP_ARGS(rcuname, rhp, qlen_lazy, qlen), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer_hex(void *, rhp, rhp) + ctf_integer_hex(void *, func, rhp->func) + ctf_integer(long, qlen_lazy, qlen_lazy) + ctf_integer(long, qlen, qlen) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(rcu_callback, + + TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen), + + TP_ARGS(rcuname, rhp, qlen), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer_hex(void *, rhp, rhp) + ctf_integer_hex(void *, func, rhp->func) + ctf_integer(long, qlen, qlen) + ) +) +#endif + + +/* + * Tracepoint for the registration of a single RCU callback of the special + * kfree() form. The first argument is the RCU type, the second argument + * is a pointer to the RCU callback, the third argument is the offset + * of the callback within the enclosing RCU-protected data structure, + * the fourth argument is the number of lazy callbacks queued, and the + * fifth argument is the total number of callbacks queued. + */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) +LTTNG_TRACEPOINT_EVENT(rcu_kfree_callback, + + TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset, + long qlen), + + TP_ARGS(rcuname, rhp, offset, qlen), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer_hex(void *, rhp, rhp) + ctf_integer_hex(unsigned long, offset, offset) + ctf_integer(long, qlen, qlen) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) +LTTNG_TRACEPOINT_EVENT(rcu_kfree_callback, + + TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset, + long qlen_lazy, long qlen), + + TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer_hex(void *, rhp, rhp) + ctf_integer_hex(unsigned long, offset, offset) + ctf_integer(long, qlen_lazy, qlen_lazy) + ctf_integer(long, qlen, qlen) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) +LTTNG_TRACEPOINT_EVENT(rcu_kfree_callback, + + TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset, + long qlen_lazy, long qlen), + + TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer_hex(void *, rhp, rhp) + ctf_integer_hex(unsigned long, offset, offset) + ctf_integer(long, qlen_lazy, qlen_lazy) + ctf_integer(long, qlen, qlen) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(rcu_kfree_callback, + + TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset, + long qlen), + + TP_ARGS(rcuname, rhp, offset, qlen), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer_hex(void *, rhp, rhp) + ctf_integer_hex(unsigned long, offset, offset) + ctf_integer(long, qlen, qlen) + ) +) +#endif + +/* + * Tracepoint for marking the beginning rcu_do_batch, performed to start + * RCU callback invocation. The first argument is the RCU flavor, + * the second is the number of lazy callbacks queued, the third is + * the total number of callbacks queued, and the fourth argument is + * the current RCU-callback batch limit. + */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) +LTTNG_TRACEPOINT_EVENT(rcu_batch_start, + + TP_PROTO(const char *rcuname, long qlen, long blimit), + + TP_ARGS(rcuname, qlen, blimit), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer(long, qlen, qlen) + ctf_integer(long, blimit, blimit) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) +LTTNG_TRACEPOINT_EVENT(rcu_batch_start, + + TP_PROTO(const char *rcuname, long qlen_lazy, long qlen, long blimit), + + TP_ARGS(rcuname, qlen_lazy, qlen, blimit), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer(long, qlen_lazy, qlen_lazy) + ctf_integer(long, qlen, qlen) + ctf_integer(long, blimit, blimit) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) +LTTNG_TRACEPOINT_EVENT(rcu_batch_start, + + TP_PROTO(char *rcuname, long qlen_lazy, long qlen, long blimit), + + TP_ARGS(rcuname, qlen_lazy, qlen, blimit), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer(long, qlen_lazy, qlen_lazy) + ctf_integer(long, qlen, qlen) + ctf_integer(long, blimit, blimit) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) +LTTNG_TRACEPOINT_EVENT(rcu_batch_start, + + TP_PROTO(char *rcuname, long qlen_lazy, long qlen, int blimit), + + TP_ARGS(rcuname, qlen_lazy, qlen, blimit), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer(long, qlen_lazy, qlen_lazy) + ctf_integer(long, qlen, qlen) + ctf_integer(int, blimit, blimit) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(rcu_batch_start, + + TP_PROTO(char *rcuname, long qlen, int blimit), + + TP_ARGS(rcuname, qlen, blimit), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer(long, qlen, qlen) + ctf_integer(int, blimit, blimit) + ) +) +#endif + +/* + * Tracepoint for the invocation of a single RCU callback function. + * The first argument is the type of RCU, and the second argument is + * a pointer to the RCU callback itself. + */ +LTTNG_TRACEPOINT_EVENT(rcu_invoke_callback, + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) + TP_PROTO(const char *rcuname, struct rcu_head *rhp), +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ + TP_PROTO(char *rcuname, struct rcu_head *rhp), +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ + + TP_ARGS(rcuname, rhp), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer_hex(void *, rhp, rhp) + ctf_integer_hex(void *, func, rhp->func) + ) +) + +/* + * Tracepoint for the invocation of a single RCU callback of the special + * kfree() form. The first argument is the RCU flavor, the second + * argument is a pointer to the RCU callback, and the third argument + * is the offset of the callback within the enclosing RCU-protected + * data structure. + */ +LTTNG_TRACEPOINT_EVENT(rcu_invoke_kfree_callback, + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) + TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset), +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ + TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset), +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ + + TP_ARGS(rcuname, rhp, offset), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer_hex(void *, rhp, rhp) + ctf_integer(unsigned long, offset, offset) + ) +) + +/* + * Tracepoint for exiting rcu_do_batch after RCU callbacks have been + * invoked. The first argument is the name of the RCU flavor, + * the second argument is number of callbacks actually invoked, + * the third argument (cb) is whether or not any of the callbacks that + * were ready to invoke at the beginning of this batch are still + * queued, the fourth argument (nr) is the return value of need_resched(), + * the fifth argument (iit) is 1 if the current task is the idle task, + * and the sixth argument (risk) is the return value from + * rcu_is_callbacks_kthread(). + */ +LTTNG_TRACEPOINT_EVENT(rcu_batch_end, + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) + TP_PROTO(const char *rcuname, int callbacks_invoked, + char cb, char nr, char iit, char risk), + + TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk), +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) + TP_PROTO(const char *rcuname, int callbacks_invoked, + bool cb, bool nr, bool iit, bool risk), + + TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk), +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) + TP_PROTO(char *rcuname, int callbacks_invoked, + bool cb, bool nr, bool iit, bool risk), + + TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk), +#else + TP_PROTO(char *rcuname, int callbacks_invoked), + + TP_ARGS(rcuname, callbacks_invoked), +#endif + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_integer(int, callbacks_invoked, callbacks_invoked) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) + ctf_integer(char, cb, cb) + ctf_integer(char, nr, nr) + ctf_integer(char, iit, iit) + ctf_integer(char, risk, risk) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) + ctf_integer(bool, cb, cb) + ctf_integer(bool, nr, nr) + ctf_integer(bool, iit, iit) + ctf_integer(bool, risk, risk) +#endif + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) +/* + * Tracepoint for rcutorture readers. The first argument is the name + * of the RCU flavor from rcutorture's viewpoint and the second argument + * is the callback address. + */ +LTTNG_TRACEPOINT_EVENT(rcu_torture_read, + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) + TP_PROTO(const char *rcutorturename, struct rcu_head *rhp, + unsigned long secs, unsigned long c_old, unsigned long c), + + TP_ARGS(rcutorturename, rhp, secs, c_old, c), +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) + TP_PROTO(char *rcutorturename, struct rcu_head *rhp, + unsigned long secs, unsigned long c_old, unsigned long c), + + TP_ARGS(rcutorturename, rhp, secs, c_old, c), +#else + TP_PROTO(char *rcutorturename, struct rcu_head *rhp), + + TP_ARGS(rcutorturename, rhp), +#endif + + TP_FIELDS( + ctf_string(rcutorturename, rcutorturename) + ctf_integer_hex(struct rcu_head *, rhp, rhp) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) + ctf_integer(unsigned long, secs, secs) + ctf_integer(unsigned long, c_old, c_old) + ctf_integer(unsigned long, c, c) +#endif + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) +/* + * Tracepoint for _rcu_barrier() execution. The string "s" describes + * the _rcu_barrier phase: + * "Begin": rcu_barrier_callback() started. + * "Check": rcu_barrier_callback() checking for piggybacking. + * "EarlyExit": rcu_barrier_callback() piggybacked, thus early exit. + * "Inc1": rcu_barrier_callback() piggyback check counter incremented. + * "Offline": rcu_barrier_callback() found offline CPU + * "OnlineQ": rcu_barrier_callback() found online CPU with callbacks. + * "OnlineNQ": rcu_barrier_callback() found online CPU, no callbacks. + * "IRQ": An rcu_barrier_callback() callback posted on remote CPU. + * "CB": An rcu_barrier_callback() invoked a callback, not the last. + * "LastCB": An rcu_barrier_callback() invoked the last callback. + * "Inc2": rcu_barrier_callback() piggyback check counter incremented. + * The "cpu" argument is the CPU or -1 if meaningless, the "cnt" argument + * is the count of remaining callbacks, and "done" is the piggybacking count. + */ +LTTNG_TRACEPOINT_EVENT(rcu_barrier, + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) + TP_PROTO(const char *rcuname, const char *s, int cpu, int cnt, unsigned long done), +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ + TP_PROTO(char *rcuname, char *s, int cpu, int cnt, unsigned long done), +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ + + TP_ARGS(rcuname, s, cpu, cnt, done), + + TP_FIELDS( + ctf_string(rcuname, rcuname) + ctf_string(s, s) + ctf_integer(int, cpu, cpu) + ctf_integer(int, cnt, cnt) + ctf_integer(unsigned long, done, done) + ) +) +#endif + +#else /* #ifdef CONFIG_RCU_TRACE */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \ + LTTNG_RHEL_KERNEL_RANGE(4,18,0,80,0,0, 4,19,0,0,0,0)) +#define trace_rcu_grace_period(rcuname, gp_seq, gpevent) do { } while (0) +#define trace_rcu_grace_period_init(rcuname, gp_seq, level, grplo, grphi, \ + qsmask) do { } while (0) +#define trace_rcu_preempt_task(rcuname, pid, gp_seq) do { } while (0) +#define trace_rcu_unlock_preempted_task(rcuname, gp_seq, pid) do { } while (0) +#define trace_rcu_quiescent_state_report(rcuname, gp_seq, mask, qsmask, level, \ + grplo, grphi, gp_tasks) do { } \ + while (0) +#define trace_rcu_fqs(rcuname, gp_seq, cpu, qsevent) do { } while (0) +#else +#define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0) +#define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, \ + qsmask) do { } while (0) +#define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0) +#define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0) +#define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, \ + grplo, grphi, gp_tasks) do { } \ + while (0) +#define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0)) +#define trace_rcu_dyntick(polarity, oldnesting, newnesting, dyntick) do { } while (0) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) +#define trace_rcu_dyntick(polarity, oldnesting, newnesting) do { } while (0) +#else +#define trace_rcu_dyntick(polarity) do { } while (0) +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) +#define trace_rcu_prep_idle(reason) do { } while (0) +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) +#define trace_rcu_callback(rcuname, rhp, qlen_lazy, qlen) do { } while (0) +#define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen_lazy, qlen) \ + do { } while (0) +#define trace_rcu_batch_start(rcuname, qlen_lazy, qlen, blimit) \ + do { } while (0) +#else +#define trace_rcu_callback(rcuname, rhp, qlen) do { } while (0) +#define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen) do { } while (0) +#define trace_rcu_batch_start(rcuname, qlen, blimit) do { } while (0) +#endif +#define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0) +#define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) +#define trace_rcu_batch_end(rcuname, callbacks_invoked, cb, nr, iit, risk) \ + do { } while (0) +#else +#define trace_rcu_batch_end(rcuname, callbacks_invoked) do { } while (0) +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) +#define trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \ + do { } while (0) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) +#define trace_rcu_torture_read(rcutorturename, rhp) do { } while (0) +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) +#define trace_rcu_barrier(name, s, cpu, cnt, done) do { } while (0) +#endif +#endif /* #else #ifdef CONFIG_RCU_TRACE */ + +#endif /* LTTNG_TRACE_RCU_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/regmap.h b/include/instrumentation/events/regmap.h new file mode 100644 index 00000000..8af4d5ae --- /dev/null +++ b/include/instrumentation/events/regmap.h @@ -0,0 +1,145 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM regmap + +#if !defined(LTTNG_TRACE_REGMAP_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_REGMAP_H + +#include +#include +#include + +#ifndef _TRACE_REGMAP_DEF_ +#define _TRACE_REGMAP_DEF_ +struct device; +struct regmap; +#endif + +/* + * Log register events + */ +LTTNG_TRACEPOINT_EVENT_CLASS(regmap_reg, + + TP_PROTO(struct regmap *map, unsigned int reg, + unsigned int val), + + TP_ARGS(map, reg, val), + + TP_FIELDS( + ctf_string(name, regmap_name(map)) + ctf_integer(unsigned int, reg, reg) + ctf_integer(unsigned int, val, val) + ) +) +LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_reg, regmap_reg_write, + + TP_PROTO(struct regmap *map, unsigned int reg, + unsigned int val), + + TP_ARGS(map, reg, val) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_reg, regmap_reg_read, + + TP_PROTO(struct regmap *map, unsigned int reg, + unsigned int val), + + TP_ARGS(map, reg, val) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_reg, regmap_reg_read_cache, + + TP_PROTO(struct regmap *map, unsigned int reg, + unsigned int val), + + TP_ARGS(map, reg, val) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(regmap_block, + + TP_PROTO(struct regmap *map, unsigned int reg, int count), + + TP_ARGS(map, reg, count), + + TP_FIELDS( + ctf_string(name, regmap_name(map)) + ctf_integer(unsigned int, reg, reg) + ctf_integer(int, count, count) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_block, regmap_hw_read_start, + + TP_PROTO(struct regmap *map, unsigned int reg, int count), + + TP_ARGS(map, reg, count) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_block, regmap_hw_read_done, + + TP_PROTO(struct regmap *map, unsigned int reg, int count), + + TP_ARGS(map, reg, count) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_block, regmap_hw_write_start, + + TP_PROTO(struct regmap *map, unsigned int reg, int count), + + TP_ARGS(map, reg, count) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_block, regmap_hw_write_done, + + TP_PROTO(struct regmap *map, unsigned int reg, int count), + + TP_ARGS(map, reg, count) +) + +LTTNG_TRACEPOINT_EVENT_MAP(regcache_sync, + + regmap_regcache_sync, + + TP_PROTO(struct regmap *map, const char *type, + const char *status), + + TP_ARGS(map, type, status), + + TP_FIELDS( + ctf_string(name, regmap_name(map)) + ctf_string(status, status) + ctf_string(type, type) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(regmap_bool, + + TP_PROTO(struct regmap *map, bool flag), + + TP_ARGS(map, flag), + + TP_FIELDS( + ctf_string(name, regmap_name(map)) + ctf_integer(int, flag, flag) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_bool, regmap_cache_only, + + TP_PROTO(struct regmap *map, bool flag), + + TP_ARGS(map, flag) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_bool, regmap_cache_bypass, + + TP_PROTO(struct regmap *map, bool flag), + + TP_ARGS(map, flag) + +) + +#endif /* LTTNG_TRACE_REGMAP_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/regulator.h b/include/instrumentation/events/regulator.h new file mode 100644 index 00000000..bfdb6b65 --- /dev/null +++ b/include/instrumentation/events/regulator.h @@ -0,0 +1,118 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM regulator + +#if !defined(LTTNG_TRACE_REGULATOR_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_REGULATOR_H + +#include +#include + +/* + * Events which just log themselves and the regulator name for enable/disable + * type tracking. + */ +LTTNG_TRACEPOINT_EVENT_CLASS(regulator_basic, + + TP_PROTO(const char *name), + + TP_ARGS(name), + + TP_FIELDS( + ctf_string(name, name) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regulator_basic, regulator_enable, + + TP_PROTO(const char *name), + + TP_ARGS(name) + +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regulator_basic, regulator_enable_delay, + + TP_PROTO(const char *name), + + TP_ARGS(name) + +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regulator_basic, regulator_enable_complete, + + TP_PROTO(const char *name), + + TP_ARGS(name) + +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regulator_basic, regulator_disable, + + TP_PROTO(const char *name), + + TP_ARGS(name) + +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regulator_basic, regulator_disable_complete, + + TP_PROTO(const char *name), + + TP_ARGS(name) + +) + +/* + * Events that take a range of numerical values, mostly for voltages + * and so on. + */ +LTTNG_TRACEPOINT_EVENT_CLASS(regulator_range, + + TP_PROTO(const char *name, int min, int max), + + TP_ARGS(name, min, max), + + TP_FIELDS( + ctf_string(name, name) + ctf_integer(int, min, min) + ctf_integer(int, max, max) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regulator_range, regulator_set_voltage, + + TP_PROTO(const char *name, int min, int max), + + TP_ARGS(name, min, max) + +) + + +/* + * Events that take a single value, mostly for readback and refcounts. + */ +LTTNG_TRACEPOINT_EVENT_CLASS(regulator_value, + + TP_PROTO(const char *name, unsigned int val), + + TP_ARGS(name, val), + + TP_FIELDS( + ctf_string(name, name) + ctf_integer(unsigned int, val, val) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regulator_value, regulator_set_voltage_complete, + + TP_PROTO(const char *name, unsigned int value), + + TP_ARGS(name, value) + +) + +#endif /* _TRACE_POWER_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/rpc.h b/include/instrumentation/events/rpc.h new file mode 100644 index 00000000..90499aee --- /dev/null +++ b/include/instrumentation/events/rpc.h @@ -0,0 +1,366 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM rpc + +#if !defined(LTTNG_TRACE_RPC_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_RPC_H + +#include +#include +#include + +#ifndef ONCE_LTTNG_RPC_H +#define ONCE_LTTNG_RPC_H + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) +static inline +int lttng_get_clid(const struct rpc_task *task) +{ + struct rpc_clnt *tk_client; + + tk_client = task->tk_client; + if (!tk_client) + return -1; + /* + * The cl_clid field is always initialized to positive signed + * integers. Negative signed integer values are treated as + * errors. + */ + return (int) tk_client->cl_clid; +} +#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */ + +#endif /* ONCE_LTTNG_RPC_H */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, + + TP_PROTO(const struct rpc_task *task), + + TP_ARGS(task), + + TP_FIELDS( + ctf_integer(unsigned int, task_id, task->tk_pid) + ctf_integer(int, client_id, lttng_get_clid(task)) + ctf_integer(int, status, task->tk_status) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status, + TP_PROTO(const struct rpc_task *task), + + TP_ARGS(task) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status, + TP_PROTO(const struct rpc_task *task), + + TP_ARGS(task) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, + + TP_PROTO(struct rpc_task *task), + + TP_ARGS(task), + + TP_FIELDS( + ctf_integer(unsigned int, task_id, task->tk_pid) + ctf_integer(int, client_id, lttng_get_clid(task)) + ctf_integer(int, status, task->tk_status) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status, + TP_PROTO(struct rpc_task *task), + + TP_ARGS(task) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status, + TP_PROTO(struct rpc_task *task), + + TP_ARGS(task) +) +#else +LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_status, + + TP_PROTO(struct rpc_task *task), + + TP_ARGS(task), + + TP_FIELDS( + ctf_integer_hex(const struct rpc_task *, task, task) + ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client) + ctf_integer(int, status, task->tk_status) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_call_status, + TP_PROTO(struct rpc_task *task), + + TP_ARGS(task) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_bind_status, + TP_PROTO(struct rpc_task *task), + + TP_ARGS(task) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)) +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_status, rpc_connect_status, + TP_PROTO(const struct rpc_task *task), + + TP_ARGS(task) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) +LTTNG_TRACEPOINT_EVENT(rpc_connect_status, + TP_PROTO(const struct rpc_task *task), + + TP_ARGS(task), + + TP_FIELDS( + ctf_integer(unsigned int, task_id, task->tk_pid) + ctf_integer(int, client_id, lttng_get_clid(task)) + ctf_integer(int, status, task->tk_status) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) +LTTNG_TRACEPOINT_EVENT(rpc_connect_status, + TP_PROTO(struct rpc_task *task, int status), + + TP_ARGS(task, status), + + TP_FIELDS( + ctf_integer(unsigned int, task_id, task->tk_pid) + ctf_integer(int, client_id, lttng_get_clid(task)) + ctf_integer(int, status, status) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(rpc_connect_status, + TP_PROTO(struct rpc_task *task, int status), + + TP_ARGS(task, status), + + TP_FIELDS( + ctf_integer_hex(const struct rpc_task *, task, task) + ctf_integer_hex(const struct rpc_clnt *, clnt, task->tk_client) + ctf_integer(int, status, status) + ) +) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running, + + TP_PROTO(const struct rpc_task *task, const void *action), + + TP_ARGS(task, action), + + TP_FIELDS( + ctf_integer(unsigned int, task_id, task->tk_pid) + ctf_integer(int, client_id, lttng_get_clid(task)) + ctf_integer_hex(const void *, action, action) + ctf_integer(unsigned long, runstate, task->tk_runstate) + ctf_integer(int, status, task->tk_status) + ctf_integer(unsigned short, flags, task->tk_flags) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin, + + TP_PROTO(const struct rpc_task *task, const void *action), + + TP_ARGS(task, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action, + + TP_PROTO(const struct rpc_task *task, const void *action), + + TP_ARGS(task, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete, + + TP_PROTO(const struct rpc_task *task, const void *action), + + TP_ARGS(task, action) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued, + + TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q), + + TP_ARGS(task, q), + + TP_FIELDS( + ctf_integer(unsigned int, task_id, task->tk_pid) + ctf_integer(int, client_id, lttng_get_clid(task)) + ctf_integer(unsigned long, timeout, task->tk_timeout) + ctf_integer(unsigned long, runstate, task->tk_runstate) + ctf_integer(int, status, task->tk_status) + ctf_integer(unsigned short, flags, task->tk_flags) + ctf_string(q_name, rpc_qname(q)) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep, + + TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q), + + TP_ARGS(task, q) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup, + + TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q), + + TP_ARGS(task, q) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running, + + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), + + TP_ARGS(clnt, task, action), + + TP_FIELDS( + ctf_integer(unsigned int, task_id, task->tk_pid) + ctf_integer(int, client_id, lttng_get_clid(task)) + ctf_integer_hex(const void *, action, action) + ctf_integer(unsigned long, runstate, task->tk_runstate) + ctf_integer(int, status, task->tk_status) + ctf_integer(unsigned short, flags, task->tk_flags) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin, + + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), + + TP_ARGS(clnt, task, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action, + + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), + + TP_ARGS(clnt, task, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete, + + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), + + TP_ARGS(clnt, task, action) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued, + + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), + + TP_ARGS(clnt, task, q), + + TP_FIELDS( + ctf_integer(unsigned int, task_id, task->tk_pid) + ctf_integer(int, client_id, lttng_get_clid(task)) + ctf_integer(unsigned long, timeout, task->tk_timeout) + ctf_integer(unsigned long, runstate, task->tk_runstate) + ctf_integer(int, status, task->tk_status) + ctf_integer(unsigned short, flags, task->tk_flags) + ctf_string(q_name, rpc_qname(q)) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep, + + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), + + TP_ARGS(clnt, task, q) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup, + + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), + + TP_ARGS(clnt, task, q) +) + +#else +LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_running, + + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), + + TP_ARGS(clnt, task, action), + + TP_FIELDS( + ctf_integer_hex(const struct rpc_clnt *, clnt, clnt) + ctf_integer_hex(const struct rpc_task *, task, task) + ctf_integer_hex(const void *, action, action) + ctf_integer(unsigned long, runstate, task->tk_runstate) + ctf_integer(int, status, task->tk_status) + ctf_integer(unsigned short, flags, task->tk_flags) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_begin, + + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), + + TP_ARGS(clnt, task, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_run_action, + + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), + + TP_ARGS(clnt, task, action) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_running, rpc_task_complete, + + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const void *action), + + TP_ARGS(clnt, task, action) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(rpc_task_queued, + + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), + + TP_ARGS(clnt, task, q), + + TP_FIELDS( + ctf_integer_hex(const struct rpc_clnt *, clnt, clnt) + ctf_integer_hex(const struct rpc_task *, task, task) + ctf_integer(unsigned long, timeout, task->tk_timeout) + ctf_integer(unsigned long, runstate, task->tk_runstate) + ctf_integer(int, status, task->tk_status) + ctf_integer(unsigned short, flags, task->tk_flags) + ctf_string(q_name, rpc_qname(q)) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_sleep, + + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), + + TP_ARGS(clnt, task, q) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpc_task_queued, rpc_task_wakeup, + + TP_PROTO(const struct rpc_clnt *clnt, const struct rpc_task *task, const struct rpc_wait_queue *q), + + TP_ARGS(clnt, task, q) +) +#endif + +#endif /* LTTNG_TRACE_RPC_H */ + +#include diff --git a/include/instrumentation/events/rpm.h b/include/instrumentation/events/rpm.h new file mode 100644 index 00000000..1e425f8e --- /dev/null +++ b/include/instrumentation/events/rpm.h @@ -0,0 +1,73 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM rpm + +#if !defined(LTTNG_TRACE_RUNTIME_POWER_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_RUNTIME_POWER_H + +#include +#include + +#ifndef _TRACE_RPM_DEF_ +#define _TRACE_RPM_DEF_ +struct device; +#endif + +/* + * The rpm_internal events are used for tracing some important + * runtime pm internal functions. + */ +LTTNG_TRACEPOINT_EVENT_CLASS(rpm_internal, + + TP_PROTO(struct device *dev, int flags), + + TP_ARGS(dev, flags), + + TP_FIELDS( + ctf_string(name, dev_name(dev)) + ctf_integer(int, flags, flags) + ctf_integer(int, usage_count, atomic_read(&dev->power.usage_count)) + ctf_integer(int, disable_depth, dev->power.disable_depth) + ctf_integer(int, runtime_auto, dev->power.runtime_auto) + ctf_integer(int, request_pending, dev->power.request_pending) + ctf_integer(int, irq_safe, dev->power.irq_safe) + ctf_integer(int, child_count, atomic_read(&dev->power.child_count)) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpm_internal, rpm_suspend, + + TP_PROTO(struct device *dev, int flags), + + TP_ARGS(dev, flags) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpm_internal, rpm_resume, + + TP_PROTO(struct device *dev, int flags), + + TP_ARGS(dev, flags) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(rpm_internal, rpm_idle, + + TP_PROTO(struct device *dev, int flags), + + TP_ARGS(dev, flags) +) + +LTTNG_TRACEPOINT_EVENT(rpm_return_int, + TP_PROTO(struct device *dev, unsigned long ip, int ret), + TP_ARGS(dev, ip, ret), + + TP_FIELDS( + ctf_string(name, dev_name(dev)) + ctf_integer_hex(unsigned long, ip, ip) + ctf_integer(int, ret, ret) + ) +) + +#endif /* LTTNG_TRACE_RUNTIME_POWER_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/sched.h b/include/instrumentation/events/sched.h new file mode 100644 index 00000000..10da76c9 --- /dev/null +++ b/include/instrumentation/events/sched.h @@ -0,0 +1,630 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM sched + +#if !defined(LTTNG_TRACE_SCHED_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_SCHED_H + +#include +#include +#include +#include +#include +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) +#include +#endif +#include + +#define LTTNG_MAX_PID_NS_LEVEL 32 + +#ifndef _TRACE_SCHED_DEF_ +#define _TRACE_SCHED_DEF_ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) + +static inline long __trace_sched_switch_state(bool preempt, struct task_struct *p) +{ + unsigned int state; + +#ifdef CONFIG_SCHED_DEBUG + BUG_ON(p != current); +#endif /* CONFIG_SCHED_DEBUG */ + + /* + * Preemption ignores task state, therefore preempted tasks are always + * RUNNING (we will not have dequeued if state != RUNNING). + */ + if (preempt) + return TASK_REPORT_MAX; + + /* + * task_state_index() uses fls() and returns a value from 0-8 range. + * Decrement it by 1 (except TASK_RUNNING state i.e 0) before using + * it for left shift operation to get the correct task->state + * mapping. + */ + state = task_state_index(p); + + return state ? (1 << (state - 1)) : state; +} + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) + +static inline long __trace_sched_switch_state(bool preempt, struct task_struct *p) +{ + unsigned int state; + +#ifdef CONFIG_SCHED_DEBUG + BUG_ON(p != current); +#endif /* CONFIG_SCHED_DEBUG */ + + /* + * Preemption ignores task state, therefore preempted tasks are always + * RUNNING (we will not have dequeued if state != RUNNING). + */ + if (preempt) + return TASK_REPORT_MAX; + + /* + * __get_task_state() uses fls() and returns a value from 0-8 range. + * Decrement it by 1 (except TASK_RUNNING state i.e 0) before using + * it for left shift operation to get the correct task->state + * mapping. + */ + state = __get_task_state(p); + + return state ? (1 << (state - 1)) : state; +} + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)) + +static inline long __trace_sched_switch_state(bool preempt, struct task_struct *p) +{ +#ifdef CONFIG_SCHED_DEBUG + BUG_ON(p != current); +#endif /* CONFIG_SCHED_DEBUG */ + /* + * Preemption ignores task state, therefore preempted tasks are always RUNNING + * (we will not have dequeued if state != RUNNING). + */ + return preempt ? TASK_RUNNING | TASK_STATE_MAX : p->state; +} + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)) + +static inline long __trace_sched_switch_state(struct task_struct *p) +{ + long state = p->state; + +#ifdef CONFIG_PREEMPT +#ifdef CONFIG_SCHED_DEBUG + BUG_ON(p != current); +#endif /* CONFIG_SCHED_DEBUG */ + /* + * For all intents and purposes a preempted task is a running task. + */ + if (preempt_count() & PREEMPT_ACTIVE) + state = TASK_RUNNING | TASK_STATE_MAX; +#endif /* CONFIG_PREEMPT */ + + return state; +} + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) + +static inline long __trace_sched_switch_state(struct task_struct *p) +{ + long state = p->state; + +#ifdef CONFIG_PREEMPT + /* + * For all intents and purposes a preempted task is a running task. + */ + if (task_preempt_count(p) & PREEMPT_ACTIVE) + state = TASK_RUNNING | TASK_STATE_MAX; +#endif + + return state; +} + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) + +static inline long __trace_sched_switch_state(struct task_struct *p) +{ + long state = p->state; + +#ifdef CONFIG_PREEMPT + /* + * For all intents and purposes a preempted task is a running task. + */ + if (task_thread_info(p)->preempt_count & PREEMPT_ACTIVE) + state = TASK_RUNNING | TASK_STATE_MAX; +#endif + + return state; +} + +#else + +static inline long __trace_sched_switch_state(struct task_struct *p) +{ + long state = p->state; + +#ifdef CONFIG_PREEMPT + /* + * For all intents and purposes a preempted task is a running task. + */ + if (task_thread_info(p)->preempt_count & PREEMPT_ACTIVE) + state = TASK_RUNNING; +#endif + + return state; +} + +#endif + +#endif /* _TRACE_SCHED_DEF_ */ + +/* + * Enumeration of the task state bitmask. + * Only bit flags are enumerated here, not composition of states. + */ +LTTNG_TRACEPOINT_ENUM(task_state, + TP_ENUM_VALUES( + ctf_enum_value("TASK_RUNNING", TASK_RUNNING) + ctf_enum_value("TASK_INTERRUPTIBLE", TASK_INTERRUPTIBLE) + ctf_enum_value("TASK_UNINTERRUPTIBLE", TASK_UNINTERRUPTIBLE) + ctf_enum_value("TASK_STOPPED", __TASK_STOPPED) + ctf_enum_value("TASK_TRACED", __TASK_TRACED) + ctf_enum_value("EXIT_DEAD", EXIT_DEAD) + ctf_enum_value("EXIT_ZOMBIE", EXIT_ZOMBIE) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) + ctf_enum_value("TASK_PARKED", TASK_PARKED) +#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) */ + + ctf_enum_value("TASK_DEAD", TASK_DEAD) + ctf_enum_value("TASK_WAKEKILL", TASK_WAKEKILL) + ctf_enum_value("TASK_WAKING", TASK_WAKING) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) + ctf_enum_value("TASK_NOLOAD", TASK_NOLOAD) +#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) + ctf_enum_value("TASK_NEW", TASK_NEW) +#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)) */ + + ctf_enum_value("TASK_STATE_MAX", TASK_STATE_MAX) + ) +) + +/* + * Tracepoint for calling kthread_stop, performed to end a kthread: + */ +LTTNG_TRACEPOINT_EVENT(sched_kthread_stop, + + TP_PROTO(struct task_struct *t), + + TP_ARGS(t), + + TP_FIELDS( + ctf_array_text(char, comm, t->comm, TASK_COMM_LEN) + ctf_integer(pid_t, tid, t->pid) + ) +) + +/* + * Tracepoint for the return value of the kthread stopping: + */ +LTTNG_TRACEPOINT_EVENT(sched_kthread_stop_ret, + + TP_PROTO(int ret), + + TP_ARGS(ret), + + TP_FIELDS( + ctf_integer(int, ret, ret) + ) +) + +/* + * Tracepoint for waking up a task: + */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0) || \ + LTTNG_RT_KERNEL_RANGE(4,1,10,11, 4,2,0,0) || \ + LTTNG_RT_KERNEL_RANGE(3,18,27,26, 3,19,0,0) || \ + LTTNG_RT_KERNEL_RANGE(3,14,61,63, 3,15,0,0) || \ + LTTNG_RT_KERNEL_RANGE(3,12,54,73, 3,13,0,0) || \ + LTTNG_RT_KERNEL_RANGE(3,10,97,106, 3,11,0,0) || \ + LTTNG_RT_KERNEL_RANGE(3,4,110,139, 3,5,0,0) || \ + LTTNG_RT_KERNEL_RANGE(3,2,77,111, 3,3,0,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(sched_wakeup_template, + + TP_PROTO(struct task_struct *p), + + TP_ARGS(p), + + TP_FIELDS( + ctf_array_text(char, comm, p->comm, TASK_COMM_LEN) + ctf_integer(pid_t, tid, p->pid) + ctf_integer(int, prio, p->prio - MAX_RT_PRIO) + ctf_integer(int, target_cpu, task_cpu(p)) + ) +) +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ +LTTNG_TRACEPOINT_EVENT_CLASS(sched_wakeup_template, + + TP_PROTO(struct task_struct *p, int success), + + TP_ARGS(p, success), + + TP_FIELDS( + ctf_array_text(char, comm, p->comm, TASK_COMM_LEN) + ctf_integer(pid_t, tid, p->pid) + ctf_integer(int, prio, p->prio - MAX_RT_PRIO) + ctf_integer(int, success, success) + ctf_integer(int, target_cpu, task_cpu(p)) + ) +) +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0) || \ + LTTNG_RT_KERNEL_RANGE(4,1,10,11, 4,2,0,0) || \ + LTTNG_RT_KERNEL_RANGE(3,18,27,26, 3,19,0,0) || \ + LTTNG_RT_KERNEL_RANGE(3,14,61,63, 3,15,0,0) || \ + LTTNG_RT_KERNEL_RANGE(3,12,54,73, 3,13,0,0) || \ + LTTNG_RT_KERNEL_RANGE(3,10,97,106, 3,11,0,0) || \ + LTTNG_RT_KERNEL_RANGE(3,4,110,139, 3,5,0,0) || \ + LTTNG_RT_KERNEL_RANGE(3,2,77,111, 3,3,0,0)) + +/* + * Tracepoint called when waking a task; this tracepoint is guaranteed to be + * called from the waking context. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_wakeup_template, sched_waking, + TP_PROTO(struct task_struct *p), + TP_ARGS(p)) + +/* + * Tracepoint called when the task is actually woken; p->state == TASK_RUNNNG. + * It it not always called from the waking context. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_wakeup_template, sched_wakeup, + TP_PROTO(struct task_struct *p), + TP_ARGS(p)) + +/* + * Tracepoint for waking up a new task: + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_wakeup_template, sched_wakeup_new, + TP_PROTO(struct task_struct *p), + TP_ARGS(p)) + +#else + +LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_wakeup_template, sched_wakeup, + TP_PROTO(struct task_struct *p, int success), + TP_ARGS(p, success)) + +/* + * Tracepoint for waking up a new task: + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_wakeup_template, sched_wakeup_new, + TP_PROTO(struct task_struct *p, int success), + TP_ARGS(p, success)) + +#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ + +/* + * Tracepoint for task switches, performed by the scheduler: + */ +LTTNG_TRACEPOINT_EVENT(sched_switch, + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)) + TP_PROTO(bool preempt, + struct task_struct *prev, + struct task_struct *next), + + TP_ARGS(preempt, prev, next), +#else + TP_PROTO(struct task_struct *prev, + struct task_struct *next), + + TP_ARGS(prev, next), +#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)) */ + + TP_FIELDS( + ctf_array_text(char, prev_comm, prev->comm, TASK_COMM_LEN) + ctf_integer(pid_t, prev_tid, prev->pid) + ctf_integer(int, prev_prio, prev->prio - MAX_RT_PRIO) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)) + ctf_enum(task_state, long, prev_state, __trace_sched_switch_state(preempt, prev)) +#else + ctf_enum(task_state, long, prev_state, __trace_sched_switch_state(prev)) +#endif + ctf_array_text(char, next_comm, next->comm, TASK_COMM_LEN) + ctf_integer(pid_t, next_tid, next->pid) + ctf_integer(int, next_prio, next->prio - MAX_RT_PRIO) + ) +) + +/* + * Tracepoint for a task being migrated: + */ +LTTNG_TRACEPOINT_EVENT(sched_migrate_task, + + TP_PROTO(struct task_struct *p, int dest_cpu), + + TP_ARGS(p, dest_cpu), + + TP_FIELDS( + ctf_array_text(char, comm, p->comm, TASK_COMM_LEN) + ctf_integer(pid_t, tid, p->pid) + ctf_integer(int, prio, p->prio - MAX_RT_PRIO) + ctf_integer(int, orig_cpu, task_cpu(p)) + ctf_integer(int, dest_cpu, dest_cpu) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(sched_process_template, + + TP_PROTO(struct task_struct *p), + + TP_ARGS(p), + + TP_FIELDS( + ctf_array_text(char, comm, p->comm, TASK_COMM_LEN) + ctf_integer(pid_t, tid, p->pid) + ctf_integer(int, prio, p->prio - MAX_RT_PRIO) + ) +) + +/* + * Tracepoint for freeing a task: + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_process_template, sched_process_free, + TP_PROTO(struct task_struct *p), + TP_ARGS(p)) + + +/* + * Tracepoint for a task exiting: + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_process_template, sched_process_exit, + TP_PROTO(struct task_struct *p), + TP_ARGS(p)) + +/* + * Tracepoint for waiting on task to unschedule: + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_process_template, sched_wait_task, + TP_PROTO(struct task_struct *p), + TP_ARGS(p)) + +/* + * Tracepoint for a waiting task: + */ +LTTNG_TRACEPOINT_EVENT(sched_process_wait, + + TP_PROTO(struct pid *pid), + + TP_ARGS(pid), + + TP_FIELDS( + ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) + ctf_integer(pid_t, tid, pid_nr(pid)) + ctf_integer(int, prio, current->prio - MAX_RT_PRIO) + ) +) + +/* + * Tracepoint for do_fork. + * Saving both TID and PID information, especially for the child, allows + * trace analyzers to distinguish between creation of a new process and + * creation of a new thread. Newly created processes will have child_tid + * == child_pid, while creation of a thread yields to child_tid != + * child_pid. + */ +LTTNG_TRACEPOINT_EVENT_CODE(sched_process_fork, + + TP_PROTO(struct task_struct *parent, struct task_struct *child), + + TP_ARGS(parent, child), + + TP_locvar( + pid_t vtids[LTTNG_MAX_PID_NS_LEVEL]; + unsigned int ns_level; + ), + + TP_code_pre( + if (child) { + struct pid *child_pid; + unsigned int i; + + child_pid = task_pid(child); + tp_locvar->ns_level = + min_t(unsigned int, child_pid->level + 1, + LTTNG_MAX_PID_NS_LEVEL); + for (i = 0; i < tp_locvar->ns_level; i++) + tp_locvar->vtids[i] = child_pid->numbers[i].nr; + } + ), + + TP_FIELDS( + ctf_array_text(char, parent_comm, parent->comm, TASK_COMM_LEN) + ctf_integer(pid_t, parent_tid, parent->pid) + ctf_integer(pid_t, parent_pid, parent->tgid) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) + ctf_integer(unsigned int, parent_ns_inum, + ({ + unsigned int parent_ns_inum = 0; + + if (parent) { + struct pid_namespace *pid_ns; + + pid_ns = task_active_pid_ns(parent); + if (pid_ns) + parent_ns_inum = + pid_ns->lttng_ns_inum; + } + parent_ns_inum; + })) +#endif + ctf_array_text(char, child_comm, child->comm, TASK_COMM_LEN) + ctf_integer(pid_t, child_tid, child->pid) + ctf_sequence(pid_t, vtids, tp_locvar->vtids, u8, tp_locvar->ns_level) + ctf_integer(pid_t, child_pid, child->tgid) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) + ctf_integer(unsigned int, child_ns_inum, + ({ + unsigned int child_ns_inum = 0; + + if (child) { + struct pid_namespace *pid_ns; + + pid_ns = task_active_pid_ns(child); + if (pid_ns) + child_ns_inum = + pid_ns->lttng_ns_inum; + } + child_ns_inum; + })) +#endif + ), + + TP_code_post() +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) +/* + * Tracepoint for exec: + */ +LTTNG_TRACEPOINT_EVENT(sched_process_exec, + + TP_PROTO(struct task_struct *p, pid_t old_pid, + struct linux_binprm *bprm), + + TP_ARGS(p, old_pid, bprm), + + TP_FIELDS( + ctf_string(filename, bprm->filename) + ctf_integer(pid_t, tid, p->pid) + ctf_integer(pid_t, old_tid, old_pid) + ) +) +#endif + +/* + * XXX the below sched_stat tracepoints only apply to SCHED_OTHER/BATCH/IDLE + * adding sched_stat support to SCHED_FIFO/RR would be welcome. + */ +LTTNG_TRACEPOINT_EVENT_CLASS(sched_stat_template, + + TP_PROTO(struct task_struct *tsk, u64 delay), + + TP_ARGS(tsk, delay), + + TP_FIELDS( + ctf_array_text(char, comm, tsk->comm, TASK_COMM_LEN) + ctf_integer(pid_t, tid, tsk->pid) + ctf_integer(u64, delay, delay) + ) +) + + +/* + * Tracepoint for accounting wait time (time the task is runnable + * but not actually running due to scheduler contention). + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_stat_template, sched_stat_wait, + TP_PROTO(struct task_struct *tsk, u64 delay), + TP_ARGS(tsk, delay)) + +/* + * Tracepoint for accounting sleep time (time the task is not runnable, + * including iowait, see below). + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_stat_template, sched_stat_sleep, + TP_PROTO(struct task_struct *tsk, u64 delay), + TP_ARGS(tsk, delay)) + +/* + * Tracepoint for accounting iowait time (time the task is not runnable + * due to waiting on IO to complete). + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_stat_template, sched_stat_iowait, + TP_PROTO(struct task_struct *tsk, u64 delay), + TP_ARGS(tsk, delay)) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) +/* + * Tracepoint for accounting blocked time (time the task is in uninterruptible). + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_stat_template, sched_stat_blocked, + TP_PROTO(struct task_struct *tsk, u64 delay), + TP_ARGS(tsk, delay)) +#endif + +/* + * Tracepoint for accounting runtime (time the task is executing + * on a CPU). + */ +LTTNG_TRACEPOINT_EVENT(sched_stat_runtime, + + TP_PROTO(struct task_struct *tsk, u64 runtime, u64 vruntime), + + TP_ARGS(tsk, runtime, vruntime), + + TP_FIELDS( + ctf_array_text(char, comm, tsk->comm, TASK_COMM_LEN) + ctf_integer(pid_t, tid, tsk->pid) + ctf_integer(u64, runtime, runtime) + ctf_integer(u64, vruntime, vruntime) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0) || \ + LTTNG_RT_KERNEL_RANGE(4,9,27,18, 4,10,0,0) || \ + LTTNG_RT_KERNEL_RANGE(4,11,5,1, 4,12,0,0)) +/* + * Tracepoint for showing priority inheritance modifying a tasks + * priority. + */ +LTTNG_TRACEPOINT_EVENT(sched_pi_setprio, + + TP_PROTO(struct task_struct *tsk, struct task_struct *pi_task), + + TP_ARGS(tsk, pi_task), + + TP_FIELDS( + ctf_array_text(char, comm, tsk->comm, TASK_COMM_LEN) + ctf_integer(pid_t, tid, tsk->pid) + ctf_integer(int, oldprio, tsk->prio - MAX_RT_PRIO) + ctf_integer(int, newprio, pi_task ? pi_task->prio - MAX_RT_PRIO : tsk->prio - MAX_RT_PRIO) + ) +) +#else +/* + * Tracepoint for showing priority inheritance modifying a tasks + * priority. + */ +LTTNG_TRACEPOINT_EVENT(sched_pi_setprio, + + TP_PROTO(struct task_struct *tsk, int newprio), + + TP_ARGS(tsk, newprio), + + TP_FIELDS( + ctf_array_text(char, comm, tsk->comm, TASK_COMM_LEN) + ctf_integer(pid_t, tid, tsk->pid) + ctf_integer(int, oldprio, tsk->prio - MAX_RT_PRIO) + ctf_integer(int, newprio, newprio - MAX_RT_PRIO) + ) +) +#endif + +#endif /* LTTNG_TRACE_SCHED_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/scsi.h b/include/instrumentation/events/scsi.h new file mode 100644 index 00000000..21637bc1 --- /dev/null +++ b/include/instrumentation/events/scsi.h @@ -0,0 +1,490 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM scsi + +#if !defined(LTTNG_TRACE_SCSI_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_SCSI_H + +#include +#include +#include +#include +#include + +#ifndef _TRACE_SCSI_DEF +#define _TRACE_SCSI_DEF + +#define scsi_opcode_name(opcode) { opcode, #opcode } + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) \ + || LTTNG_SLE_KERNEL_RANGE(4,4,9,36,0,0, 4,5,0,0,0,0)) + +#define show_opcode_name(val) \ + __print_symbolic(val, \ + scsi_opcode_name(TEST_UNIT_READY), \ + scsi_opcode_name(REZERO_UNIT), \ + scsi_opcode_name(REQUEST_SENSE), \ + scsi_opcode_name(FORMAT_UNIT), \ + scsi_opcode_name(READ_BLOCK_LIMITS), \ + scsi_opcode_name(REASSIGN_BLOCKS), \ + scsi_opcode_name(INITIALIZE_ELEMENT_STATUS), \ + scsi_opcode_name(READ_6), \ + scsi_opcode_name(WRITE_6), \ + scsi_opcode_name(SEEK_6), \ + scsi_opcode_name(READ_REVERSE), \ + scsi_opcode_name(WRITE_FILEMARKS), \ + scsi_opcode_name(SPACE), \ + scsi_opcode_name(INQUIRY), \ + scsi_opcode_name(RECOVER_BUFFERED_DATA), \ + scsi_opcode_name(MODE_SELECT), \ + scsi_opcode_name(RESERVE), \ + scsi_opcode_name(RELEASE), \ + scsi_opcode_name(COPY), \ + scsi_opcode_name(ERASE), \ + scsi_opcode_name(MODE_SENSE), \ + scsi_opcode_name(START_STOP), \ + scsi_opcode_name(RECEIVE_DIAGNOSTIC), \ + scsi_opcode_name(SEND_DIAGNOSTIC), \ + scsi_opcode_name(ALLOW_MEDIUM_REMOVAL), \ + scsi_opcode_name(SET_WINDOW), \ + scsi_opcode_name(READ_CAPACITY), \ + scsi_opcode_name(READ_10), \ + scsi_opcode_name(WRITE_10), \ + scsi_opcode_name(SEEK_10), \ + scsi_opcode_name(POSITION_TO_ELEMENT), \ + scsi_opcode_name(WRITE_VERIFY), \ + scsi_opcode_name(VERIFY), \ + scsi_opcode_name(SEARCH_HIGH), \ + scsi_opcode_name(SEARCH_EQUAL), \ + scsi_opcode_name(SEARCH_LOW), \ + scsi_opcode_name(SET_LIMITS), \ + scsi_opcode_name(PRE_FETCH), \ + scsi_opcode_name(READ_POSITION), \ + scsi_opcode_name(SYNCHRONIZE_CACHE), \ + scsi_opcode_name(LOCK_UNLOCK_CACHE), \ + scsi_opcode_name(READ_DEFECT_DATA), \ + scsi_opcode_name(MEDIUM_SCAN), \ + scsi_opcode_name(COMPARE), \ + scsi_opcode_name(COPY_VERIFY), \ + scsi_opcode_name(WRITE_BUFFER), \ + scsi_opcode_name(READ_BUFFER), \ + scsi_opcode_name(UPDATE_BLOCK), \ + scsi_opcode_name(READ_LONG), \ + scsi_opcode_name(WRITE_LONG), \ + scsi_opcode_name(CHANGE_DEFINITION), \ + scsi_opcode_name(WRITE_SAME), \ + scsi_opcode_name(UNMAP), \ + scsi_opcode_name(READ_TOC), \ + scsi_opcode_name(LOG_SELECT), \ + scsi_opcode_name(LOG_SENSE), \ + scsi_opcode_name(XDWRITEREAD_10), \ + scsi_opcode_name(MODE_SELECT_10), \ + scsi_opcode_name(RESERVE_10), \ + scsi_opcode_name(RELEASE_10), \ + scsi_opcode_name(MODE_SENSE_10), \ + scsi_opcode_name(PERSISTENT_RESERVE_IN), \ + scsi_opcode_name(PERSISTENT_RESERVE_OUT), \ + scsi_opcode_name(VARIABLE_LENGTH_CMD), \ + scsi_opcode_name(REPORT_LUNS), \ + scsi_opcode_name(MAINTENANCE_IN), \ + scsi_opcode_name(MAINTENANCE_OUT), \ + scsi_opcode_name(MOVE_MEDIUM), \ + scsi_opcode_name(EXCHANGE_MEDIUM), \ + scsi_opcode_name(READ_12), \ + scsi_opcode_name(WRITE_12), \ + scsi_opcode_name(WRITE_VERIFY_12), \ + scsi_opcode_name(SEARCH_HIGH_12), \ + scsi_opcode_name(SEARCH_EQUAL_12), \ + scsi_opcode_name(SEARCH_LOW_12), \ + scsi_opcode_name(READ_ELEMENT_STATUS), \ + scsi_opcode_name(SEND_VOLUME_TAG), \ + scsi_opcode_name(WRITE_LONG_2), \ + scsi_opcode_name(READ_16), \ + scsi_opcode_name(WRITE_16), \ + scsi_opcode_name(VERIFY_16), \ + scsi_opcode_name(WRITE_SAME_16), \ + scsi_opcode_name(ZBC_OUT), \ + scsi_opcode_name(ZBC_IN), \ + scsi_opcode_name(SERVICE_ACTION_IN_16), \ + scsi_opcode_name(READ_32), \ + scsi_opcode_name(WRITE_32), \ + scsi_opcode_name(WRITE_SAME_32), \ + scsi_opcode_name(ATA_16), \ + scsi_opcode_name(ATA_12)) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) \ + || LTTNG_RHEL_KERNEL_RANGE(3,10,0,327,0,0, 3,11,0,0,0,0)) + +#define show_opcode_name(val) \ + __print_symbolic(val, \ + scsi_opcode_name(TEST_UNIT_READY), \ + scsi_opcode_name(REZERO_UNIT), \ + scsi_opcode_name(REQUEST_SENSE), \ + scsi_opcode_name(FORMAT_UNIT), \ + scsi_opcode_name(READ_BLOCK_LIMITS), \ + scsi_opcode_name(REASSIGN_BLOCKS), \ + scsi_opcode_name(INITIALIZE_ELEMENT_STATUS), \ + scsi_opcode_name(READ_6), \ + scsi_opcode_name(WRITE_6), \ + scsi_opcode_name(SEEK_6), \ + scsi_opcode_name(READ_REVERSE), \ + scsi_opcode_name(WRITE_FILEMARKS), \ + scsi_opcode_name(SPACE), \ + scsi_opcode_name(INQUIRY), \ + scsi_opcode_name(RECOVER_BUFFERED_DATA), \ + scsi_opcode_name(MODE_SELECT), \ + scsi_opcode_name(RESERVE), \ + scsi_opcode_name(RELEASE), \ + scsi_opcode_name(COPY), \ + scsi_opcode_name(ERASE), \ + scsi_opcode_name(MODE_SENSE), \ + scsi_opcode_name(START_STOP), \ + scsi_opcode_name(RECEIVE_DIAGNOSTIC), \ + scsi_opcode_name(SEND_DIAGNOSTIC), \ + scsi_opcode_name(ALLOW_MEDIUM_REMOVAL), \ + scsi_opcode_name(SET_WINDOW), \ + scsi_opcode_name(READ_CAPACITY), \ + scsi_opcode_name(READ_10), \ + scsi_opcode_name(WRITE_10), \ + scsi_opcode_name(SEEK_10), \ + scsi_opcode_name(POSITION_TO_ELEMENT), \ + scsi_opcode_name(WRITE_VERIFY), \ + scsi_opcode_name(VERIFY), \ + scsi_opcode_name(SEARCH_HIGH), \ + scsi_opcode_name(SEARCH_EQUAL), \ + scsi_opcode_name(SEARCH_LOW), \ + scsi_opcode_name(SET_LIMITS), \ + scsi_opcode_name(PRE_FETCH), \ + scsi_opcode_name(READ_POSITION), \ + scsi_opcode_name(SYNCHRONIZE_CACHE), \ + scsi_opcode_name(LOCK_UNLOCK_CACHE), \ + scsi_opcode_name(READ_DEFECT_DATA), \ + scsi_opcode_name(MEDIUM_SCAN), \ + scsi_opcode_name(COMPARE), \ + scsi_opcode_name(COPY_VERIFY), \ + scsi_opcode_name(WRITE_BUFFER), \ + scsi_opcode_name(READ_BUFFER), \ + scsi_opcode_name(UPDATE_BLOCK), \ + scsi_opcode_name(READ_LONG), \ + scsi_opcode_name(WRITE_LONG), \ + scsi_opcode_name(CHANGE_DEFINITION), \ + scsi_opcode_name(WRITE_SAME), \ + scsi_opcode_name(UNMAP), \ + scsi_opcode_name(READ_TOC), \ + scsi_opcode_name(LOG_SELECT), \ + scsi_opcode_name(LOG_SENSE), \ + scsi_opcode_name(XDWRITEREAD_10), \ + scsi_opcode_name(MODE_SELECT_10), \ + scsi_opcode_name(RESERVE_10), \ + scsi_opcode_name(RELEASE_10), \ + scsi_opcode_name(MODE_SENSE_10), \ + scsi_opcode_name(PERSISTENT_RESERVE_IN), \ + scsi_opcode_name(PERSISTENT_RESERVE_OUT), \ + scsi_opcode_name(VARIABLE_LENGTH_CMD), \ + scsi_opcode_name(REPORT_LUNS), \ + scsi_opcode_name(MAINTENANCE_IN), \ + scsi_opcode_name(MAINTENANCE_OUT), \ + scsi_opcode_name(MOVE_MEDIUM), \ + scsi_opcode_name(EXCHANGE_MEDIUM), \ + scsi_opcode_name(READ_12), \ + scsi_opcode_name(WRITE_12), \ + scsi_opcode_name(WRITE_VERIFY_12), \ + scsi_opcode_name(SEARCH_HIGH_12), \ + scsi_opcode_name(SEARCH_EQUAL_12), \ + scsi_opcode_name(SEARCH_LOW_12), \ + scsi_opcode_name(READ_ELEMENT_STATUS), \ + scsi_opcode_name(SEND_VOLUME_TAG), \ + scsi_opcode_name(WRITE_LONG_2), \ + scsi_opcode_name(READ_16), \ + scsi_opcode_name(WRITE_16), \ + scsi_opcode_name(VERIFY_16), \ + scsi_opcode_name(WRITE_SAME_16), \ + scsi_opcode_name(SERVICE_ACTION_IN_16), \ + scsi_opcode_name(SAI_READ_CAPACITY_16), \ + scsi_opcode_name(SAI_GET_LBA_STATUS), \ + scsi_opcode_name(MI_REPORT_TARGET_PGS), \ + scsi_opcode_name(MO_SET_TARGET_PGS), \ + scsi_opcode_name(READ_32), \ + scsi_opcode_name(WRITE_32), \ + scsi_opcode_name(WRITE_SAME_32), \ + scsi_opcode_name(ATA_16), \ + scsi_opcode_name(ATA_12)) + +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)) */ + +#define show_opcode_name(val) \ + __print_symbolic(val, \ + scsi_opcode_name(TEST_UNIT_READY), \ + scsi_opcode_name(REZERO_UNIT), \ + scsi_opcode_name(REQUEST_SENSE), \ + scsi_opcode_name(FORMAT_UNIT), \ + scsi_opcode_name(READ_BLOCK_LIMITS), \ + scsi_opcode_name(REASSIGN_BLOCKS), \ + scsi_opcode_name(INITIALIZE_ELEMENT_STATUS), \ + scsi_opcode_name(READ_6), \ + scsi_opcode_name(WRITE_6), \ + scsi_opcode_name(SEEK_6), \ + scsi_opcode_name(READ_REVERSE), \ + scsi_opcode_name(WRITE_FILEMARKS), \ + scsi_opcode_name(SPACE), \ + scsi_opcode_name(INQUIRY), \ + scsi_opcode_name(RECOVER_BUFFERED_DATA), \ + scsi_opcode_name(MODE_SELECT), \ + scsi_opcode_name(RESERVE), \ + scsi_opcode_name(RELEASE), \ + scsi_opcode_name(COPY), \ + scsi_opcode_name(ERASE), \ + scsi_opcode_name(MODE_SENSE), \ + scsi_opcode_name(START_STOP), \ + scsi_opcode_name(RECEIVE_DIAGNOSTIC), \ + scsi_opcode_name(SEND_DIAGNOSTIC), \ + scsi_opcode_name(ALLOW_MEDIUM_REMOVAL), \ + scsi_opcode_name(SET_WINDOW), \ + scsi_opcode_name(READ_CAPACITY), \ + scsi_opcode_name(READ_10), \ + scsi_opcode_name(WRITE_10), \ + scsi_opcode_name(SEEK_10), \ + scsi_opcode_name(POSITION_TO_ELEMENT), \ + scsi_opcode_name(WRITE_VERIFY), \ + scsi_opcode_name(VERIFY), \ + scsi_opcode_name(SEARCH_HIGH), \ + scsi_opcode_name(SEARCH_EQUAL), \ + scsi_opcode_name(SEARCH_LOW), \ + scsi_opcode_name(SET_LIMITS), \ + scsi_opcode_name(PRE_FETCH), \ + scsi_opcode_name(READ_POSITION), \ + scsi_opcode_name(SYNCHRONIZE_CACHE), \ + scsi_opcode_name(LOCK_UNLOCK_CACHE), \ + scsi_opcode_name(READ_DEFECT_DATA), \ + scsi_opcode_name(MEDIUM_SCAN), \ + scsi_opcode_name(COMPARE), \ + scsi_opcode_name(COPY_VERIFY), \ + scsi_opcode_name(WRITE_BUFFER), \ + scsi_opcode_name(READ_BUFFER), \ + scsi_opcode_name(UPDATE_BLOCK), \ + scsi_opcode_name(READ_LONG), \ + scsi_opcode_name(WRITE_LONG), \ + scsi_opcode_name(CHANGE_DEFINITION), \ + scsi_opcode_name(WRITE_SAME), \ + scsi_opcode_name(UNMAP), \ + scsi_opcode_name(READ_TOC), \ + scsi_opcode_name(LOG_SELECT), \ + scsi_opcode_name(LOG_SENSE), \ + scsi_opcode_name(XDWRITEREAD_10), \ + scsi_opcode_name(MODE_SELECT_10), \ + scsi_opcode_name(RESERVE_10), \ + scsi_opcode_name(RELEASE_10), \ + scsi_opcode_name(MODE_SENSE_10), \ + scsi_opcode_name(PERSISTENT_RESERVE_IN), \ + scsi_opcode_name(PERSISTENT_RESERVE_OUT), \ + scsi_opcode_name(VARIABLE_LENGTH_CMD), \ + scsi_opcode_name(REPORT_LUNS), \ + scsi_opcode_name(MAINTENANCE_IN), \ + scsi_opcode_name(MAINTENANCE_OUT), \ + scsi_opcode_name(MOVE_MEDIUM), \ + scsi_opcode_name(EXCHANGE_MEDIUM), \ + scsi_opcode_name(READ_12), \ + scsi_opcode_name(WRITE_12), \ + scsi_opcode_name(WRITE_VERIFY_12), \ + scsi_opcode_name(SEARCH_HIGH_12), \ + scsi_opcode_name(SEARCH_EQUAL_12), \ + scsi_opcode_name(SEARCH_LOW_12), \ + scsi_opcode_name(READ_ELEMENT_STATUS), \ + scsi_opcode_name(SEND_VOLUME_TAG), \ + scsi_opcode_name(WRITE_LONG_2), \ + scsi_opcode_name(READ_16), \ + scsi_opcode_name(WRITE_16), \ + scsi_opcode_name(VERIFY_16), \ + scsi_opcode_name(WRITE_SAME_16), \ + scsi_opcode_name(SERVICE_ACTION_IN), \ + scsi_opcode_name(SAI_READ_CAPACITY_16), \ + scsi_opcode_name(SAI_GET_LBA_STATUS), \ + scsi_opcode_name(MI_REPORT_TARGET_PGS), \ + scsi_opcode_name(MO_SET_TARGET_PGS), \ + scsi_opcode_name(READ_32), \ + scsi_opcode_name(WRITE_32), \ + scsi_opcode_name(WRITE_SAME_32), \ + scsi_opcode_name(ATA_16), \ + scsi_opcode_name(ATA_12)) + +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)) */ + +#define scsi_hostbyte_name(result) { result, #result } +#define show_hostbyte_name(val) \ + __print_symbolic(val, \ + scsi_hostbyte_name(DID_OK), \ + scsi_hostbyte_name(DID_NO_CONNECT), \ + scsi_hostbyte_name(DID_BUS_BUSY), \ + scsi_hostbyte_name(DID_TIME_OUT), \ + scsi_hostbyte_name(DID_BAD_TARGET), \ + scsi_hostbyte_name(DID_ABORT), \ + scsi_hostbyte_name(DID_PARITY), \ + scsi_hostbyte_name(DID_ERROR), \ + scsi_hostbyte_name(DID_RESET), \ + scsi_hostbyte_name(DID_BAD_INTR), \ + scsi_hostbyte_name(DID_PASSTHROUGH), \ + scsi_hostbyte_name(DID_SOFT_ERROR), \ + scsi_hostbyte_name(DID_IMM_RETRY), \ + scsi_hostbyte_name(DID_REQUEUE), \ + scsi_hostbyte_name(DID_TRANSPORT_DISRUPTED), \ + scsi_hostbyte_name(DID_TRANSPORT_FAILFAST)) + +#define scsi_driverbyte_name(result) { result, #result } +#define show_driverbyte_name(val) \ + __print_symbolic(val, \ + scsi_driverbyte_name(DRIVER_OK), \ + scsi_driverbyte_name(DRIVER_BUSY), \ + scsi_driverbyte_name(DRIVER_SOFT), \ + scsi_driverbyte_name(DRIVER_MEDIA), \ + scsi_driverbyte_name(DRIVER_ERROR), \ + scsi_driverbyte_name(DRIVER_INVALID), \ + scsi_driverbyte_name(DRIVER_TIMEOUT), \ + scsi_driverbyte_name(DRIVER_HARD), \ + scsi_driverbyte_name(DRIVER_SENSE)) + +#define scsi_msgbyte_name(result) { result, #result } +#define show_msgbyte_name(val) \ + __print_symbolic(val, \ + scsi_msgbyte_name(COMMAND_COMPLETE), \ + scsi_msgbyte_name(EXTENDED_MESSAGE), \ + scsi_msgbyte_name(SAVE_POINTERS), \ + scsi_msgbyte_name(RESTORE_POINTERS), \ + scsi_msgbyte_name(DISCONNECT), \ + scsi_msgbyte_name(INITIATOR_ERROR), \ + scsi_msgbyte_name(ABORT_TASK_SET), \ + scsi_msgbyte_name(MESSAGE_REJECT), \ + scsi_msgbyte_name(NOP), \ + scsi_msgbyte_name(MSG_PARITY_ERROR), \ + scsi_msgbyte_name(LINKED_CMD_COMPLETE), \ + scsi_msgbyte_name(LINKED_FLG_CMD_COMPLETE), \ + scsi_msgbyte_name(TARGET_RESET), \ + scsi_msgbyte_name(ABORT_TASK), \ + scsi_msgbyte_name(CLEAR_TASK_SET), \ + scsi_msgbyte_name(INITIATE_RECOVERY), \ + scsi_msgbyte_name(RELEASE_RECOVERY), \ + scsi_msgbyte_name(CLEAR_ACA), \ + scsi_msgbyte_name(LOGICAL_UNIT_RESET), \ + scsi_msgbyte_name(SIMPLE_QUEUE_TAG), \ + scsi_msgbyte_name(HEAD_OF_QUEUE_TAG), \ + scsi_msgbyte_name(ORDERED_QUEUE_TAG), \ + scsi_msgbyte_name(IGNORE_WIDE_RESIDUE), \ + scsi_msgbyte_name(ACA), \ + scsi_msgbyte_name(QAS_REQUEST), \ + scsi_msgbyte_name(BUS_DEVICE_RESET), \ + scsi_msgbyte_name(ABORT)) + +#define scsi_statusbyte_name(result) { result, #result } +#define show_statusbyte_name(val) \ + __print_symbolic(val, \ + scsi_statusbyte_name(SAM_STAT_GOOD), \ + scsi_statusbyte_name(SAM_STAT_CHECK_CONDITION), \ + scsi_statusbyte_name(SAM_STAT_CONDITION_MET), \ + scsi_statusbyte_name(SAM_STAT_BUSY), \ + scsi_statusbyte_name(SAM_STAT_INTERMEDIATE), \ + scsi_statusbyte_name(SAM_STAT_INTERMEDIATE_CONDITION_MET), \ + scsi_statusbyte_name(SAM_STAT_RESERVATION_CONFLICT), \ + scsi_statusbyte_name(SAM_STAT_COMMAND_TERMINATED), \ + scsi_statusbyte_name(SAM_STAT_TASK_SET_FULL), \ + scsi_statusbyte_name(SAM_STAT_ACA_ACTIVE), \ + scsi_statusbyte_name(SAM_STAT_TASK_ABORTED)) + +#define scsi_prot_op_name(result) { result, #result } +#define show_prot_op_name(val) \ + __print_symbolic(val, \ + scsi_prot_op_name(SCSI_PROT_NORMAL), \ + scsi_prot_op_name(SCSI_PROT_READ_INSERT), \ + scsi_prot_op_name(SCSI_PROT_WRITE_STRIP), \ + scsi_prot_op_name(SCSI_PROT_READ_STRIP), \ + scsi_prot_op_name(SCSI_PROT_WRITE_INSERT), \ + scsi_prot_op_name(SCSI_PROT_READ_PASS), \ + scsi_prot_op_name(SCSI_PROT_WRITE_PASS)) + +const char *scsi_trace_parse_cdb(struct trace_seq*, unsigned char*, int); +#define __parse_cdb(cdb, len) scsi_trace_parse_cdb(p, cdb, len) +#endif + +LTTNG_TRACEPOINT_EVENT(scsi_dispatch_cmd_start, + + TP_PROTO(struct scsi_cmnd *cmd), + + TP_ARGS(cmd), + + TP_FIELDS( + ctf_integer(unsigned int, host_no, cmd->device->host->host_no) + ctf_integer(unsigned int, channel, cmd->device->channel) + ctf_integer(unsigned int, id, cmd->device->id) + ctf_integer(unsigned int, lun, cmd->device->lun) + ctf_integer(unsigned int, opcode, cmd->cmnd[0]) + ctf_integer(unsigned int, cmd_len, cmd->cmd_len) + ctf_integer(unsigned int, data_sglen, scsi_sg_count(cmd)) + ctf_integer(unsigned int, prot_sglen, scsi_prot_sg_count(cmd)) + ctf_integer(unsigned char, prot_op, scsi_get_prot_op(cmd)) + ctf_sequence_hex(unsigned char, cmnd, cmd->cmnd, u32, cmd->cmd_len) + ) +) + +LTTNG_TRACEPOINT_EVENT(scsi_dispatch_cmd_error, + + TP_PROTO(struct scsi_cmnd *cmd, int rtn), + + TP_ARGS(cmd, rtn), + + TP_FIELDS( + ctf_integer(unsigned int, host_no, cmd->device->host->host_no) + ctf_integer(unsigned int, channel, cmd->device->channel) + ctf_integer(unsigned int, id, cmd->device->id) + ctf_integer(unsigned int, lun, cmd->device->lun) + ctf_integer(int, rtn, rtn) + ctf_integer(unsigned int, opcode, cmd->cmnd[0]) + ctf_integer(unsigned int, cmd_len, cmd->cmd_len) + ctf_integer(unsigned int, data_sglen, scsi_sg_count(cmd)) + ctf_integer(unsigned int, prot_sglen, scsi_prot_sg_count(cmd)) + ctf_integer(unsigned char, prot_op, scsi_get_prot_op(cmd)) + ctf_sequence_hex(unsigned char, cmnd, cmd->cmnd, u32, cmd->cmd_len) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(scsi_cmd_done_timeout_template, + + TP_PROTO(struct scsi_cmnd *cmd), + + TP_ARGS(cmd), + + TP_FIELDS( + ctf_integer(unsigned int, host_no, cmd->device->host->host_no) + ctf_integer(unsigned int, channel, cmd->device->channel) + ctf_integer(unsigned int, id, cmd->device->id) + ctf_integer(unsigned int, lun, cmd->device->lun) + ctf_integer(int, result, cmd->result) + ctf_integer(unsigned int, opcode, cmd->cmnd[0]) + ctf_integer(unsigned int, cmd_len, cmd->cmd_len) + ctf_integer(unsigned int, data_sglen, scsi_sg_count(cmd)) + ctf_integer(unsigned int, prot_sglen, scsi_prot_sg_count(cmd)) + ctf_integer(unsigned char, prot_op, scsi_get_prot_op(cmd)) + ctf_sequence_hex(unsigned char, cmnd, cmd->cmnd, u32, cmd->cmd_len) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(scsi_cmd_done_timeout_template, scsi_dispatch_cmd_done, + TP_PROTO(struct scsi_cmnd *cmd), + TP_ARGS(cmd)) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(scsi_cmd_done_timeout_template, scsi_dispatch_cmd_timeout, + TP_PROTO(struct scsi_cmnd *cmd), + TP_ARGS(cmd)) + +LTTNG_TRACEPOINT_EVENT(scsi_eh_wakeup, + + TP_PROTO(struct Scsi_Host *shost), + + TP_ARGS(shost), + + TP_FIELDS( + ctf_integer(unsigned int, host_no, shost->host_no) + ) +) + +#endif /* LTTNG_TRACE_SCSI_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/signal.h b/include/instrumentation/events/signal.h new file mode 100644 index 00000000..4a71d14b --- /dev/null +++ b/include/instrumentation/events/signal.h @@ -0,0 +1,202 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM signal + +#if !defined(LTTNG_TRACE_SIGNAL_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_SIGNAL_H + +#include +#include + +#ifndef _TRACE_SIGNAL_DEF +#define _TRACE_SIGNAL_DEF +#include +#include +#undef LTTNG_FIELDS_SIGINFO +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \ + LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0)) +#define LTTNG_FIELDS_SIGINFO(info) \ + ctf_integer(int, errno, \ + (info == SEND_SIG_NOINFO || info == SEND_SIG_PRIV) ? \ + 0 : \ + info->si_errno) \ + ctf_integer(int, code, \ + (info == SEND_SIG_NOINFO) ? \ + SI_USER : \ + ((info == SEND_SIG_PRIV) ? SI_KERNEL : info->si_code)) +#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) */ +#define LTTNG_FIELDS_SIGINFO(info) \ + ctf_integer(int, errno, \ + (info == SEND_SIG_NOINFO || info == SEND_SIG_FORCED || info == SEND_SIG_PRIV) ? \ + 0 : \ + info->si_errno) \ + ctf_integer(int, code, \ + (info == SEND_SIG_NOINFO || info == SEND_SIG_FORCED) ? \ + SI_USER : \ + ((info == SEND_SIG_PRIV) ? SI_KERNEL : info->si_code)) +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) */ +#endif /* _TRACE_SIGNAL_DEF */ + +/** + * signal_generate - called when a signal is generated + * @sig: signal number + * @info: pointer to struct siginfo + * @task: pointer to struct task_struct + * + * Current process sends a 'sig' signal to 'task' process with + * 'info' siginfo. If 'info' is SEND_SIG_NOINFO or SEND_SIG_PRIV, + * 'info' is not a pointer and you can't access its field. Instead, + * SEND_SIG_NOINFO means that si_code is SI_USER, and SEND_SIG_PRIV + * means that si_code is SI_KERNEL. + */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \ + LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0)) +LTTNG_TRACEPOINT_EVENT(signal_generate, + + TP_PROTO(int sig, struct kernel_siginfo *info, struct task_struct *task, + int group, int result), + + TP_ARGS(sig, info, task, group, result), + + TP_FIELDS( + ctf_integer(int, sig, sig) + LTTNG_FIELDS_SIGINFO(info) + ctf_array_text(char, comm, task->comm, TASK_COMM_LEN) + ctf_integer(pid_t, pid, task->pid) + ctf_integer(int, group, group) + ctf_integer(int, result, result) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) +LTTNG_TRACEPOINT_EVENT(signal_generate, + + TP_PROTO(int sig, struct siginfo *info, struct task_struct *task, + int group, int result), + + TP_ARGS(sig, info, task, group, result), + + TP_FIELDS( + ctf_integer(int, sig, sig) + LTTNG_FIELDS_SIGINFO(info) + ctf_array_text(char, comm, task->comm, TASK_COMM_LEN) + ctf_integer(pid_t, pid, task->pid) + ctf_integer(int, group, group) + ctf_integer(int, result, result) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(signal_generate, + + TP_PROTO(int sig, struct siginfo *info, struct task_struct *task), + + TP_ARGS(sig, info, task), + + TP_FIELDS( + ctf_integer(int, sig, sig) + LTTNG_FIELDS_SIGINFO(info) + ctf_array_text(char, comm, task->comm, TASK_COMM_LEN) + ctf_integer(pid_t, pid, task->pid) + ) +) +#endif + +/** + * signal_deliver - called when a signal is delivered + * @sig: signal number + * @info: pointer to struct siginfo + * @ka: pointer to struct k_sigaction + * + * A 'sig' signal is delivered to current process with 'info' siginfo, + * and it will be handled by 'ka'. ka->sa.sa_handler can be SIG_IGN or + * SIG_DFL. + * Note that some signals reported by signal_generate tracepoint can be + * lost, ignored or modified (by debugger) before hitting this tracepoint. + * This means, this can show which signals are actually delivered, but + * matching generated signals and delivered signals may not be correct. + */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \ + LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0)) +LTTNG_TRACEPOINT_EVENT(signal_deliver, + + TP_PROTO(int sig, struct kernel_siginfo *info, struct k_sigaction *ka), + + TP_ARGS(sig, info, ka), + + TP_FIELDS( + ctf_integer(int, sig, sig) + LTTNG_FIELDS_SIGINFO(info) + ctf_integer(unsigned long, sa_handler, (unsigned long) ka->sa.sa_handler) + ctf_integer(unsigned long, sa_flags, ka->sa.sa_flags) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(signal_deliver, + + TP_PROTO(int sig, struct siginfo *info, struct k_sigaction *ka), + + TP_ARGS(sig, info, ka), + + TP_FIELDS( + ctf_integer(int, sig, sig) + LTTNG_FIELDS_SIGINFO(info) + ctf_integer(unsigned long, sa_handler, (unsigned long) ka->sa.sa_handler) + ctf_integer(unsigned long, sa_flags, ka->sa.sa_flags) + ) +) +#endif + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(signal_queue_overflow, + + TP_PROTO(int sig, int group, struct siginfo *info), + + TP_ARGS(sig, group, info), + + TP_FIELDS( + ctf_integer(int, sig, sig) + ctf_integer(int, group, group) + LTTNG_FIELDS_SIGINFO(info) + ) +) + +/** + * signal_overflow_fail - called when signal queue is overflow + * @sig: signal number + * @group: signal to process group or not (bool) + * @info: pointer to struct siginfo + * + * Kernel fails to generate 'sig' signal with 'info' siginfo, because + * siginfo queue is overflow, and the signal is dropped. + * 'group' is not 0 if the signal will be sent to a process group. + * 'sig' is always one of RT signals. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(signal_queue_overflow, signal_overflow_fail, + + TP_PROTO(int sig, int group, struct siginfo *info), + + TP_ARGS(sig, group, info) +) + +/** + * signal_lose_info - called when siginfo is lost + * @sig: signal number + * @group: signal to process group or not (bool) + * @info: pointer to struct siginfo + * + * Kernel generates 'sig' signal but loses 'info' siginfo, because siginfo + * queue is overflow. + * 'group' is not 0 if the signal will be sent to a process group. + * 'sig' is always one of non-RT signals. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(signal_queue_overflow, signal_lose_info, + + TP_PROTO(int sig, int group, struct siginfo *info), + + TP_ARGS(sig, group, info) +) +#endif + +#endif /* LTTNG_TRACE_SIGNAL_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/skb.h b/include/instrumentation/events/skb.h new file mode 100644 index 00000000..2be9d83f --- /dev/null +++ b/include/instrumentation/events/skb.h @@ -0,0 +1,59 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM skb + +#if !defined(LTTNG_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_SKB_H + +#include +#include +#include +#include + +/* + * Tracepoint for free an sk_buff: + */ +LTTNG_TRACEPOINT_EVENT_MAP(kfree_skb, + + skb_kfree, + + TP_PROTO(struct sk_buff *skb, void *location), + + TP_ARGS(skb, location), + + TP_FIELDS( + ctf_integer_hex(void *, skbaddr, skb) + ctf_integer_hex(void *, location, location) + ctf_integer_network(unsigned short, protocol, skb->protocol) + ) +) + +LTTNG_TRACEPOINT_EVENT_MAP(consume_skb, + + skb_consume, + + TP_PROTO(struct sk_buff *skb), + + TP_ARGS(skb), + + TP_FIELDS( + ctf_integer_hex(void *, skbaddr, skb) + ) +) + +LTTNG_TRACEPOINT_EVENT(skb_copy_datagram_iovec, + + TP_PROTO(const struct sk_buff *skb, int len), + + TP_ARGS(skb, len), + + TP_FIELDS( + ctf_integer_hex(const void *, skbaddr, skb) + ctf_integer(int, len, len) + ) +) + +#endif /* LTTNG_TRACE_SKB_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/sock.h b/include/instrumentation/events/sock.h new file mode 100644 index 00000000..955bc1a3 --- /dev/null +++ b/include/instrumentation/events/sock.h @@ -0,0 +1,85 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM sock + +#if !defined(LTTNG_TRACE_SOCK_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_SOCK_H + +#include +#include +#include + +LTTNG_TRACEPOINT_EVENT(sock_rcvqueue_full, + + TP_PROTO(struct sock *sk, struct sk_buff *skb), + + TP_ARGS(sk, skb), + + TP_FIELDS( + ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc)) + ctf_integer(unsigned int, truesize, skb->truesize) + ctf_integer(int, sk_rcvbuf, sk->sk_rcvbuf) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)) + +LTTNG_TRACEPOINT_EVENT(sock_exceed_buf_limit, + + TP_PROTO(struct sock *sk, struct proto *prot, long allocated, int kind), + + TP_ARGS(sk, prot, allocated, kind), + + TP_FIELDS( + ctf_string(name, prot->name) + ctf_array(long, sysctl_mem, prot->sysctl_mem, 3) + ctf_integer(long, allocated, allocated) + ctf_integer(int, sysctl_rmem, sk_get_rmem0(sk, prot)) + ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc)) + ctf_integer(int, sysctl_wmem, sk_get_wmem0(sk, prot)) + ctf_integer(int, wmem_alloc, refcount_read(&sk->sk_wmem_alloc)) + ctf_integer(int, wmem_queued, sk->sk_wmem_queued) + ctf_integer(int, kind, kind) + ) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) + +LTTNG_TRACEPOINT_EVENT(sock_exceed_buf_limit, + + TP_PROTO(struct sock *sk, struct proto *prot, long allocated), + + TP_ARGS(sk, prot, allocated), + + TP_FIELDS( + ctf_string(name, prot->name) + ctf_array(long, sysctl_mem, prot->sysctl_mem, 3) + ctf_integer(long, allocated, allocated) + ctf_integer(int, sysctl_rmem, sk_get_rmem0(sk, prot)) + ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc)) + ) +) + +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) */ + +LTTNG_TRACEPOINT_EVENT(sock_exceed_buf_limit, + + TP_PROTO(struct sock *sk, struct proto *prot, long allocated), + + TP_ARGS(sk, prot, allocated), + + TP_FIELDS( + ctf_string(name, prot->name) + ctf_array(long, sysctl_mem, prot->sysctl_mem, 3) + ctf_integer(long, allocated, allocated) + ctf_integer(int, sysctl_rmem, prot->sysctl_rmem[0]) + ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc)) + ) +) + +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)) */ + +#endif /* LTTNG_TRACE_SOCK_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/timer.h b/include/instrumentation/events/timer.h new file mode 100644 index 00000000..503c5bc2 --- /dev/null +++ b/include/instrumentation/events/timer.h @@ -0,0 +1,397 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM timer + +#if !defined(LTTNG_TRACE_TIMER_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_TIMER_H + +#include + +#ifndef _TRACE_TIMER_DEF_ +#define _TRACE_TIMER_DEF_ +#include +#include +#include + +struct timer_list; + +#endif /* _TRACE_TIMER_DEF_ */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) +#define lttng_ktime_get_tv64(kt) (kt) +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ +#define lttng_ktime_get_tv64(kt) ((kt).tv64) +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */ + +LTTNG_TRACEPOINT_EVENT_CLASS(timer_class, + + TP_PROTO(struct timer_list *timer), + + TP_ARGS(timer), + + TP_FIELDS( + ctf_integer_hex(void *, timer, timer) + ) +) + +/** + * timer_init - called when the timer is initialized + * @timer: pointer to struct timer_list + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(timer_class, timer_init, + + TP_PROTO(struct timer_list *timer), + + TP_ARGS(timer) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) || \ + LTTNG_RHEL_KERNEL_RANGE(3,10,0,957,0,0, 3,11,0,0,0,0)) +/** + * timer_start - called when the timer is started + * @timer: pointer to struct timer_list + * @expires: the timers expiry time + * @flags: the timers expiry time + */ +LTTNG_TRACEPOINT_EVENT(timer_start, + + TP_PROTO(struct timer_list *timer, unsigned long expires, + unsigned int flags), + + TP_ARGS(timer, expires, flags), + + TP_FIELDS( + ctf_integer_hex(void *, timer, timer) + ctf_integer_hex(void *, function, timer->function) + ctf_integer(unsigned long, expires, expires) + ctf_integer(unsigned long, now, jiffies) + ctf_integer(unsigned int, flags, flags) + ) +) +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ +/** + * timer_start - called when the timer is started + * @timer: pointer to struct timer_list + * @expires: the timers expiry time + */ +LTTNG_TRACEPOINT_EVENT(timer_start, + + TP_PROTO(struct timer_list *timer, unsigned long expires), + + TP_ARGS(timer, expires), + + TP_FIELDS( + ctf_integer_hex(void *, timer, timer) + ctf_integer_hex(void *, function, timer->function) + ctf_integer(unsigned long, expires, expires) + ctf_integer(unsigned long, now, jiffies) + ) +) +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)) +/** + * timer_expire_entry - called immediately before the timer callback + * @timer: pointer to struct timer_list + * + * Allows to determine the timer latency. + */ +LTTNG_TRACEPOINT_EVENT(timer_expire_entry, + + TP_PROTO(struct timer_list *timer, unsigned long baseclk), + + TP_ARGS(timer, baseclk), + + TP_FIELDS( + ctf_integer_hex(void *, timer, timer) + ctf_integer(unsigned long, now, jiffies) + ctf_integer_hex(void *, function, timer->function) + ctf_integer(unsigned long, baseclk, baseclk) + ) +) +#else +/** + * timer_expire_entry - called immediately before the timer callback + * @timer: pointer to struct timer_list + * + * Allows to determine the timer latency. + */ +LTTNG_TRACEPOINT_EVENT(timer_expire_entry, + + TP_PROTO(struct timer_list *timer), + + TP_ARGS(timer), + + TP_FIELDS( + ctf_integer_hex(void *, timer, timer) + ctf_integer(unsigned long, now, jiffies) + ctf_integer_hex(void *, function, timer->function) + ) +) +#endif + +/** + * timer_expire_exit - called immediately after the timer callback returns + * @timer: pointer to struct timer_list + * + * When used in combination with the timer_expire_entry tracepoint we can + * determine the runtime of the timer callback function. + * + * NOTE: Do NOT derefernce timer in TP_fast_assign. The pointer might + * be invalid. We solely track the pointer. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(timer_class, timer_expire_exit, + + TP_PROTO(struct timer_list *timer), + + TP_ARGS(timer) +) + +/** + * timer_cancel - called when the timer is canceled + * @timer: pointer to struct timer_list + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(timer_class, timer_cancel, + + TP_PROTO(struct timer_list *timer), + + TP_ARGS(timer) +) + +/** + * hrtimer_init - called when the hrtimer is initialized + * @timer: pointer to struct hrtimer + * @clockid: the hrtimers clock + * @mode: the hrtimers mode + */ +LTTNG_TRACEPOINT_EVENT_MAP(hrtimer_init, + + timer_hrtimer_init, + + TP_PROTO(struct hrtimer *hrtimer, clockid_t clockid, + enum hrtimer_mode mode), + + TP_ARGS(hrtimer, clockid, mode), + + TP_FIELDS( + ctf_integer_hex(void *, hrtimer, hrtimer) + ctf_integer(clockid_t, clockid, clockid) + ctf_integer(enum hrtimer_mode, mode, mode) + ) +) + +/** + * hrtimer_start - called when the hrtimer is started + * @timer: pointer to struct hrtimer + */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0) || \ + LTTNG_RT_KERNEL_RANGE(4,14,0,0, 4,15,0,0)) +LTTNG_TRACEPOINT_EVENT_MAP(hrtimer_start, + + timer_hrtimer_start, + + TP_PROTO(struct hrtimer *hrtimer, enum hrtimer_mode mode), + + TP_ARGS(hrtimer, mode), + + TP_FIELDS( + ctf_integer_hex(void *, hrtimer, hrtimer) + ctf_integer_hex(void *, function, hrtimer->function) + ctf_integer(s64, expires, + lttng_ktime_get_tv64(hrtimer_get_expires(hrtimer))) + ctf_integer(s64, softexpires, + lttng_ktime_get_tv64(hrtimer_get_softexpires(hrtimer))) + ctf_integer(enum hrtimer_mode, mode, mode) + ) +) +#else +LTTNG_TRACEPOINT_EVENT_MAP(hrtimer_start, + + timer_hrtimer_start, + + TP_PROTO(struct hrtimer *hrtimer), + + TP_ARGS(hrtimer), + + TP_FIELDS( + ctf_integer_hex(void *, hrtimer, hrtimer) + ctf_integer_hex(void *, function, hrtimer->function) + ctf_integer(s64, expires, + lttng_ktime_get_tv64(hrtimer_get_expires(hrtimer))) + ctf_integer(s64, softexpires, + lttng_ktime_get_tv64(hrtimer_get_softexpires(hrtimer))) + ) +) +#endif + +/** + * htimmer_expire_entry - called immediately before the hrtimer callback + * @timer: pointer to struct hrtimer + * @now: pointer to variable which contains current time of the + * timers base. + * + * Allows to determine the timer latency. + */ +LTTNG_TRACEPOINT_EVENT_MAP(hrtimer_expire_entry, + + timer_hrtimer_expire_entry, + + TP_PROTO(struct hrtimer *hrtimer, ktime_t *now), + + TP_ARGS(hrtimer, now), + + TP_FIELDS( + ctf_integer_hex(void *, hrtimer, hrtimer) + ctf_integer(s64, now, lttng_ktime_get_tv64(*now)) + ctf_integer_hex(void *, function, hrtimer->function) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(timer_hrtimer_class, + + TP_PROTO(struct hrtimer *hrtimer), + + TP_ARGS(hrtimer), + + TP_FIELDS( + ctf_integer_hex(void *, hrtimer, hrtimer) + ) +) + +/** + * hrtimer_expire_exit - called immediately after the hrtimer callback returns + * @timer: pointer to struct hrtimer + * + * When used in combination with the hrtimer_expire_entry tracepoint we can + * determine the runtime of the callback function. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(timer_hrtimer_class, hrtimer_expire_exit, + + timer_hrtimer_expire_exit, + + TP_PROTO(struct hrtimer *hrtimer), + + TP_ARGS(hrtimer) +) + +/** + * hrtimer_cancel - called when the hrtimer is canceled + * @hrtimer: pointer to struct hrtimer + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(timer_hrtimer_class, hrtimer_cancel, + + timer_hrtimer_cancel, + + TP_PROTO(struct hrtimer *hrtimer), + + TP_ARGS(hrtimer) +) + +/** + * itimer_state - called when itimer is started or canceled + * @which: name of the interval timer + * @value: the itimers value, itimer is canceled if value->it_value is + * zero, otherwise it is started + * @expires: the itimers expiry time + */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)) +LTTNG_TRACEPOINT_EVENT_MAP(itimer_state, + + timer_itimer_state, + + TP_PROTO(int which, const struct itimerspec64 *const value, + unsigned long long expires), + + TP_ARGS(which, value, expires), + + TP_FIELDS( + ctf_integer(int, which, which) + ctf_integer(unsigned long long, expires, expires) + ctf_integer(long, value_sec, value->it_value.tv_sec) + ctf_integer(long, value_nsec, value->it_value.tv_nsec) + ctf_integer(long, interval_sec, value->it_interval.tv_sec) + ctf_integer(long, interval_nsec, value->it_interval.tv_nsec) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) +LTTNG_TRACEPOINT_EVENT_MAP(itimer_state, + + timer_itimer_state, + + TP_PROTO(int which, const struct itimerval *const value, + unsigned long long expires), + + TP_ARGS(which, value, expires), + + TP_FIELDS( + ctf_integer(int, which, which) + ctf_integer(unsigned long long, expires, expires) + ctf_integer(long, value_sec, value->it_value.tv_sec) + ctf_integer(long, value_usec, value->it_value.tv_usec) + ctf_integer(long, interval_sec, value->it_interval.tv_sec) + ctf_integer(long, interval_usec, value->it_interval.tv_usec) + ) +) +#else /* if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ +LTTNG_TRACEPOINT_EVENT_MAP(itimer_state, + + timer_itimer_state, + + TP_PROTO(int which, const struct itimerval *const value, + cputime_t expires), + + TP_ARGS(which, value, expires), + + TP_FIELDS( + ctf_integer(int, which, which) + ctf_integer(cputime_t, expires, expires) + ctf_integer(long, value_sec, value->it_value.tv_sec) + ctf_integer(long, value_usec, value->it_value.tv_usec) + ctf_integer(long, interval_sec, value->it_interval.tv_sec) + ctf_integer(long, interval_usec, value->it_interval.tv_usec) + ) +) +#endif /* #else (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ + +/** + * itimer_expire - called when itimer expires + * @which: type of the interval timer + * @pid: pid of the process which owns the timer + * @now: current time, used to calculate the latency of itimer + */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) +LTTNG_TRACEPOINT_EVENT_MAP(itimer_expire, + + timer_itimer_expire, + + TP_PROTO(int which, struct pid *pid, unsigned long long now), + + TP_ARGS(which, pid, now), + + TP_FIELDS( + ctf_integer(int , which, which) + ctf_integer(pid_t, pid, pid_nr(pid)) + ctf_integer(unsigned long long, now, now) + ) +) +#else /* if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ +LTTNG_TRACEPOINT_EVENT_MAP(itimer_expire, + + timer_itimer_expire, + + TP_PROTO(int which, struct pid *pid, cputime_t now), + + TP_ARGS(which, pid, now), + + TP_FIELDS( + ctf_integer(int , which, which) + ctf_integer(pid_t, pid, pid_nr(pid)) + ctf_integer(cputime_t, now, now) + ) +) +#endif /* #else (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */ + +#endif /* LTTNG_TRACE_TIMER_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/udp.h b/include/instrumentation/events/udp.h new file mode 100644 index 00000000..b63a1bb5 --- /dev/null +++ b/include/instrumentation/events/udp.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM udp + +#if !defined(LTTNG_TRACE_UDP_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_UDP_H + +#include +#include + +LTTNG_TRACEPOINT_EVENT(udp_fail_queue_rcv_skb, + + TP_PROTO(int rc, struct sock *sk), + + TP_ARGS(rc, sk), + + TP_FIELDS( + ctf_integer(int, rc, rc) + ctf_integer(__u16, lport, inet_sk(sk)->inet_num) + ) +) + +#endif /* LTTNG_TRACE_UDP_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/v4l2.h b/include/instrumentation/events/v4l2.h new file mode 100644 index 00000000..dd7551e8 --- /dev/null +++ b/include/instrumentation/events/v4l2.h @@ -0,0 +1,82 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM v4l2 + +#if !defined(LTTNG_TRACE_V4L2_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_V4L2_H + +#include + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(v4l2_class, + + TP_PROTO(int minor, struct v4l2_buffer *buf), + + TP_ARGS(minor, buf), + + TP_FIELDS( + ctf_integer(int, minor, minor) + ctf_integer(u32, index, buf->index) + ctf_integer(u32, type, buf->type) + ctf_integer(u32, bytesused, buf->bytesused) + ctf_integer(u32, flags, buf->flags) + ctf_integer(u32, field, buf->field) + ctf_integer(s64, timestamp, v4l2_buffer_get_timestamp(buf)) + ctf_integer(u32, timecode_type, buf->timecode.type) + ctf_integer(u32, timecode_flags, buf->timecode.flags) + ctf_integer(u8, timecode_frames, buf->timecode.frames) + ctf_integer(u8, timecode_seconds, buf->timecode.seconds) + ctf_integer(u8, timecode_minutes, buf->timecode.minutes) + ctf_integer(u8, timecode_hours, buf->timecode.hours) + ctf_array(u8, timecode_userbits, buf->timecode.userbits, 4) + ctf_integer(u32, sequence, buf->sequence) + ) +) +#else +LTTNG_TRACEPOINT_EVENT_CLASS(v4l2_class, + + TP_PROTO(int minor, struct v4l2_buffer *buf), + + TP_ARGS(minor, buf), + + TP_FIELDS( + ctf_integer(int, minor, minor) + ctf_integer(u32, index, buf->index) + ctf_integer(u32, type, buf->type) + ctf_integer(u32, bytesused, buf->bytesused) + ctf_integer(u32, flags, buf->flags) + ctf_integer(u32, field, buf->field) + ctf_integer(s64, timestamp, timeval_to_ns(&buf->timestamp)) + ctf_integer(u32, timecode_type, buf->timecode.type) + ctf_integer(u32, timecode_flags, buf->timecode.flags) + ctf_integer(u8, timecode_frames, buf->timecode.frames) + ctf_integer(u8, timecode_seconds, buf->timecode.seconds) + ctf_integer(u8, timecode_minutes, buf->timecode.minutes) + ctf_integer(u8, timecode_hours, buf->timecode.hours) + ctf_array(u8, timecode_userbits, buf->timecode.userbits, 4) + ctf_integer(u32, sequence, buf->sequence) + ) +) +#endif + +LTTNG_TRACEPOINT_EVENT_INSTANCE(v4l2_class, + v4l2_dqbuf, + + TP_PROTO(int minor, struct v4l2_buffer *buf), + + TP_ARGS(minor, buf) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(v4l2_class, + + v4l2_qbuf, + + TP_PROTO(int minor, struct v4l2_buffer *buf), + + TP_ARGS(minor, buf) +) + +#endif /* if !defined(LTTNG_TRACE_V4L2_H) || defined(TRACE_HEADER_MULTI_READ) */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/workqueue.h b/include/instrumentation/events/workqueue.h new file mode 100644 index 00000000..8ca0d6bf --- /dev/null +++ b/include/instrumentation/events/workqueue.h @@ -0,0 +1,132 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM workqueue + +#if !defined(LTTNG_TRACE_WORKQUEUE_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_WORKQUEUE_H + +#include +#include +#include + +#ifndef _TRACE_WORKQUEUE_DEF_ +#define _TRACE_WORKQUEUE_DEF_ + +struct worker; +struct global_cwq; + +#endif + +LTTNG_TRACEPOINT_EVENT_CLASS(workqueue_work, + + TP_PROTO(struct work_struct *work), + + TP_ARGS(work), + + TP_FIELDS( + ctf_integer_hex(void *, work, work) + ) +) + +/** + * workqueue_queue_work - called when a work gets queued + * @req_cpu: the requested cpu + * @cwq: pointer to struct cpu_workqueue_struct + * @work: pointer to struct work_struct + * + * This event occurs when a work is queued immediately or once a + * delayed work is actually queued on a workqueue (ie: once the delay + * has been reached). + */ +LTTNG_TRACEPOINT_EVENT(workqueue_queue_work, + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) + TP_PROTO(unsigned int req_cpu, struct pool_workqueue *pwq, + struct work_struct *work), + + TP_ARGS(req_cpu, pwq, work), +#else + TP_PROTO(unsigned int req_cpu, struct cpu_workqueue_struct *cwq, + struct work_struct *work), + + TP_ARGS(req_cpu, cwq, work), +#endif + + TP_FIELDS( + ctf_integer_hex(void *, work, work) + ctf_integer_hex(void *, function, work->func) + ctf_integer(unsigned int, req_cpu, req_cpu) + ) +) + +/** + * workqueue_activate_work - called when a work gets activated + * @work: pointer to struct work_struct + * + * This event occurs when a queued work is put on the active queue, + * which happens immediately after queueing unless @max_active limit + * is reached. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(workqueue_work, workqueue_activate_work, + + TP_PROTO(struct work_struct *work), + + TP_ARGS(work) +) + +/** + * workqueue_execute_start - called immediately before the workqueue callback + * @work: pointer to struct work_struct + * + * Allows to track workqueue execution. + */ +LTTNG_TRACEPOINT_EVENT(workqueue_execute_start, + + TP_PROTO(struct work_struct *work), + + TP_ARGS(work), + + TP_FIELDS( + ctf_integer_hex(void *, work, work) + ctf_integer_hex(void *, function, work->func) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) +/** + * workqueue_execute_end - called immediately after the workqueue callback + * @work: pointer to struct work_struct + * @function: pointer to worker function + * + * Allows to track workqueue execution. + */ +LTTNG_TRACEPOINT_EVENT(workqueue_execute_end, + + TP_PROTO(struct work_struct *work, work_func_t function), + + TP_ARGS(work, function), + + TP_FIELDS( + ctf_integer_hex(void *, work, work) + ctf_integer_hex(void *, function, function) + ) +) +#else +/** + * workqueue_execute_end - called immediately after the workqueue callback + * @work: pointer to struct work_struct + * + * Allows to track workqueue execution. + */ +LTTNG_TRACEPOINT_EVENT_INSTANCE(workqueue_work, workqueue_execute_end, + + TP_PROTO(struct work_struct *work), + + TP_ARGS(work) +) +#endif + +#endif /* LTTNG_TRACE_WORKQUEUE_H */ + +/* This part must be outside protection */ +#include diff --git a/include/instrumentation/events/writeback.h b/include/instrumentation/events/writeback.h new file mode 100644 index 00000000..fd898c51 --- /dev/null +++ b/include/instrumentation/events/writeback.h @@ -0,0 +1,732 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM writeback + +#if !defined(LTTNG_TRACE_WRITEBACK_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_WRITEBACK_H + +#include +#include +#include +#include +#include + +#ifndef _TRACE_WRITEBACK_DEF_ +#define _TRACE_WRITEBACK_DEF_ + +/* + * Vanilla kernels before 4.0 do not implement inode_to_bdi + * RHEL kernels before 3.10.0-327.10.1 do not implement inode_to_bdi + * RHEL kernel 3.10.0-327.10.1 has inode_to_bdi + * RHEL kernel 3.10.0-327.13.1 includes a partial merge of upstream + * commit a212b105b07d75b48b1a166378282e8a77fbf53d which inlines + * inode_to_bdi but not sb_is_blkdev_sb making it unusable by modules. + */ +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)) +static inline struct backing_dev_info *lttng_inode_to_bdi(struct inode *inode) +{ + struct super_block *sb; + + if (!inode) + return &noop_backing_dev_info; + + sb = inode->i_sb; + + if (strcmp(sb->s_type->name, "bdev") == 0) + return inode->i_mapping->backing_dev_info; + + return sb->s_bdi; +} +#else +static inline struct backing_dev_info *lttng_inode_to_bdi(struct inode *inode) +{ + return inode_to_bdi(inode); +} +#endif /* #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)) */ + +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) +#define show_inode_state(state) \ + __print_flags(state, "|", \ + {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \ + {I_DIRTY_DATASYNC, "I_DIRTY_DATASYNC"}, \ + {I_DIRTY_PAGES, "I_DIRTY_PAGES"}, \ + {I_NEW, "I_NEW"}, \ + {I_WILL_FREE, "I_WILL_FREE"}, \ + {I_FREEING, "I_FREEING"}, \ + {I_CLEAR, "I_CLEAR"}, \ + {I_SYNC, "I_SYNC"}, \ + {I_DIRTY_TIME, "I_DIRTY_TIME"}, \ + {I_DIRTY_TIME_EXPIRED, "I_DIRTY_TIME_EXPIRED"}, \ + {I_REFERENCED, "I_REFERENCED"} \ + ) +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */ +#define show_inode_state(state) \ + __print_flags(state, "|", \ + {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \ + {I_DIRTY_DATASYNC, "I_DIRTY_DATASYNC"}, \ + {I_DIRTY_PAGES, "I_DIRTY_PAGES"}, \ + {I_NEW, "I_NEW"}, \ + {I_WILL_FREE, "I_WILL_FREE"}, \ + {I_FREEING, "I_FREEING"}, \ + {I_CLEAR, "I_CLEAR"}, \ + {I_SYNC, "I_SYNC"}, \ + {I_REFERENCED, "I_REFERENCED"} \ + ) +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) + +LTTNG_TRACEPOINT_EVENT(writeback_dirty_page, + TP_PROTO(struct page *page, struct address_space *mapping), + TP_ARGS(page, mapping), + TP_FIELDS( + ctf_array_text(char, name, + mapping ? dev_name(lttng_inode_to_bdi(mapping->host)->dev) : "(unknown)", 32) + ctf_integer(unsigned long, ino, mapping ? mapping->host->i_ino : 0) + ctf_integer(pgoff_t, index, page->index) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(writeback_dirty_inode_template, + TP_PROTO(struct inode *inode, int flags), + TP_ARGS(inode, flags), + TP_FIELDS( + /* may be called for files on pseudo FSes w/ unregistered bdi */ + ctf_array_text(char, name, + lttng_inode_to_bdi(inode)->dev ? + dev_name(lttng_inode_to_bdi(inode)->dev) : "(unknown)", 32) + ctf_integer(unsigned long, ino, inode->i_ino) + ctf_integer(unsigned long, state, inode->i_state) + ctf_integer(unsigned long, flags, flags) + ) +) +#define LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(name) \ +LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_dirty_inode_template, name, \ + TP_PROTO(struct inode *inode, int flags), \ + TP_ARGS(inode, flags)) +LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode_start) +LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode) +LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_mark_inode_dirty) + +LTTNG_TRACEPOINT_EVENT_CLASS(writeback_write_inode_template, + TP_PROTO(struct inode *inode, struct writeback_control *wbc), + TP_ARGS(inode, wbc), + TP_FIELDS( + ctf_array_text(char, name, + dev_name(lttng_inode_to_bdi(inode)->dev), 32) + ctf_integer(unsigned long, ino, inode->i_ino) + ctf_integer(int, sync_mode, wbc->sync_mode) + ) +) + +#define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(name) \ +LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_write_inode_template, name, \ + TP_PROTO(struct inode *inode, struct writeback_control *wbc), \ + TP_ARGS(inode, wbc)) +LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode_start) +LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) + +LTTNG_TRACEPOINT_EVENT(writeback_dirty_page, + TP_PROTO(struct page *page, struct address_space *mapping), + TP_ARGS(page, mapping), + TP_FIELDS( + ctf_array_text(char, name, + mapping ? dev_name(mapping->backing_dev_info->dev) : "(unknown)", 32) + ctf_integer(unsigned long, ino, mapping ? mapping->host->i_ino : 0) + ctf_integer(pgoff_t, index, page->index) + ) +) + +LTTNG_TRACEPOINT_EVENT_CLASS(writeback_dirty_inode_template, + TP_PROTO(struct inode *inode, int flags), + TP_ARGS(inode, flags), + TP_FIELDS( + /* may be called for files on pseudo FSes w/ unregistered bdi */ + ctf_array_text(char, name, + inode->i_mapping->backing_dev_info->dev ? + dev_name(inode->i_mapping->backing_dev_info->dev) + : "(unknown)", 32) + ctf_integer(unsigned long, ino, inode->i_ino) + ctf_integer(unsigned long, flags, flags) + ) +) +#define LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(name) \ +LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_dirty_inode_template, name, \ + TP_PROTO(struct inode *inode, int flags), \ + TP_ARGS(inode, flags)) +LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode_start) +LTTNG_TRACEPOINT_EVENT_WRITEBACK_DIRTY_INODE_TEMPLATE(writeback_dirty_inode) + +LTTNG_TRACEPOINT_EVENT_CLASS(writeback_write_inode_template, + TP_PROTO(struct inode *inode, struct writeback_control *wbc), + TP_ARGS(inode, wbc), + TP_FIELDS( + ctf_array_text(char, name, + dev_name(inode->i_mapping->backing_dev_info->dev), 32) + ctf_integer(unsigned long, ino, inode->i_ino) + ctf_integer(int, sync_mode, wbc->sync_mode) + ) +) + +#define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(name) \ +LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_write_inode_template, name, \ + TP_PROTO(struct inode *inode, struct writeback_control *wbc), \ + TP_ARGS(inode, wbc)) +LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode_start) +LTTNG_TRACEPOINT_EVENT_WRITEBACK_WRITE_INODE(writeback_write_inode) + +#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) + +LTTNG_TRACEPOINT_EVENT_CLASS(writeback_work_class, + TP_PROTO(struct bdi_writeback *wb, struct wb_writeback_work *work), + TP_ARGS(wb, work), + TP_FIELDS( + ctf_array_text(char, name, wb->bdi->dev ? dev_name(wb->bdi->dev) : + "(unknown)", 32) + ) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) + +LTTNG_TRACEPOINT_EVENT_CLASS(writeback_work_class, + TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work), + TP_ARGS(bdi, work), + TP_FIELDS( + ctf_array_text(char, name, bdi->dev ? dev_name(bdi->dev) : + "(unknown)", 32) + ) +) + +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */ + +LTTNG_TRACEPOINT_EVENT_CLASS(writeback_work_class, + TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work), + TP_ARGS(bdi, work), + TP_FIELDS( + ctf_array_text(char, name, + dev_name(bdi->dev ? bdi->dev : + default_backing_dev_info.dev), 32) + ) +) + +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)) */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) + +#define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(name) \ +LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_work_class, name, \ + TP_PROTO(struct bdi_writeback *wb, struct wb_writeback_work *work), \ + TP_ARGS(wb, work)) + +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ + +#define LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(name) \ +LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_work_class, name, \ + TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work), \ + TP_ARGS(bdi, work)) + +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ + +LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_nothread) +LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_queue) +LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_exec) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) +LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_start) +LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_written) +LTTNG_TRACEPOINT_EVENT_WRITEBACK_WORK_INSTANCE(writeback_wait) +#endif + +LTTNG_TRACEPOINT_EVENT(writeback_pages_written, + TP_PROTO(long pages_written), + TP_ARGS(pages_written), + TP_FIELDS( + ctf_integer(long, pages, pages_written) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) + +LTTNG_TRACEPOINT_EVENT_CLASS(writeback_class, + TP_PROTO(struct bdi_writeback *wb), + TP_ARGS(wb), + TP_FIELDS( + ctf_array_text(char, name, + dev_name(wb->bdi->dev), 32) + ) +) + +#undef DEFINE_WRITEBACK_EVENT +#define DEFINE_WRITEBACK_EVENT(name) \ +LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_class, name, \ + TP_PROTO(struct bdi_writeback *wb), \ + TP_ARGS(wb)) + +#define DEFINE_WRITEBACK_EVENT_MAP(name, map) \ +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(writeback_class, name, map, \ + TP_PROTO(struct bdi_writeback *wb), \ + TP_ARGS(wb)) + +LTTNG_TRACEPOINT_EVENT(writeback_bdi_register, + TP_PROTO(struct backing_dev_info *bdi), + TP_ARGS(bdi), + TP_FIELDS( + ctf_array_text(char, name, + dev_name(bdi->dev), 32) + ) +) + +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ + +LTTNG_TRACEPOINT_EVENT_CLASS(writeback_class, + TP_PROTO(struct backing_dev_info *bdi), + TP_ARGS(bdi), + TP_FIELDS( + ctf_array_text(char, name, + dev_name(bdi->dev), 32) + ) +) + +#undef DEFINE_WRITEBACK_EVENT +#define DEFINE_WRITEBACK_EVENT(name) \ +LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_class, name, \ + TP_PROTO(struct backing_dev_info *bdi), \ + TP_ARGS(bdi)) + +#define DEFINE_WRITEBACK_EVENT_MAP(name, map) \ +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(writeback_class, name, map, \ + TP_PROTO(struct backing_dev_info *bdi), \ + TP_ARGS(bdi)) + +DEFINE_WRITEBACK_EVENT(writeback_bdi_register) + +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ + +DEFINE_WRITEBACK_EVENT(writeback_nowork) +DEFINE_WRITEBACK_EVENT(writeback_wake_background) +DEFINE_WRITEBACK_EVENT(writeback_wake_thread) +DEFINE_WRITEBACK_EVENT(writeback_wake_forker_thread) +DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister) +DEFINE_WRITEBACK_EVENT(writeback_thread_start) +DEFINE_WRITEBACK_EVENT(writeback_thread_stop) +#if (LTTNG_KERNEL_RANGE(3,1,0, 3,2,0)) +DEFINE_WRITEBACK_EVENT_MAP(balance_dirty_start, writeback_balance_dirty_start) +DEFINE_WRITEBACK_EVENT_MAP(balance_dirty_wait, writeback_balance_dirty_wait) + +LTTNG_TRACEPOINT_EVENT_MAP(balance_dirty_written, + + writeback_balance_dirty_written, + + TP_PROTO(struct backing_dev_info *bdi, int written), + + TP_ARGS(bdi, written), + + TP_FIELDS( + ctf_array_text(char, name, dev_name(bdi->dev), 32) + ctf_integer(int, written, written) + ) +) +#endif + +LTTNG_TRACEPOINT_EVENT_CLASS(writeback_wbc_class, + TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), + TP_ARGS(wbc, bdi), + TP_FIELDS( + ctf_array_text(char, name, dev_name(bdi->dev), 32) + ctf_integer(long, nr_to_write, wbc->nr_to_write) + ctf_integer(long, pages_skipped, wbc->pages_skipped) + ctf_integer(int, sync_mode, wbc->sync_mode) + ctf_integer(int, for_kupdate, wbc->for_kupdate) + ctf_integer(int, for_background, wbc->for_background) + ctf_integer(int, for_reclaim, wbc->for_reclaim) + ctf_integer(int, range_cyclic, wbc->range_cyclic) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)) + ctf_integer(int, more_io, wbc->more_io) + ctf_integer(unsigned long, older_than_this, + wbc->older_than_this ? *wbc->older_than_this : 0) +#endif + ctf_integer(long, range_start, (long) wbc->range_start) + ctf_integer(long, range_end, (long) wbc->range_end) + ) +) + +#undef DEFINE_WBC_EVENT +#define LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(name, map) \ +LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(writeback_wbc_class, name, map, \ + TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \ + TP_ARGS(wbc, bdi)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)) +LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writeback_start, writeback_wbc_writeback_start) +LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writeback_written, writeback_wbc_writeback_written) +LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writeback_wait, writeback_wbc_writeback_wait) +LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_balance_dirty_start, writeback_wbc_balance_dirty_start) +LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_balance_dirty_written, writeback_wbc_balance_dirty_written) +LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_balance_dirty_wait, writeback_wbc_balance_dirty_wait) +#endif +LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writepage, writeback_wbc_writepage) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) +LTTNG_TRACEPOINT_EVENT(writeback_queue_io, + TP_PROTO(struct bdi_writeback *wb, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) + struct wb_writeback_work *work, +#else + unsigned long *older_than_this, +#endif + int moved), +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) + TP_ARGS(wb, work, moved), +#else + TP_ARGS(wb, older_than_this, moved), +#endif + TP_FIELDS( + ctf_array_text(char, name, dev_name(wb->bdi->dev), 32) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) +#else + ctf_integer(unsigned long, older, + older_than_this ? *older_than_this : 0) + ctf_integer(long, age, + older_than_this ? + (jiffies - *older_than_this) * 1000 / HZ + : -1) +#endif + ctf_integer(int, moved, moved) + ) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) +LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_state, + + writeback_global_dirty_state, + + TP_PROTO(unsigned long background_thresh, + unsigned long dirty_thresh + ), + + TP_ARGS(background_thresh, + dirty_thresh + ), + + TP_FIELDS( + ctf_integer(unsigned long, nr_dirty, global_node_page_state(NR_FILE_DIRTY)) + ctf_integer(unsigned long, nr_writeback, global_node_page_state(NR_WRITEBACK)) + ctf_integer(unsigned long, nr_unstable, global_node_page_state(NR_UNSTABLE_NFS)) + ctf_integer(unsigned long, nr_dirtied, global_node_page_state(NR_DIRTIED)) + ctf_integer(unsigned long, nr_written, global_node_page_state(NR_WRITTEN)) + ctf_integer(unsigned long, background_thresh, background_thresh) + ctf_integer(unsigned long, dirty_thresh, dirty_thresh) + ctf_integer(unsigned long, dirty_limit, global_dirty_limit) + ) +) +#else +LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_state, + + writeback_global_dirty_state, + + TP_PROTO(unsigned long background_thresh, + unsigned long dirty_thresh + ), + + TP_ARGS(background_thresh, + dirty_thresh + ), + + TP_FIELDS( + ctf_integer(unsigned long, nr_dirty, global_page_state(NR_FILE_DIRTY)) + ctf_integer(unsigned long, nr_writeback, global_page_state(NR_WRITEBACK)) + ctf_integer(unsigned long, nr_unstable, global_page_state(NR_UNSTABLE_NFS)) + ctf_integer(unsigned long, nr_dirtied, global_page_state(NR_DIRTIED)) + ctf_integer(unsigned long, nr_written, global_page_state(NR_WRITTEN)) + ctf_integer(unsigned long, background_thresh, background_thresh) + ctf_integer(unsigned long, dirty_thresh, dirty_thresh) + ctf_integer(unsigned long, dirty_limit, global_dirty_limit) + ) +) +#endif +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) + +#define KBps(x) ((x) << (PAGE_SHIFT - 10)) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) + +LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit, + + writeback_bdi_dirty_ratelimit, + + TP_PROTO(struct bdi_writeback *wb, + unsigned long dirty_rate, + unsigned long task_ratelimit), + + TP_ARGS(wb, dirty_rate, task_ratelimit), + + TP_FIELDS( + ctf_array_text(char, bdi, dev_name(wb->bdi->dev), 32) + ctf_integer(unsigned long, write_bw, KBps(wb->bdi->wb.write_bandwidth)) + ctf_integer(unsigned long, avg_write_bw, KBps(wb->bdi->wb.avg_write_bandwidth)) + ctf_integer(unsigned long, dirty_rate, KBps(dirty_rate)) + ctf_integer(unsigned long, dirty_ratelimit, KBps(wb->bdi->wb.dirty_ratelimit)) + ctf_integer(unsigned long, task_ratelimit, KBps(task_ratelimit)) + ctf_integer(unsigned long, balanced_dirty_ratelimit, + KBps(wb->bdi->wb.balanced_dirty_ratelimit)) + ) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) + +LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit, + + writeback_bdi_dirty_ratelimit, + + TP_PROTO(struct backing_dev_info *bdi, + unsigned long dirty_rate, + unsigned long task_ratelimit), + + TP_ARGS(bdi, dirty_rate, task_ratelimit), + + TP_FIELDS( + ctf_array_text(char, bdi, dev_name(bdi->dev), 32) + ctf_integer(unsigned long, write_bw, KBps(bdi->wb.write_bandwidth)) + ctf_integer(unsigned long, avg_write_bw, KBps(bdi->wb.avg_write_bandwidth)) + ctf_integer(unsigned long, dirty_rate, KBps(dirty_rate)) + ctf_integer(unsigned long, dirty_ratelimit, KBps(bdi->wb.dirty_ratelimit)) + ctf_integer(unsigned long, task_ratelimit, KBps(task_ratelimit)) + ctf_integer(unsigned long, balanced_dirty_ratelimit, + KBps(bdi->wb.balanced_dirty_ratelimit)) + ) +) + +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ + +LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit, + + writeback_bdi_dirty_ratelimit, + + TP_PROTO(struct backing_dev_info *bdi, + unsigned long dirty_rate, + unsigned long task_ratelimit), + + TP_ARGS(bdi, dirty_rate, task_ratelimit), + + TP_FIELDS( + ctf_array_text(char, bdi, dev_name(bdi->dev), 32) + ctf_integer(unsigned long, write_bw, KBps(bdi->write_bandwidth)) + ctf_integer(unsigned long, avg_write_bw, KBps(bdi->avg_write_bandwidth)) + ctf_integer(unsigned long, dirty_rate, KBps(dirty_rate)) + ctf_integer(unsigned long, dirty_ratelimit, KBps(bdi->dirty_ratelimit)) + ctf_integer(unsigned long, task_ratelimit, KBps(task_ratelimit)) + ctf_integer(unsigned long, balanced_dirty_ratelimit, + KBps(bdi->balanced_dirty_ratelimit)) + ) +) + +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)) */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) + +LTTNG_TRACEPOINT_EVENT_MAP(balance_dirty_pages, + + writeback_balance_dirty_pages, + + TP_PROTO(struct bdi_writeback *wb, + unsigned long thresh, + unsigned long bg_thresh, + unsigned long dirty, + unsigned long bdi_thresh, + unsigned long bdi_dirty, + unsigned long dirty_ratelimit, + unsigned long task_ratelimit, + unsigned long dirtied, + unsigned long period, + long pause, + unsigned long start_time), + + TP_ARGS(wb, thresh, bg_thresh, dirty, bdi_thresh, bdi_dirty, + dirty_ratelimit, task_ratelimit, + dirtied, period, pause, start_time + ), + + TP_FIELDS( + ctf_array_text(char, bdi, dev_name(wb->bdi->dev), 32) + ctf_integer(unsigned long, limit, global_dirty_limit) + ctf_integer(unsigned long, setpoint, + (global_dirty_limit + (thresh + bg_thresh) / 2) / 2) + ctf_integer(unsigned long, dirty, dirty) + ctf_integer(unsigned long, bdi_setpoint, + ((global_dirty_limit + (thresh + bg_thresh) / 2) / 2) * + bdi_thresh / (thresh + 1)) + ctf_integer(unsigned long, bdi_dirty, bdi_dirty) + ctf_integer(unsigned long, dirty_ratelimit, + KBps(dirty_ratelimit)) + ctf_integer(unsigned long, task_ratelimit, + KBps(task_ratelimit)) + ctf_integer(unsigned int, dirtied, dirtied) + ctf_integer(unsigned int, dirtied_pause, + current->nr_dirtied_pause) + ctf_integer(unsigned long, paused, + (jiffies - start_time) * 1000 / HZ) + ctf_integer(long, pause, pause * 1000 / HZ) + ctf_integer(unsigned long, period, + period * 1000 / HZ) + ctf_integer(long, think, + current->dirty_paused_when == 0 ? 0 : + (long)(jiffies - current->dirty_paused_when) * 1000/HZ) + ) +) + +#else /* #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ + +LTTNG_TRACEPOINT_EVENT_MAP(balance_dirty_pages, + + writeback_balance_dirty_pages, + + TP_PROTO(struct backing_dev_info *bdi, + unsigned long thresh, + unsigned long bg_thresh, + unsigned long dirty, + unsigned long bdi_thresh, + unsigned long bdi_dirty, + unsigned long dirty_ratelimit, + unsigned long task_ratelimit, + unsigned long dirtied, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) + unsigned long period, +#endif + long pause, + unsigned long start_time), + + TP_ARGS(bdi, thresh, bg_thresh, dirty, bdi_thresh, bdi_dirty, + dirty_ratelimit, task_ratelimit, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) + dirtied, period, pause, start_time +#else + dirtied, pause, start_time +#endif + ), + + TP_FIELDS( + ctf_array_text(char, bdi, dev_name(bdi->dev), 32) + ctf_integer(unsigned long, limit, global_dirty_limit) + ctf_integer(unsigned long, setpoint, + (global_dirty_limit + (thresh + bg_thresh) / 2) / 2) + ctf_integer(unsigned long, dirty, dirty) + ctf_integer(unsigned long, bdi_setpoint, + ((global_dirty_limit + (thresh + bg_thresh) / 2) / 2) * + bdi_thresh / (thresh + 1)) + ctf_integer(unsigned long, bdi_dirty, bdi_dirty) + ctf_integer(unsigned long, dirty_ratelimit, + KBps(dirty_ratelimit)) + ctf_integer(unsigned long, task_ratelimit, + KBps(task_ratelimit)) + ctf_integer(unsigned int, dirtied, dirtied) + ctf_integer(unsigned int, dirtied_pause, + current->nr_dirtied_pause) + ctf_integer(unsigned long, paused, + (jiffies - start_time) * 1000 / HZ) + ctf_integer(long, pause, pause * 1000 / HZ) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) + ctf_integer(unsigned long, period, + period * 1000 / HZ) + ctf_integer(long, think, + current->dirty_paused_when == 0 ? 0 : + (long)(jiffies - current->dirty_paused_when) * 1000/HZ) +#endif + ) +) +#endif /* #else #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */ + +#endif /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) +LTTNG_TRACEPOINT_EVENT(writeback_sb_inodes_requeue, + + TP_PROTO(struct inode *inode), + TP_ARGS(inode), + + TP_FIELDS( + ctf_array_text(char, name, + dev_name(lttng_inode_to_bdi(inode)->dev), 32) + ctf_integer(unsigned long, ino, inode->i_ino) + ctf_integer(unsigned long, state, inode->i_state) + ctf_integer(unsigned long, dirtied_when, inode->dirtied_when) + ) +) +#endif + +LTTNG_TRACEPOINT_EVENT_CLASS(writeback_congest_waited_template, + + TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), + + TP_ARGS(usec_timeout, usec_delayed), + + TP_FIELDS( + ctf_integer(unsigned int, usec_timeout, usec_timeout) + ctf_integer(unsigned int, usec_delayed, usec_delayed) + ) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_congest_waited_template, writeback_congestion_wait, + + TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), + + TP_ARGS(usec_timeout, usec_delayed) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_congest_waited_template, writeback_wait_iff_congested, + + TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), + + TP_ARGS(usec_timeout, usec_delayed) +) + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) +LTTNG_TRACEPOINT_EVENT_CLASS(writeback_single_inode_template, + + TP_PROTO(struct inode *inode, + struct writeback_control *wbc, + unsigned long nr_to_write + ), + + TP_ARGS(inode, wbc, nr_to_write), + + TP_FIELDS( + ctf_array_text(char, name, + dev_name(lttng_inode_to_bdi(inode)->dev), 32) + ctf_integer(unsigned long, ino, inode->i_ino) + ctf_integer(unsigned long, state, inode->i_state) + ctf_integer(unsigned long, dirtied_when, inode->dirtied_when) + ctf_integer(unsigned long, writeback_index, + inode->i_mapping->writeback_index) + ctf_integer(long, nr_to_write, nr_to_write) + ctf_integer(unsigned long, wrote, + nr_to_write - wbc->nr_to_write) + ) +) + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) +LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_single_inode_template, writeback_single_inode_requeue, + TP_PROTO(struct inode *inode, + struct writeback_control *wbc, + unsigned long nr_to_write), + TP_ARGS(inode, wbc, nr_to_write) +) +#endif + +LTTNG_TRACEPOINT_EVENT_INSTANCE(writeback_single_inode_template, writeback_single_inode, + TP_PROTO(struct inode *inode, + struct writeback_control *wbc, + unsigned long nr_to_write), + TP_ARGS(inode, wbc, nr_to_write) +) +#endif + +#endif /* LTTNG_TRACE_WRITEBACK_H */ + +/* This part must be outside protection */ +#include diff --git a/lttng-statedump-impl.c b/lttng-statedump-impl.c index da05924f..1a2a12ba 100644 --- a/lttng-statedump-impl.c +++ b/lttng-statedump-impl.c @@ -50,10 +50,10 @@ /* Define the tracepoints, but do not build the probes */ #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events #define TRACE_INCLUDE_FILE lttng-statedump #define LTTNG_INSTRUMENTATION -#include +#include DEFINE_TRACE(lttng_statedump_block_device); DEFINE_TRACE(lttng_statedump_end); diff --git a/probes/lttng-probe-9p.c b/probes/lttng-probe-9p.c index 0da7cf4a..ec588e44 100644 --- a/probes/lttng-probe-9p.c +++ b/probes/lttng-probe-9p.c @@ -24,9 +24,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Michael Jeanson "); diff --git a/probes/lttng-probe-asoc.c b/probes/lttng-probe-asoc.c index ce73cea5..6cac9c6b 100644 --- a/probes/lttng-probe-asoc.c +++ b/probes/lttng-probe-asoc.c @@ -24,9 +24,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Wade Farnsworth "); diff --git a/probes/lttng-probe-block.c b/probes/lttng-probe-block.c index eceed5df..5f8e830f 100644 --- a/probes/lttng-probe-block.c +++ b/probes/lttng-probe-block.c @@ -25,9 +25,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Mathieu Desnoyers "); diff --git a/probes/lttng-probe-btrfs.c b/probes/lttng-probe-btrfs.c index b6a38eee..4461c998 100644 --- a/probes/lttng-probe-btrfs.c +++ b/probes/lttng-probe-btrfs.c @@ -31,9 +31,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Andrew Gabbasov "); diff --git a/probes/lttng-probe-compaction.c b/probes/lttng-probe-compaction.c index 225eef45..f8ddf384 100644 --- a/probes/lttng-probe-compaction.c +++ b/probes/lttng-probe-compaction.c @@ -22,9 +22,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Andrew Gabbasov "); diff --git a/probes/lttng-probe-ext3.c b/probes/lttng-probe-ext3.c index a66241fe..70adb56a 100644 --- a/probes/lttng-probe-ext3.c +++ b/probes/lttng-probe-ext3.c @@ -31,9 +31,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Wade Farnsworth , Paul Woegerer , and Andrew Gabbasov "); diff --git a/probes/lttng-probe-ext4.c b/probes/lttng-probe-ext4.c index 4f089f6f..0d0e3a82 100644 --- a/probes/lttng-probe-ext4.c +++ b/probes/lttng-probe-ext4.c @@ -30,9 +30,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Andrew Gabbasov "); diff --git a/probes/lttng-probe-gpio.c b/probes/lttng-probe-gpio.c index e3c99efc..42b9b13f 100644 --- a/probes/lttng-probe-gpio.c +++ b/probes/lttng-probe-gpio.c @@ -22,9 +22,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Wade Farnsworth "); diff --git a/probes/lttng-probe-i2c.c b/probes/lttng-probe-i2c.c index 7c99bf86..9dc1c79e 100644 --- a/probes/lttng-probe-i2c.c +++ b/probes/lttng-probe-i2c.c @@ -23,7 +23,7 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events static int extract_sensitive_payload; module_param(extract_sensitive_payload, int, 0644); @@ -31,7 +31,7 @@ MODULE_PARM_DESC(extract_sensitive_payload, "Whether to extract possibly sensitive data from events (i2c " "buffer contents) or not (1 or 0, default: 0)."); -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Simon Marchi "); diff --git a/probes/lttng-probe-irq.c b/probes/lttng-probe-irq.c index fec72766..f88093b8 100644 --- a/probes/lttng-probe-irq.c +++ b/probes/lttng-probe-irq.c @@ -24,9 +24,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Mathieu Desnoyers "); diff --git a/probes/lttng-probe-jbd.c b/probes/lttng-probe-jbd.c index f6f89336..21c07982 100644 --- a/probes/lttng-probe-jbd.c +++ b/probes/lttng-probe-jbd.c @@ -22,9 +22,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Wade Farnsworth , Paul Woegerer , and Andrew Gabbasov "); diff --git a/probes/lttng-probe-jbd2.c b/probes/lttng-probe-jbd2.c index 007cf1e1..ac3ac936 100644 --- a/probes/lttng-probe-jbd2.c +++ b/probes/lttng-probe-jbd2.c @@ -24,9 +24,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Wade Farnsworth "); diff --git a/probes/lttng-probe-kmem.c b/probes/lttng-probe-kmem.c index 96340b04..1b120ab8 100644 --- a/probes/lttng-probe-kmem.c +++ b/probes/lttng-probe-kmem.c @@ -30,9 +30,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Wade Farnsworth "); diff --git a/probes/lttng-probe-kvm-x86-mmu.c b/probes/lttng-probe-kvm-x86-mmu.c index b915d365..9ccc2422 100644 --- a/probes/lttng-probe-kvm-x86-mmu.c +++ b/probes/lttng-probe-kvm-x86-mmu.c @@ -35,8 +35,8 @@ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module/arch/x86/kvm -#include +#define TRACE_INCLUDE_PATH instrumentation/events/arch/x86/kvm +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Mathieu Desnoyers "); diff --git a/probes/lttng-probe-kvm-x86.c b/probes/lttng-probe-kvm-x86.c index 30a6cc0c..4e4f5c83 100644 --- a/probes/lttng-probe-kvm-x86.c +++ b/probes/lttng-probe-kvm-x86.c @@ -36,8 +36,8 @@ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module/arch/x86/kvm -#include +#define TRACE_INCLUDE_PATH instrumentation/events/arch/x86/kvm +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Mathieu Desnoyers "); diff --git a/probes/lttng-probe-kvm.c b/probes/lttng-probe-kvm.c index 93044657..8b30f26a 100644 --- a/probes/lttng-probe-kvm.c +++ b/probes/lttng-probe-kvm.c @@ -24,9 +24,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Mathieu Desnoyers "); diff --git a/probes/lttng-probe-lock.c b/probes/lttng-probe-lock.c index 0890e591..2ab91385 100644 --- a/probes/lttng-probe-lock.c +++ b/probes/lttng-probe-lock.c @@ -24,9 +24,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Wade Farnsworth and Andrew Gabbasov "); diff --git a/probes/lttng-probe-module.c b/probes/lttng-probe-module.c index c0ddf43e..4f4f4a5b 100644 --- a/probes/lttng-probe-module.c +++ b/probes/lttng-probe-module.c @@ -24,9 +24,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Wade Farnsworth "); diff --git a/probes/lttng-probe-napi.c b/probes/lttng-probe-napi.c index 35a8e109..ce2bf8cc 100644 --- a/probes/lttng-probe-napi.c +++ b/probes/lttng-probe-napi.c @@ -24,9 +24,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Wade Farnsworth "); diff --git a/probes/lttng-probe-net.c b/probes/lttng-probe-net.c index c6e7fc56..a0ef450c 100644 --- a/probes/lttng-probe-net.c +++ b/probes/lttng-probe-net.c @@ -22,9 +22,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Wade Farnsworth "); diff --git a/probes/lttng-probe-power.c b/probes/lttng-probe-power.c index b72d3008..d5ac38f9 100644 --- a/probes/lttng-probe-power.c +++ b/probes/lttng-probe-power.c @@ -24,9 +24,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Wade Farnsworth "); diff --git a/probes/lttng-probe-preemptirq.c b/probes/lttng-probe-preemptirq.c index d47152f7..497b2de4 100644 --- a/probes/lttng-probe-preemptirq.c +++ b/probes/lttng-probe-preemptirq.c @@ -23,9 +23,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Michael Jeanson "); diff --git a/probes/lttng-probe-printk.c b/probes/lttng-probe-printk.c index db32ac60..3a37826e 100644 --- a/probes/lttng-probe-printk.c +++ b/probes/lttng-probe-printk.c @@ -22,9 +22,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Andrew Gabbasov "); diff --git a/probes/lttng-probe-random.c b/probes/lttng-probe-random.c index 6f7787a7..4cf6ce80 100644 --- a/probes/lttng-probe-random.c +++ b/probes/lttng-probe-random.c @@ -22,9 +22,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Andrew Gabbasov "); diff --git a/probes/lttng-probe-rcu.c b/probes/lttng-probe-rcu.c index 0d9f0f53..89c7213b 100644 --- a/probes/lttng-probe-rcu.c +++ b/probes/lttng-probe-rcu.c @@ -23,9 +23,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Andrew Gabbasov "); diff --git a/probes/lttng-probe-regmap.c b/probes/lttng-probe-regmap.c index 30aab4f3..f3eaef8c 100644 --- a/probes/lttng-probe-regmap.c +++ b/probes/lttng-probe-regmap.c @@ -27,9 +27,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Andrew Gabbasov "); diff --git a/probes/lttng-probe-regulator.c b/probes/lttng-probe-regulator.c index 4a7b24b9..8f457711 100644 --- a/probes/lttng-probe-regulator.c +++ b/probes/lttng-probe-regulator.c @@ -22,9 +22,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Wade Farnsworth "); diff --git a/probes/lttng-probe-rpm.c b/probes/lttng-probe-rpm.c index bb0b58a9..eea7bc38 100644 --- a/probes/lttng-probe-rpm.c +++ b/probes/lttng-probe-rpm.c @@ -23,9 +23,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Andrew Gabbasov "); diff --git a/probes/lttng-probe-sched.c b/probes/lttng-probe-sched.c index f369d810..ba1b3f72 100644 --- a/probes/lttng-probe-sched.c +++ b/probes/lttng-probe-sched.c @@ -23,9 +23,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Mathieu Desnoyers "); diff --git a/probes/lttng-probe-scsi.c b/probes/lttng-probe-scsi.c index f220cfe8..a367c51e 100644 --- a/probes/lttng-probe-scsi.c +++ b/probes/lttng-probe-scsi.c @@ -23,9 +23,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Wade Farnsworth "); diff --git a/probes/lttng-probe-signal.c b/probes/lttng-probe-signal.c index 3c270f90..aee94681 100644 --- a/probes/lttng-probe-signal.c +++ b/probes/lttng-probe-signal.c @@ -21,9 +21,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Mathieu Desnoyers "); diff --git a/probes/lttng-probe-skb.c b/probes/lttng-probe-skb.c index f471fd3e..682a9f09 100644 --- a/probes/lttng-probe-skb.c +++ b/probes/lttng-probe-skb.c @@ -24,9 +24,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Wade Farnsworth "); diff --git a/probes/lttng-probe-sock.c b/probes/lttng-probe-sock.c index 2f57d813..f3e1ebf4 100644 --- a/probes/lttng-probe-sock.c +++ b/probes/lttng-probe-sock.c @@ -22,9 +22,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Wade Farnsworth "); diff --git a/probes/lttng-probe-statedump.c b/probes/lttng-probe-statedump.c index ea07697f..81e0613f 100644 --- a/probes/lttng-probe-statedump.c +++ b/probes/lttng-probe-statedump.c @@ -24,10 +24,10 @@ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS #define TP_SESSION_CHECK -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events #define TRACE_INCLUDE_FILE lttng-statedump -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Mathieu Desnoyers "); diff --git a/probes/lttng-probe-sunrpc.c b/probes/lttng-probe-sunrpc.c index 3953d8c5..2244a57f 100644 --- a/probes/lttng-probe-sunrpc.c +++ b/probes/lttng-probe-sunrpc.c @@ -22,9 +22,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Andrew Gabbasov "); diff --git a/probes/lttng-probe-timer.c b/probes/lttng-probe-timer.c index b5ef884b..149fcbcb 100644 --- a/probes/lttng-probe-timer.c +++ b/probes/lttng-probe-timer.c @@ -25,9 +25,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Mathieu Desnoyers "); diff --git a/probes/lttng-probe-udp.c b/probes/lttng-probe-udp.c index 495c0afd..ad7707b5 100644 --- a/probes/lttng-probe-udp.c +++ b/probes/lttng-probe-udp.c @@ -22,9 +22,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Wade Farnsworth "); diff --git a/probes/lttng-probe-v4l2.c b/probes/lttng-probe-v4l2.c index b5ebffab..0c86da04 100644 --- a/probes/lttng-probe-v4l2.c +++ b/probes/lttng-probe-v4l2.c @@ -24,9 +24,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Wade Farnsworth "); diff --git a/probes/lttng-probe-vmscan.c b/probes/lttng-probe-vmscan.c index eb41c545..8e1f605a 100644 --- a/probes/lttng-probe-vmscan.c +++ b/probes/lttng-probe-vmscan.c @@ -24,9 +24,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Wade Farnsworth "); diff --git a/probes/lttng-probe-workqueue.c b/probes/lttng-probe-workqueue.c index dd5308ea..57cd5602 100644 --- a/probes/lttng-probe-workqueue.c +++ b/probes/lttng-probe-workqueue.c @@ -28,9 +28,9 @@ struct pool_workqueue; */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Andrew Gabbasov "); diff --git a/probes/lttng-probe-writeback.c b/probes/lttng-probe-writeback.c index 5db92f6e..727f2b7f 100644 --- a/probes/lttng-probe-writeback.c +++ b/probes/lttng-probe-writeback.c @@ -33,9 +33,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Andrew Gabbasov "); diff --git a/probes/lttng-probe-x86-exceptions.c b/probes/lttng-probe-x86-exceptions.c index b7ded802..4a7d4e4c 100644 --- a/probes/lttng-probe-x86-exceptions.c +++ b/probes/lttng-probe-x86-exceptions.c @@ -26,9 +26,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module/arch/x86 +#define TRACE_INCLUDE_PATH instrumentation/events/arch/x86 -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Mathieu Desnoyers "); diff --git a/probes/lttng-probe-x86-irq-vectors.c b/probes/lttng-probe-x86-irq-vectors.c index 5a3da868..1f644061 100644 --- a/probes/lttng-probe-x86-irq-vectors.c +++ b/probes/lttng-probe-x86-irq-vectors.c @@ -26,9 +26,9 @@ */ #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module/arch/x86 +#define TRACE_INCLUDE_PATH instrumentation/events/arch/x86 -#include +#include MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Mathieu Desnoyers "); diff --git a/probes/lttng.c b/probes/lttng.c index 0d3182ff..8a0dd4b8 100644 --- a/probes/lttng.c +++ b/probes/lttng.c @@ -22,11 +22,11 @@ #define TP_MODULE_NOAUTOLOAD #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events #define TRACE_INCLUDE_FILE lttng #define LTTNG_INSTRUMENTATION -#include +#include /* Events written through logger are truncated at 1024 bytes */ #define LTTNG_LOGGER_COUNT_MAX 1024 diff --git a/tests/probes/lttng-test.c b/tests/probes/lttng-test.c index ea273893..5064a685 100644 --- a/tests/probes/lttng-test.c +++ b/tests/probes/lttng-test.c @@ -20,10 +20,10 @@ #define TP_MODULE_NOAUTOLOAD #define LTTNG_PACKAGE_BUILD #define CREATE_TRACE_POINTS -#define TRACE_INCLUDE_PATH instrumentation/events/lttng-module +#define TRACE_INCLUDE_PATH instrumentation/events #define TRACE_INCLUDE_FILE lttng-test #define LTTNG_INSTRUMENTATION -#include +#include DEFINE_TRACE(lttng_test_filter_event);