bio->bi_private = &ret;
bio->bi_end_io = submit_bio_wait_endio;
submit_bio(rw, bio);
+ DTRACE_IO(wait__start, struct bio * : (bufinfo_t *, devinfo_t *), bio,
+ struct file * : fileinfo_t *, NULL);
wait_for_completion(&ret.event);
+ DTRACE_IO(wait__done, struct bio * : (bufinfo_t *, devinfo_t *), bio,
+ struct file * : fileinfo_t *, NULL);
return ret.error;
}
bio_put(bio);
bio = parent;
} else {
+ DTRACE_IO(done, struct bio * :
+ (bufinfo_t *, devinfo_t *), bio,
+ struct file * : fileinfo_t *, NULL);
+
if (bio->bi_end_io)
bio->bi_end_io(bio, error);
bio = NULL;
if (bio_sectors(bio) && bdev != bdev->bd_contains) {
struct hd_struct *p = bdev->bd_part;
-#ifdef CONFIG_DTRACE
- bio->bi_bdev_orig = bdev;
-#endif
bio->bi_iter.bi_sector += p->start_sect;
bio->bi_bdev = bdev->bd_contains;
return false; /* throttled, will be resubmitted later */
trace_block_bio_queue(q, bio);
+ DTRACE_IO(start, struct bio * : (bufinfo_t *, devinfo_t *), bio,
+ struct file * : fileinfo_t *, NULL);
return true;
end_io:
+ DTRACE_IO(start, struct bio * : (bufinfo_t *, devinfo_t *), bio,
+ struct file * : fileinfo_t *, NULL);
bio_endio(bio, err);
return false;
}
*/
void __wait_on_buffer(struct buffer_head * bh)
{
- DTRACE_IO(wait__start, struct buffer_head * : (bufinfo_t *, devinfo_t *, fileinfo_t *), bh);
wait_on_bit_io(&bh->b_state, BH_Lock, TASK_UNINTERRUPTIBLE);
- DTRACE_IO(wait__done, struct buffer_head * : (bufinfo_t *, devinfo_t *, fileinfo_t *), bh);
}
EXPORT_SYMBOL(__wait_on_buffer);
if (unlikely (test_bit(BIO_QUIET,&bio->bi_flags)))
set_bit(BH_Quiet, &bh->b_state);
- DTRACE_IO(done, struct buffer_head * : (bufinfo_t *, devinfo_t *, fileinfo_t *), bh, int, bio->bi_rw);
bh->b_end_io(bh, test_bit(BIO_UPTODATE, &bio->bi_flags));
bio_put(bio);
}
rw |= REQ_PRIO;
bio_get(bio);
- DTRACE_IO(start, struct buffer_head * : (bufinfo_t *, devinfo_t *,
- fileinfo_t *), bh, int, rw);
submit_bio(rw, bio);
if (bio_flagged(bio, BIO_EOPNOTSUPP))
#define xb_to_gfp(flags) \
((((flags) & XBF_READ_AHEAD) ? __GFP_NORETRY : GFP_NOFS) | __GFP_NOWARN)
+#define DTRACE_IO_XFS_WAIT(name, bp) \
+ if (DTRACE_IO_ENABLED(name)) { \
+ struct bio bio = { \
+ .bi_iter.bi_sector = (bp)->b_bn, \
+ .bi_iter.bi_size = (bp)->b_length, \
+ .bi_rw = ((bp)->b_flags & XBF_WRITE) != 0, \
+ .bi_bdev = (bp)->b_target->bt_bdev, \
+ }; \
+ DTRACE_IO(name, struct bio * : (bufinfo_t *, \
+ devinfo_t *), &bio, \
+ struct file * : fileinfo_t *, NULL); \
+ }
static inline int
xfs_buf_is_vmapped(
/* wait for completion before gathering the error from the buffer */
trace_xfs_buf_iowait(bp, _RET_IP_);
+ DTRACE_IO_XFS_WAIT(wait__start, bp);
wait_for_completion(&bp->b_iowait);
+ DTRACE_IO_XFS_WAIT(wait__done, bp);
trace_xfs_buf_iowait_done(bp, _RET_IP_);
error = bp->b_error;
struct bio *bi_next; /* request queue link */
struct block_device *bi_bdev; /* bdev (possibly remapped) */
#ifdef CONFIG_DTRACE
- struct block_device *bi_bdev_orig; /* bdev before remapping */
+ struct block_device *bi_bdev_orig; /* for kABI compatibility */
#endif
unsigned long bi_flags; /* status, command, etc */
unsigned long bi_rw; /* bottom bits READ/WRITE,
#define DTRACE_IO(name, ...) \
DTRACE_PROBE(__io_##name, ## __VA_ARGS__);
+#define DTRACE_IO_ENABLED(name) \
+ DTRACE_PROBE_ENABLED(__io_##name)
+
#define DTRACE_ISCSI(name, ...) \
DTRACE_PROBE(__iscsi_##name, ## __VA_ARGS__);