1 #undef TRACE_SYSTEM 2 #define TRACE_SYSTEM workqueue 3 4 #if !defined(_TRACE_WORKQUEUE_H) || defined(TRACE_HEADER_MULTI_READ) 5 #define _TRACE_WORKQUEUE_H 6 7 #include <linux/tracepoint.h> 8 #include <linux/workqueue.h> 9 10 DECLARE_EVENT_CLASS(workqueue_work, 11 12 TP_PROTO(struct work_struct *work), 13 14 TP_ARGS(work), 15 16 TP_STRUCT__entry( 17 __field( void *, work ) 18 ), 19 20 TP_fast_assign( 21 __entry->work = work; 22 ), 23 24 TP_printk("work struct %p", __entry->work) 25 ); 26 27 /** 28 * workqueue_execute_start - called immediately before the workqueue callback 29 * @work: pointer to struct work_struct 30 * 31 * Allows to track workqueue execution. 32 */ 33 TRACE_EVENT(workqueue_execute_start, 34 35 TP_PROTO(struct work_struct *work), 36 37 TP_ARGS(work), 38 39 TP_STRUCT__entry( 40 __field( void *, work ) 41 __field( void *, function) 42 ), 43 44 TP_fast_assign( 45 __entry->work = work; 46 __entry->function = work->func; 47 ), 48 49 TP_printk("work struct %p: function %pf", __entry->work, __entry->function) 50 ); 51 52 /** 53 * workqueue_execute_end - called immediately before the workqueue callback 54 * @work: pointer to struct work_struct 55 * 56 * Allows to track workqueue execution. 57 */ 58 DEFINE_EVENT(workqueue_work, workqueue_execute_end, 59 60 TP_PROTO(struct work_struct *work), 61 62 TP_ARGS(work) 63 ); 64 65 #endif /* _TRACE_WORKQUEUE_H */ 66 67 /* This part must be outside protection */ 68 #include <trace/define_trace.h> 69