Path: blob/master/include/trace/events/workqueue.h
10818 views
#undef TRACE_SYSTEM1#define TRACE_SYSTEM workqueue23#if !defined(_TRACE_WORKQUEUE_H) || defined(TRACE_HEADER_MULTI_READ)4#define _TRACE_WORKQUEUE_H56#include <linux/tracepoint.h>7#include <linux/workqueue.h>89DECLARE_EVENT_CLASS(workqueue_work,1011TP_PROTO(struct work_struct *work),1213TP_ARGS(work),1415TP_STRUCT__entry(16__field( void *, work )17),1819TP_fast_assign(20__entry->work = work;21),2223TP_printk("work struct %p", __entry->work)24);2526/**27* workqueue_queue_work - called when a work gets queued28* @req_cpu: the requested cpu29* @cwq: pointer to struct cpu_workqueue_struct30* @work: pointer to struct work_struct31*32* This event occurs when a work is queued immediately or once a33* delayed work is actually queued on a workqueue (ie: once the delay34* has been reached).35*/36TRACE_EVENT(workqueue_queue_work,3738TP_PROTO(unsigned int req_cpu, struct cpu_workqueue_struct *cwq,39struct work_struct *work),4041TP_ARGS(req_cpu, cwq, work),4243TP_STRUCT__entry(44__field( void *, work )45__field( void *, function)46__field( void *, workqueue)47__field( unsigned int, req_cpu )48__field( unsigned int, cpu )49),5051TP_fast_assign(52__entry->work = work;53__entry->function = work->func;54__entry->workqueue = cwq->wq;55__entry->req_cpu = req_cpu;56__entry->cpu = cwq->gcwq->cpu;57),5859TP_printk("work struct=%p function=%pf workqueue=%p req_cpu=%u cpu=%u",60__entry->work, __entry->function, __entry->workqueue,61__entry->req_cpu, __entry->cpu)62);6364/**65* workqueue_activate_work - called when a work gets activated66* @work: pointer to struct work_struct67*68* This event occurs when a queued work is put on the active queue,69* which happens immediately after queueing unless @max_active limit70* is reached.71*/72DEFINE_EVENT(workqueue_work, workqueue_activate_work,7374TP_PROTO(struct work_struct *work),7576TP_ARGS(work)77);7879/**80* workqueue_execute_start - called immediately before the workqueue callback81* @work: pointer to struct work_struct82*83* Allows to track workqueue execution.84*/85TRACE_EVENT(workqueue_execute_start,8687TP_PROTO(struct work_struct *work),8889TP_ARGS(work),9091TP_STRUCT__entry(92__field( void *, work )93__field( void *, function)94),9596TP_fast_assign(97__entry->work = work;98__entry->function = work->func;99),100101TP_printk("work struct %p: function %pf", __entry->work, __entry->function)102);103104/**105* workqueue_execute_end - called immediately before the workqueue callback106* @work: pointer to struct work_struct107*108* Allows to track workqueue execution.109*/110DEFINE_EVENT(workqueue_work, workqueue_execute_end,111112TP_PROTO(struct work_struct *work),113114TP_ARGS(work)115);116117#endif /* _TRACE_WORKQUEUE_H */118119/* This part must be outside protection */120#include <trace/define_trace.h>121122123