diff options
author | Slava Pestov <sp@daterainc.com> | 2014-05-22 15:14:24 -0400 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2014-08-04 18:23:03 -0400 |
commit | 60ae81eee86dd7a520db8c1e3d702b49fc0418b5 (patch) | |
tree | a9919f11951c3e96ad49db0b50c3964232f5f1b7 | |
parent | 8e0948080670f6330229718b15a6a1a011d441ce (diff) |
bcache: bcache_write tracepoint was crashing
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
-rw-r--r-- | drivers/md/bcache/request.c | 3 | ||||
-rw-r--r-- | include/trace/events/bcache.h | 15 |
2 files changed, 11 insertions, 7 deletions
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index 15fff4f68a7c..62e6e98186b5 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c | |||
@@ -311,7 +311,8 @@ void bch_data_insert(struct closure *cl) | |||
311 | { | 311 | { |
312 | struct data_insert_op *op = container_of(cl, struct data_insert_op, cl); | 312 | struct data_insert_op *op = container_of(cl, struct data_insert_op, cl); |
313 | 313 | ||
314 | trace_bcache_write(op->bio, op->writeback, op->bypass); | 314 | trace_bcache_write(op->c, op->inode, op->bio, |
315 | op->writeback, op->bypass); | ||
315 | 316 | ||
316 | bch_keylist_init(&op->insert_keys); | 317 | bch_keylist_init(&op->insert_keys); |
317 | bio_get(op->bio); | 318 | bio_get(op->bio); |
diff --git a/include/trace/events/bcache.h b/include/trace/events/bcache.h index c9c3c044b32f..6778e4135a8e 100644 --- a/include/trace/events/bcache.h +++ b/include/trace/events/bcache.h | |||
@@ -148,11 +148,13 @@ TRACE_EVENT(bcache_read, | |||
148 | ); | 148 | ); |
149 | 149 | ||
150 | TRACE_EVENT(bcache_write, | 150 | TRACE_EVENT(bcache_write, |
151 | TP_PROTO(struct bio *bio, bool writeback, bool bypass), | 151 | TP_PROTO(struct cache_set *c, u64 inode, struct bio *bio, |
152 | TP_ARGS(bio, writeback, bypass), | 152 | bool writeback, bool bypass), |
153 | TP_ARGS(c, inode, bio, writeback, bypass), | ||
153 | 154 | ||
154 | TP_STRUCT__entry( | 155 | TP_STRUCT__entry( |
155 | __field(dev_t, dev ) | 156 | __array(char, uuid, 16 ) |
157 | __field(u64, inode ) | ||
156 | __field(sector_t, sector ) | 158 | __field(sector_t, sector ) |
157 | __field(unsigned int, nr_sector ) | 159 | __field(unsigned int, nr_sector ) |
158 | __array(char, rwbs, 6 ) | 160 | __array(char, rwbs, 6 ) |
@@ -161,7 +163,8 @@ TRACE_EVENT(bcache_write, | |||
161 | ), | 163 | ), |
162 | 164 | ||
163 | TP_fast_assign( | 165 | TP_fast_assign( |
164 | __entry->dev = bio->bi_bdev->bd_dev; | 166 | memcpy(__entry->uuid, c->sb.set_uuid, 16); |
167 | __entry->inode = inode; | ||
165 | __entry->sector = bio->bi_iter.bi_sector; | 168 | __entry->sector = bio->bi_iter.bi_sector; |
166 | __entry->nr_sector = bio->bi_iter.bi_size >> 9; | 169 | __entry->nr_sector = bio->bi_iter.bi_size >> 9; |
167 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size); | 170 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size); |
@@ -169,8 +172,8 @@ TRACE_EVENT(bcache_write, | |||
169 | __entry->bypass = bypass; | 172 | __entry->bypass = bypass; |
170 | ), | 173 | ), |
171 | 174 | ||
172 | TP_printk("%d,%d %s %llu + %u hit %u bypass %u", | 175 | TP_printk("%pU inode %llu %s %llu + %u hit %u bypass %u", |
173 | MAJOR(__entry->dev), MINOR(__entry->dev), | 176 | __entry->uuid, __entry->inode, |
174 | __entry->rwbs, (unsigned long long)__entry->sector, | 177 | __entry->rwbs, (unsigned long long)__entry->sector, |
175 | __entry->nr_sector, __entry->writeback, __entry->bypass) | 178 | __entry->nr_sector, __entry->writeback, __entry->bypass) |
176 | ); | 179 | ); |