X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=instrumentation%2Fevents%2Flttng-module%2Fwriteback.h;h=fd9c5206f6a5c6947fc4be94797088147cec3568;hb=88dc2c975d6aa1cbff586fbb90bd9424e64edf9c;hp=b0c81d2872cc2221adbfffcb785b731c32ff36c1;hpb=fa7c32a4ef302e709f138e7307b6dbe5efd16e0d;p=lttng-modules.git diff --git a/instrumentation/events/lttng-module/writeback.h b/instrumentation/events/lttng-module/writeback.h index b0c81d28..fd9c5206 100644 --- a/instrumentation/events/lttng-module/writeback.h +++ b/instrumentation/events/lttng-module/writeback.h @@ -10,27 +10,6 @@ #ifndef _TRACE_WRITEBACK_DEF_ #define _TRACE_WRITEBACK_DEF_ -/* Have to duplicate it here from fs/fs-writeback.c */ -struct wb_writeback_work { - long nr_pages; - struct super_block *sb; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) - unsigned long *older_than_this; -#endif - enum writeback_sync_modes sync_mode; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) - unsigned int tagged_writepages:1; -#endif - unsigned int for_kupdate:1; - unsigned int range_cyclic:1; - unsigned int for_background:1; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) - enum wb_reason reason; /* why was writeback initiated? */ -#endif - - struct list_head list; /* pending work list */ - struct completion *done; /* set if the caller waits */ -}; static inline struct backing_dev_info *inode_to_bdi(struct inode *inode) { struct super_block *sb = inode->i_sb; @@ -72,53 +51,14 @@ DECLARE_EVENT_CLASS(writeback_work_class, TP_ARGS(bdi, work), TP_STRUCT__entry( __array(char, name, 32) - __field(long, nr_pages) - __field(dev_t, sb_dev) - __field(int, sync_mode) - __field(int, for_kupdate) - __field(int, range_cyclic) - __field(int, for_background) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) - __field(int, reason) -#endif ), TP_fast_assign( tp_memcpy(name, dev_name(bdi->dev ? bdi->dev : default_backing_dev_info.dev), 32) - tp_assign(nr_pages, work->nr_pages) - tp_assign(sb_dev, work->sb ? work->sb->s_dev : 0) - tp_assign(sync_mode, work->sync_mode) - tp_assign(for_kupdate, work->for_kupdate) - tp_assign(range_cyclic, work->range_cyclic) - tp_assign(for_background, work->for_background) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) - tp_assign(reason, work->reason) -#endif ), -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) - TP_printk("bdi %s: sb_dev %d:%d nr_pages=%ld sync_mode=%d " - "kupdate=%d range_cyclic=%d background=%d reason=%s", - __entry->name, - MAJOR(__entry->sb_dev), MINOR(__entry->sb_dev), - __entry->nr_pages, - __entry->sync_mode, - __entry->for_kupdate, - __entry->range_cyclic, - __entry->for_background, - __print_symbolic(__entry->reason, WB_WORK_REASON) - ) -#else - TP_printk("bdi %s: sb_dev %d:%d nr_pages=%ld sync_mode=%d " - "kupdate=%d range_cyclic=%d background=%d", - __entry->name, - MAJOR(__entry->sb_dev), MINOR(__entry->sb_dev), - __entry->nr_pages, - __entry->sync_mode, - __entry->for_kupdate, - __entry->range_cyclic, - __entry->for_background + TP_printk("bdi %s", + __entry->name ) -#endif ) #define DEFINE_WRITEBACK_WORK_EVENT(name) \ DEFINE_EVENT(writeback_work_class, name, \ @@ -299,37 +239,27 @@ TRACE_EVENT(writeback_queue_io, #endif TP_STRUCT__entry( __array(char, name, 32) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) +#else __field(unsigned long, older) __field(long, age) - __field(int, moved) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) - __field(int, reason) #endif + __field(int, moved) ), TP_fast_assign( tp_memcpy(name, dev_name(wb->bdi->dev), 32) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) - tp_assign(older, - work->older_than_this ? *(work->older_than_this) : 0) - tp_assign(age, work->older_than_this ? - (jiffies - *(work->older_than_this)) * 1000 / HZ : -1) #else tp_assign(older, older_than_this ? *older_than_this : 0) tp_assign(age, older_than_this ? (jiffies - *older_than_this) * 1000 / HZ : -1) #endif tp_assign(moved, moved) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) - tp_assign(reason, work->reason) -#endif ), #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) - TP_printk("bdi %s: older=%lu age=%ld enqueue=%d reason=%s", + TP_printk("bdi %s: enqueue=%d", __entry->name, - __entry->older, /* older_than_this in jiffies */ - __entry->age, /* older_than_this in relative milliseconds */ __entry->moved, - __print_symbolic(__entry->reason, WB_WORK_REASON) ) #else TP_printk("bdi %s: older=%lu age=%ld enqueue=%d",