diff options
author | Qu Wenruo <quwenruo@cn.fujitsu.com> | 2014-03-12 04:05:33 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-03-20 20:15:28 -0400 |
commit | c3a468915a384c0015263edd9b7263775599a323 (patch) | |
tree | 433ed892fc1733ddb28bf1bf2ac61bdac5b42398 /fs/btrfs/async-thread.c | |
parent | f094c9bd3e12ee83e91f4249b600d4d2ac0a4738 (diff) |
btrfs: Add trace for btrfs_workqueue alloc/destroy
Since most of the btrfs_workqueue is printed as pointer address,
for easier analysis, add trace for btrfs_workqueue alloc/destroy.
So it is possible to determine the workqueue that a given work belongs
to(by comparing the wq pointer address with alloc trace event).
Signed-off-by: Qu Wenruo <quenruo@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/async-thread.c')
-rw-r--r-- | fs/btrfs/async-thread.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c index 66532b8f0f7c..ecb5832c0967 100644 --- a/fs/btrfs/async-thread.c +++ b/fs/btrfs/async-thread.c | |||
@@ -56,7 +56,8 @@ struct btrfs_workqueue { | |||
56 | }; | 56 | }; |
57 | 57 | ||
58 | static inline struct __btrfs_workqueue | 58 | static inline struct __btrfs_workqueue |
59 | *__btrfs_alloc_workqueue(char *name, int flags, int max_active, int thresh) | 59 | *__btrfs_alloc_workqueue(const char *name, int flags, int max_active, |
60 | int thresh) | ||
60 | { | 61 | { |
61 | struct __btrfs_workqueue *ret = kzalloc(sizeof(*ret), GFP_NOFS); | 62 | struct __btrfs_workqueue *ret = kzalloc(sizeof(*ret), GFP_NOFS); |
62 | 63 | ||
@@ -92,13 +93,14 @@ static inline struct __btrfs_workqueue | |||
92 | INIT_LIST_HEAD(&ret->ordered_list); | 93 | INIT_LIST_HEAD(&ret->ordered_list); |
93 | spin_lock_init(&ret->list_lock); | 94 | spin_lock_init(&ret->list_lock); |
94 | spin_lock_init(&ret->thres_lock); | 95 | spin_lock_init(&ret->thres_lock); |
96 | trace_btrfs_workqueue_alloc(ret, name, flags & WQ_HIGHPRI); | ||
95 | return ret; | 97 | return ret; |
96 | } | 98 | } |
97 | 99 | ||
98 | static inline void | 100 | static inline void |
99 | __btrfs_destroy_workqueue(struct __btrfs_workqueue *wq); | 101 | __btrfs_destroy_workqueue(struct __btrfs_workqueue *wq); |
100 | 102 | ||
101 | struct btrfs_workqueue *btrfs_alloc_workqueue(char *name, | 103 | struct btrfs_workqueue *btrfs_alloc_workqueue(const char *name, |
102 | int flags, | 104 | int flags, |
103 | int max_active, | 105 | int max_active, |
104 | int thresh) | 106 | int thresh) |
@@ -305,6 +307,7 @@ static inline void | |||
305 | __btrfs_destroy_workqueue(struct __btrfs_workqueue *wq) | 307 | __btrfs_destroy_workqueue(struct __btrfs_workqueue *wq) |
306 | { | 308 | { |
307 | destroy_workqueue(wq->normal_wq); | 309 | destroy_workqueue(wq->normal_wq); |
310 | trace_btrfs_workqueue_destroy(wq); | ||
308 | kfree(wq); | 311 | kfree(wq); |
309 | } | 312 | } |
310 | 313 | ||