diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-10 18:22:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-10 18:22:42 -0400 |
commit | 2f9e825d3e0e2b407ae8f082de5c00afcf7378fb (patch) | |
tree | f8b3ee40674ce4acd5508a0a0bf52a30904caf6c /include/trace | |
parent | 7ae0dea900b027cd90e8a3e14deca9a19e17638b (diff) | |
parent | de75d60d5ea235e6e09f4962ab22541ce0fe176a (diff) |
Merge branch 'for-2.6.36' of git://git.kernel.dk/linux-2.6-block
* 'for-2.6.36' of git://git.kernel.dk/linux-2.6-block: (149 commits)
block: make sure that REQ_* types are seen even with CONFIG_BLOCK=n
xen-blkfront: fix missing out label
blkdev: fix blkdev_issue_zeroout return value
block: update request stacking methods to support discards
block: fix missing export of blk_types.h
writeback: fix bad _bh spinlock nesting
drbd: revert "delay probes", feature is being re-implemented differently
drbd: Initialize all members of sync_conf to their defaults [Bugz 315]
drbd: Disable delay probes for the upcomming release
writeback: cleanup bdi_register
writeback: add new tracepoints
writeback: remove unnecessary init_timer call
writeback: optimize periodic bdi thread wakeups
writeback: prevent unnecessary bdi threads wakeups
writeback: move bdi threads exiting logic to the forker thread
writeback: restructure bdi forker loop a little
writeback: move last_active to bdi
writeback: do not remove bdi from bdi_list
writeback: simplify bdi code a little
writeback: do not lose wake-ups in bdi threads
...
Fixed up pretty trivial conflicts in drivers/block/virtio_blk.c and
drivers/scsi/scsi_error.c as per Jens.
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/block.h | 15 | ||||
-rw-r--r-- | include/trace/events/writeback.h | 159 |
2 files changed, 169 insertions, 5 deletions
diff --git a/include/trace/events/block.h b/include/trace/events/block.h index d870a918559c..d8ce278515c3 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h | |||
@@ -25,8 +25,10 @@ DECLARE_EVENT_CLASS(block_rq_with_error, | |||
25 | 25 | ||
26 | TP_fast_assign( | 26 | TP_fast_assign( |
27 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; | 27 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; |
28 | __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq); | 28 | __entry->sector = (rq->cmd_type == REQ_TYPE_BLOCK_PC) ? |
29 | __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq); | 29 | 0 : blk_rq_pos(rq); |
30 | __entry->nr_sector = (rq->cmd_type == REQ_TYPE_BLOCK_PC) ? | ||
31 | 0 : blk_rq_sectors(rq); | ||
30 | __entry->errors = rq->errors; | 32 | __entry->errors = rq->errors; |
31 | 33 | ||
32 | blk_fill_rwbs_rq(__entry->rwbs, rq); | 34 | blk_fill_rwbs_rq(__entry->rwbs, rq); |
@@ -109,9 +111,12 @@ DECLARE_EVENT_CLASS(block_rq, | |||
109 | 111 | ||
110 | TP_fast_assign( | 112 | TP_fast_assign( |
111 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; | 113 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; |
112 | __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq); | 114 | __entry->sector = (rq->cmd_type == REQ_TYPE_BLOCK_PC) ? |
113 | __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq); | 115 | 0 : blk_rq_pos(rq); |
114 | __entry->bytes = blk_pc_request(rq) ? blk_rq_bytes(rq) : 0; | 116 | __entry->nr_sector = (rq->cmd_type == REQ_TYPE_BLOCK_PC) ? |
117 | 0 : blk_rq_sectors(rq); | ||
118 | __entry->bytes = (rq->cmd_type == REQ_TYPE_BLOCK_PC) ? | ||
119 | blk_rq_bytes(rq) : 0; | ||
115 | 120 | ||
116 | blk_fill_rwbs_rq(__entry->rwbs, rq); | 121 | blk_fill_rwbs_rq(__entry->rwbs, rq); |
117 | blk_dump_cmd(__get_str(cmd), rq); | 122 | blk_dump_cmd(__get_str(cmd), rq); |
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h new file mode 100644 index 000000000000..f345f66ae9d1 --- /dev/null +++ b/include/trace/events/writeback.h | |||
@@ -0,0 +1,159 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM writeback | ||
3 | |||
4 | #if !defined(_TRACE_WRITEBACK_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_WRITEBACK_H | ||
6 | |||
7 | #include <linux/backing-dev.h> | ||
8 | #include <linux/device.h> | ||
9 | #include <linux/writeback.h> | ||
10 | |||
11 | struct wb_writeback_work; | ||
12 | |||
13 | DECLARE_EVENT_CLASS(writeback_work_class, | ||
14 | TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work), | ||
15 | TP_ARGS(bdi, work), | ||
16 | TP_STRUCT__entry( | ||
17 | __array(char, name, 32) | ||
18 | __field(long, nr_pages) | ||
19 | __field(dev_t, sb_dev) | ||
20 | __field(int, sync_mode) | ||
21 | __field(int, for_kupdate) | ||
22 | __field(int, range_cyclic) | ||
23 | __field(int, for_background) | ||
24 | ), | ||
25 | TP_fast_assign( | ||
26 | strncpy(__entry->name, dev_name(bdi->dev), 32); | ||
27 | __entry->nr_pages = work->nr_pages; | ||
28 | __entry->sb_dev = work->sb ? work->sb->s_dev : 0; | ||
29 | __entry->sync_mode = work->sync_mode; | ||
30 | __entry->for_kupdate = work->for_kupdate; | ||
31 | __entry->range_cyclic = work->range_cyclic; | ||
32 | __entry->for_background = work->for_background; | ||
33 | ), | ||
34 | TP_printk("bdi %s: sb_dev %d:%d nr_pages=%ld sync_mode=%d " | ||
35 | "kupdate=%d range_cyclic=%d background=%d", | ||
36 | __entry->name, | ||
37 | MAJOR(__entry->sb_dev), MINOR(__entry->sb_dev), | ||
38 | __entry->nr_pages, | ||
39 | __entry->sync_mode, | ||
40 | __entry->for_kupdate, | ||
41 | __entry->range_cyclic, | ||
42 | __entry->for_background | ||
43 | ) | ||
44 | ); | ||
45 | #define DEFINE_WRITEBACK_WORK_EVENT(name) \ | ||
46 | DEFINE_EVENT(writeback_work_class, name, \ | ||
47 | TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work), \ | ||
48 | TP_ARGS(bdi, work)) | ||
49 | DEFINE_WRITEBACK_WORK_EVENT(writeback_nothread); | ||
50 | DEFINE_WRITEBACK_WORK_EVENT(writeback_queue); | ||
51 | DEFINE_WRITEBACK_WORK_EVENT(writeback_exec); | ||
52 | |||
53 | TRACE_EVENT(writeback_pages_written, | ||
54 | TP_PROTO(long pages_written), | ||
55 | TP_ARGS(pages_written), | ||
56 | TP_STRUCT__entry( | ||
57 | __field(long, pages) | ||
58 | ), | ||
59 | TP_fast_assign( | ||
60 | __entry->pages = pages_written; | ||
61 | ), | ||
62 | TP_printk("%ld", __entry->pages) | ||
63 | ); | ||
64 | |||
65 | DECLARE_EVENT_CLASS(writeback_class, | ||
66 | TP_PROTO(struct backing_dev_info *bdi), | ||
67 | TP_ARGS(bdi), | ||
68 | TP_STRUCT__entry( | ||
69 | __array(char, name, 32) | ||
70 | ), | ||
71 | TP_fast_assign( | ||
72 | strncpy(__entry->name, dev_name(bdi->dev), 32); | ||
73 | ), | ||
74 | TP_printk("bdi %s", | ||
75 | __entry->name | ||
76 | ) | ||
77 | ); | ||
78 | #define DEFINE_WRITEBACK_EVENT(name) \ | ||
79 | DEFINE_EVENT(writeback_class, name, \ | ||
80 | TP_PROTO(struct backing_dev_info *bdi), \ | ||
81 | TP_ARGS(bdi)) | ||
82 | |||
83 | DEFINE_WRITEBACK_EVENT(writeback_nowork); | ||
84 | DEFINE_WRITEBACK_EVENT(writeback_wake_thread); | ||
85 | DEFINE_WRITEBACK_EVENT(writeback_wake_forker_thread); | ||
86 | DEFINE_WRITEBACK_EVENT(writeback_bdi_register); | ||
87 | DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister); | ||
88 | DEFINE_WRITEBACK_EVENT(writeback_thread_start); | ||
89 | DEFINE_WRITEBACK_EVENT(writeback_thread_stop); | ||
90 | |||
91 | DECLARE_EVENT_CLASS(wbc_class, | ||
92 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), | ||
93 | TP_ARGS(wbc, bdi), | ||
94 | TP_STRUCT__entry( | ||
95 | __array(char, name, 32) | ||
96 | __field(long, nr_to_write) | ||
97 | __field(long, pages_skipped) | ||
98 | __field(int, sync_mode) | ||
99 | __field(int, nonblocking) | ||
100 | __field(int, encountered_congestion) | ||
101 | __field(int, for_kupdate) | ||
102 | __field(int, for_background) | ||
103 | __field(int, for_reclaim) | ||
104 | __field(int, range_cyclic) | ||
105 | __field(int, more_io) | ||
106 | __field(unsigned long, older_than_this) | ||
107 | __field(long, range_start) | ||
108 | __field(long, range_end) | ||
109 | ), | ||
110 | |||
111 | TP_fast_assign( | ||
112 | strncpy(__entry->name, dev_name(bdi->dev), 32); | ||
113 | __entry->nr_to_write = wbc->nr_to_write; | ||
114 | __entry->pages_skipped = wbc->pages_skipped; | ||
115 | __entry->sync_mode = wbc->sync_mode; | ||
116 | __entry->for_kupdate = wbc->for_kupdate; | ||
117 | __entry->for_background = wbc->for_background; | ||
118 | __entry->for_reclaim = wbc->for_reclaim; | ||
119 | __entry->range_cyclic = wbc->range_cyclic; | ||
120 | __entry->more_io = wbc->more_io; | ||
121 | __entry->older_than_this = wbc->older_than_this ? | ||
122 | *wbc->older_than_this : 0; | ||
123 | __entry->range_start = (long)wbc->range_start; | ||
124 | __entry->range_end = (long)wbc->range_end; | ||
125 | ), | ||
126 | |||
127 | TP_printk("bdi %s: towrt=%ld skip=%ld mode=%d kupd=%d " | ||
128 | "bgrd=%d reclm=%d cyclic=%d more=%d older=0x%lx " | ||
129 | "start=0x%lx end=0x%lx", | ||
130 | __entry->name, | ||
131 | __entry->nr_to_write, | ||
132 | __entry->pages_skipped, | ||
133 | __entry->sync_mode, | ||
134 | __entry->for_kupdate, | ||
135 | __entry->for_background, | ||
136 | __entry->for_reclaim, | ||
137 | __entry->range_cyclic, | ||
138 | __entry->more_io, | ||
139 | __entry->older_than_this, | ||
140 | __entry->range_start, | ||
141 | __entry->range_end) | ||
142 | ) | ||
143 | |||
144 | #define DEFINE_WBC_EVENT(name) \ | ||
145 | DEFINE_EVENT(wbc_class, name, \ | ||
146 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \ | ||
147 | TP_ARGS(wbc, bdi)) | ||
148 | DEFINE_WBC_EVENT(wbc_writeback_start); | ||
149 | DEFINE_WBC_EVENT(wbc_writeback_written); | ||
150 | DEFINE_WBC_EVENT(wbc_writeback_wait); | ||
151 | DEFINE_WBC_EVENT(wbc_balance_dirty_start); | ||
152 | DEFINE_WBC_EVENT(wbc_balance_dirty_written); | ||
153 | DEFINE_WBC_EVENT(wbc_balance_dirty_wait); | ||
154 | DEFINE_WBC_EVENT(wbc_writepage); | ||
155 | |||
156 | #endif /* _TRACE_WRITEBACK_H */ | ||
157 | |||
158 | /* This part must be outside protection */ | ||
159 | #include <trace/define_trace.h> | ||