lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Thu, 30 Apr 2009 02:27:09 +0200 From: Frederic Weisbecker <fweisbec@...il.com> To: Ingo Molnar <mingo@...e.hu> Cc: LKML <linux-kernel@...r.kernel.org>, Li Zefan <lizf@...fujitsu.com>, Zhaolei <zhaolei@...fujitsu.com>, Steven Rostedt <rostedt@...dmis.org>, Tom Zanussi <tzanussi@...il.com>, Oleg Nesterov <oleg@...hat.com>, Andrew Morton <akpm@...ux-foundation.org>, KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>, Frederic Weisbecker <fweisbec@...il.com> Subject: [PATCH 08/19] workqueue_tracepoint: add workqueue_flush and worklet_cancel tracepoint From: Zhaolei <zhaolei@...fujitsu.com> Ingo Molnar <mingo@...e.hu> wrote: > This allows the understanding of the life cycle of a workqueue and > of worklets that enter that workqueue. [ Impact: provide finer grained details about life of worklets ] Signed-off-by: Zhao Lei <zhaolei@...fujitsu.com> Cc: Steven Rostedt <rostedt@...dmis.org> Cc: Tom Zanussi <tzanussi@...il.com> Cc: Oleg Nesterov <oleg@...hat.com>, Cc: Andrew Morton <akpm@...ux-foundation.org> Cc: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com> Signed-off-by: Frederic Weisbecker <fweisbec@...il.com> --- include/trace/events/workqueue.h | 36 ++++++++++++++++++++++++++++++++++++ kernel/workqueue.c | 4 ++++ 2 files changed, 40 insertions(+), 0 deletions(-) diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h index 36f4939..2e77e84 100644 --- a/include/trace/events/workqueue.h +++ b/include/trace/events/workqueue.h @@ -76,6 +76,23 @@ TRACE_EVENT(workqueue_handler_exit, __entry->thread_pid, __entry->work) ); +TRACE_EVENT(worklet_cancel, + + TP_PROTO(struct work_struct *work), + + TP_ARGS(work), + + TP_STRUCT__entry( + __field(work_func_t, func) + ), + + TP_fast_assign( + __entry->func = work->func; + ), + + TP_printk("func=%pF", __entry->func) +); + /* Trace the creation of one workqueue thread on a cpu */ TRACE_EVENT(workqueue_creation, @@ -99,6 +116,25 @@ TRACE_EVENT(workqueue_creation, __entry->thread_pid, __entry->cpu) ); +TRACE_EVENT(workqueue_flush, + + TP_PROTO(struct task_struct *wq_thread), + + TP_ARGS(wq_thread), + + TP_STRUCT__entry( + __array(char, thread_comm, TASK_COMM_LEN) + __field(pid_t, thread_pid) + ), + + TP_fast_assign( + memcpy(__entry->thread_comm, wq_thread->comm, TASK_COMM_LEN); + __entry->thread_pid = wq_thread->pid; + ), + + TP_printk("thread=%s:%d", __entry->thread_comm, __entry->thread_pid) +); + TRACE_EVENT(workqueue_destruction, TP_PROTO(struct task_struct *wq_thread), diff --git a/kernel/workqueue.c b/kernel/workqueue.c index fbcdfa2..99a81ba 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -366,6 +366,8 @@ static int flush_cpu_workqueue(struct cpu_workqueue_struct *cwq) int active = 0; struct wq_barrier barr; + trace_workqueue_flush(cwq->thread); + WARN_ON(cwq->thread == current); spin_lock_irq(&cwq->lock); @@ -542,6 +544,8 @@ static int __cancel_work_timer(struct work_struct *work, { int ret; + trace_worklet_cancel(work); + do { ret = (timer && likely(del_timer(timer))); if (!ret) -- 1.6.2.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists