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
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1285861140-5948-1-git-send-regression-fweisbec@gmail.com>
Date:	Thu, 30 Sep 2010 17:39:00 +0200
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Tejun Heo <tj@...nel.org>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Ingo Molnar <mingo@...e.hu>
Subject: [PATCH] workqueue: Add a trace event for works enqueuing

Tracing worklet queuing provides useful informations to understand
their lifecycles. Combined with timers trace events, we can also
extend the informations about this lifecycle from delayed queueing.

Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Ingo Molnar <mingo@...e.hu>
---
 include/trace/events/workqueue.h |   32 ++++++++++++++++++++++++++++++++
 kernel/workqueue.c               |    2 ++
 2 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h
index 49682d7..4c2ec52 100644
--- a/include/trace/events/workqueue.h
+++ b/include/trace/events/workqueue.h
@@ -7,6 +7,38 @@
 #include <linux/tracepoint.h>
 #include <linux/workqueue.h>
 
+
+/**
+ * workqueue_queue_work - called when a work gets queued
+ * @work:	pointer to struct work_struct
+ * @wq:		workqueue structure
+ *
+ * Allows to track workqueue execution. This event occurs when
+ * a work is queued immediately or once a delayed work is actually
+ * queued on a workqueue (ie: once the delay has been reached).
+ */
+TRACE_EVENT(workqueue_queue_work,
+
+	TP_PROTO(struct work_struct *work, struct workqueue_struct *wq),
+
+	TP_ARGS(work, wq),
+
+	TP_STRUCT__entry(
+		__field( void *,	work	)
+		__field( void *,	function)
+		__field( void *,	workqueue)
+	),
+
+	TP_fast_assign(
+		__entry->work		= work;
+		__entry->function	= work->func;
+		__entry->workqueue	= wq;
+	),
+
+	TP_printk("work struct=%p function=%pf workqueue=%p",
+			__entry->work, __entry->function, __entry->workqueue)
+);
+
 /**
  * workqueue_execute_start - called immediately before the workqueue callback
  * @work:	pointer to struct work_struct
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index f77afd9..5ed9f89 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -959,6 +959,8 @@ static void __queue_work(unsigned int cpu, struct workqueue_struct *wq,
 	if (WARN_ON_ONCE(wq->flags & WQ_DYING))
 		return;
 
+	trace_workqueue_queue_work(work, wq);
+
 	/* determine gcwq to use */
 	if (!(wq->flags & WQ_UNBOUND)) {
 		struct global_cwq *last_gcwq;
-- 
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ