X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=instrumentation%2Fevents%2Flttng-module%2Fwriteback.h;h=85ad03c65162224c3bbd6b930f43aee44ecf084e;hb=78f56ae3a0c007bf1be7e01731d372f79fe6781e;hp=c988a9d7e83eb3440a305135ecb477d55a0f3d2d;hpb=43b2b999b5f184f3b42c8c9c790f46ee794a894c;p=lttng-modules.git diff --git a/instrumentation/events/lttng-module/writeback.h b/instrumentation/events/lttng-module/writeback.h index c988a9d7..85ad03c6 100644 --- a/instrumentation/events/lttng-module/writeback.h +++ b/instrumentation/events/lttng-module/writeback.h @@ -14,9 +14,12 @@ #ifndef _TRACE_WRITEBACK_DEF_ #define _TRACE_WRITEBACK_DEF_ -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0) || \ - LTTNG_KERNEL_RANGE(5,5,3, 5,6,0) || \ - LTTNG_KERNEL_RANGE(5,4,19, 5,5,0)) +/* + * Use the GPL-exported bdi_dev_name introduced in kernel 5.7. Do not use + * static inline bdi_dev_name in prior kernels because it uses the bdi_unknown_name + * symbol which is not exported to GPL modules. + */ +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,7,0)) static inline const char *lttng_bdi_dev_name(struct backing_dev_info *bdi) { return bdi_dev_name(bdi); @@ -62,7 +65,18 @@ static inline struct backing_dev_info *lttng_inode_to_bdi(struct inode *inode) #endif -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,9,0)) +/* + * Keep this macro around to track changes in the valid values for `state`. + * Eventually, we will have a enum to describe that field. If the macro is + * changed by an upstream kernel, the fact that we have a redefinition here + * will generate a compiler warning. + */ +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,9,0) || \ + LTTNG_KERNEL_RANGE(4,14,218, 4,15,0) || \ + LTTNG_KERNEL_RANGE(4,19,172, 4,20,0) || \ + LTTNG_KERNEL_RANGE(5,4,94, 5,5,0) || \ + LTTNG_UBUNTU_KERNEL_RANGE(4,15,18,141, 4,16,0,0) || \ + LTTNG_RHEL_KERNEL_RANGE(4,18,0,240,0,0, 4,19,0,0,0,0)) #define show_inode_state(state) \ __print_flags(state, "|", \ {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \ @@ -381,7 +395,8 @@ LTTNG_TRACEPOINT_EVENT_WBC_INSTANCE(wbc_writepage, writeback_wbc_writepage) LTTNG_KERNEL_RANGE(4,14,196, 4,15,0) || \ LTTNG_KERNEL_RANGE(4,9,235, 4,10,0) || \ LTTNG_KERNEL_RANGE(4,4,235, 4,5,0) || \ - LTTNG_UBUNTU_KERNEL_RANGE(4,15,18,119, 4,16,0,0)) + LTTNG_UBUNTU_KERNEL_RANGE(4,15,18,119, 4,16,0,0) || \ + LTTNG_RHEL_KERNEL_RANGE(4,18,0,240,0,0, 4,19,0,0,0,0)) LTTNG_TRACEPOINT_EVENT(writeback_queue_io, TP_PROTO(struct bdi_writeback *wb, struct wb_writeback_work *work,