diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-05 14:04:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-05 14:04:19 -0400 |
commit | 714f83d5d9f7c785f622259dad1f4fad12d64664 (patch) | |
tree | 20563541ae438e11d686b4d629074eb002a481b7 /kernel/workqueue.c | |
parent | 8901e7ffc2fa78ede7ce9826dbad68a3a25dc2dc (diff) | |
parent | 645dae969c3b8651c5bc7c54a1835ec03820f85f (diff) |
Merge branch 'tracing-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'tracing-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (413 commits)
tracing, net: fix net tree and tracing tree merge interaction
tracing, powerpc: fix powerpc tree and tracing tree interaction
ring-buffer: do not remove reader page from list on ring buffer free
function-graph: allow unregistering twice
trace: make argument 'mem' of trace_seq_putmem() const
tracing: add missing 'extern' keywords to trace_output.h
tracing: provide trace_seq_reserve()
blktrace: print out BLK_TN_MESSAGE properly
blktrace: extract duplidate code
blktrace: fix memory leak when freeing struct blk_io_trace
blktrace: fix blk_probes_ref chaos
blktrace: make classic output more classic
blktrace: fix off-by-one bug
blktrace: fix the original blktrace
blktrace: fix a race when creating blk_tree_root in debugfs
blktrace: fix timestamp in binary output
tracing, Text Edit Lock: cleanup
tracing: filter fix for TRACE_EVENT_FORMAT events
ftrace: Using FTRACE_WARN_ON() to check "freed record" in ftrace_release()
x86: kretprobe-booster interrupt emulation code fix
...
Fix up trivial conflicts in
arch/parisc/include/asm/ftrace.h
include/linux/memory.h
kernel/extable.c
kernel/module.c
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r-- | kernel/workqueue.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 32f8e0d2bf5a..b6b966ce1451 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/kallsyms.h> | 33 | #include <linux/kallsyms.h> |
34 | #include <linux/debug_locks.h> | 34 | #include <linux/debug_locks.h> |
35 | #include <linux/lockdep.h> | 35 | #include <linux/lockdep.h> |
36 | #include <trace/workqueue.h> | ||
36 | 37 | ||
37 | /* | 38 | /* |
38 | * The per-CPU workqueue (if single thread, we always use the first | 39 | * The per-CPU workqueue (if single thread, we always use the first |
@@ -123,9 +124,13 @@ struct cpu_workqueue_struct *get_wq_data(struct work_struct *work) | |||
123 | return (void *) (atomic_long_read(&work->data) & WORK_STRUCT_WQ_DATA_MASK); | 124 | return (void *) (atomic_long_read(&work->data) & WORK_STRUCT_WQ_DATA_MASK); |
124 | } | 125 | } |
125 | 126 | ||
127 | DEFINE_TRACE(workqueue_insertion); | ||
128 | |||
126 | static void insert_work(struct cpu_workqueue_struct *cwq, | 129 | static void insert_work(struct cpu_workqueue_struct *cwq, |
127 | struct work_struct *work, struct list_head *head) | 130 | struct work_struct *work, struct list_head *head) |
128 | { | 131 | { |
132 | trace_workqueue_insertion(cwq->thread, work); | ||
133 | |||
129 | set_wq_data(work, cwq); | 134 | set_wq_data(work, cwq); |
130 | /* | 135 | /* |
131 | * Ensure that we get the right work->data if we see the | 136 | * Ensure that we get the right work->data if we see the |
@@ -257,6 +262,8 @@ int queue_delayed_work_on(int cpu, struct workqueue_struct *wq, | |||
257 | } | 262 | } |
258 | EXPORT_SYMBOL_GPL(queue_delayed_work_on); | 263 | EXPORT_SYMBOL_GPL(queue_delayed_work_on); |
259 | 264 | ||
265 | DEFINE_TRACE(workqueue_execution); | ||
266 | |||
260 | static void run_workqueue(struct cpu_workqueue_struct *cwq) | 267 | static void run_workqueue(struct cpu_workqueue_struct *cwq) |
261 | { | 268 | { |
262 | spin_lock_irq(&cwq->lock); | 269 | spin_lock_irq(&cwq->lock); |
@@ -275,7 +282,7 @@ static void run_workqueue(struct cpu_workqueue_struct *cwq) | |||
275 | */ | 282 | */ |
276 | struct lockdep_map lockdep_map = work->lockdep_map; | 283 | struct lockdep_map lockdep_map = work->lockdep_map; |
277 | #endif | 284 | #endif |
278 | 285 | trace_workqueue_execution(cwq->thread, work); | |
279 | cwq->current_work = work; | 286 | cwq->current_work = work; |
280 | list_del_init(cwq->worklist.next); | 287 | list_del_init(cwq->worklist.next); |
281 | spin_unlock_irq(&cwq->lock); | 288 | spin_unlock_irq(&cwq->lock); |
@@ -746,6 +753,8 @@ init_cpu_workqueue(struct workqueue_struct *wq, int cpu) | |||
746 | return cwq; | 753 | return cwq; |
747 | } | 754 | } |
748 | 755 | ||
756 | DEFINE_TRACE(workqueue_creation); | ||
757 | |||
749 | static int create_workqueue_thread(struct cpu_workqueue_struct *cwq, int cpu) | 758 | static int create_workqueue_thread(struct cpu_workqueue_struct *cwq, int cpu) |
750 | { | 759 | { |
751 | struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 }; | 760 | struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 }; |
@@ -768,6 +777,8 @@ static int create_workqueue_thread(struct cpu_workqueue_struct *cwq, int cpu) | |||
768 | sched_setscheduler_nocheck(p, SCHED_FIFO, ¶m); | 777 | sched_setscheduler_nocheck(p, SCHED_FIFO, ¶m); |
769 | cwq->thread = p; | 778 | cwq->thread = p; |
770 | 779 | ||
780 | trace_workqueue_creation(cwq->thread, cpu); | ||
781 | |||
771 | return 0; | 782 | return 0; |
772 | } | 783 | } |
773 | 784 | ||
@@ -849,6 +860,8 @@ struct workqueue_struct *__create_workqueue_key(const char *name, | |||
849 | } | 860 | } |
850 | EXPORT_SYMBOL_GPL(__create_workqueue_key); | 861 | EXPORT_SYMBOL_GPL(__create_workqueue_key); |
851 | 862 | ||
863 | DEFINE_TRACE(workqueue_destruction); | ||
864 | |||
852 | static void cleanup_workqueue_thread(struct cpu_workqueue_struct *cwq) | 865 | static void cleanup_workqueue_thread(struct cpu_workqueue_struct *cwq) |
853 | { | 866 | { |
854 | /* | 867 | /* |
@@ -872,6 +885,7 @@ static void cleanup_workqueue_thread(struct cpu_workqueue_struct *cwq) | |||
872 | * checks list_empty(), and a "normal" queue_work() can't use | 885 | * checks list_empty(), and a "normal" queue_work() can't use |
873 | * a dead CPU. | 886 | * a dead CPU. |
874 | */ | 887 | */ |
888 | trace_workqueue_destruction(cwq->thread); | ||
875 | kthread_stop(cwq->thread); | 889 | kthread_stop(cwq->thread); |
876 | cwq->thread = NULL; | 890 | cwq->thread = NULL; |
877 | } | 891 | } |