Skip to content

Commit f42cf44

Browse files
berrangestefanhaRH
authored andcommittedAug 7, 2017
block: move trace probes into bdrv_co_preadv|pwritev
There are trace probes in bdrv_co_readv|writev, however, the block drivers are being gradually moved over to using the bdrv_co_preadv|pwritev functions instead. As a result some block drivers miss the current probes. Move the probes into bdrv_co_preadv|pwritev instead, so that they are triggered by more (all?) I/O code paths. Signed-off-by: Daniel P. Berrange <[email protected]> Message-id: [email protected] Signed-off-by: Stefan Hajnoczi <[email protected]>
1 parent ac44ed2 commit f42cf44

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed
 

‎block/io.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,8 @@ int coroutine_fn bdrv_co_preadv(BdrvChild *child,
11351135
bool use_local_qiov = false;
11361136
int ret;
11371137

1138+
trace_bdrv_co_preadv(child->bs, offset, bytes, flags);
1139+
11381140
if (!drv) {
11391141
return -ENOMEDIUM;
11401142
}
@@ -1207,8 +1209,6 @@ static int coroutine_fn bdrv_co_do_readv(BdrvChild *child,
12071209
int coroutine_fn bdrv_co_readv(BdrvChild *child, int64_t sector_num,
12081210
int nb_sectors, QEMUIOVector *qiov)
12091211
{
1210-
trace_bdrv_co_readv(child->bs, sector_num, nb_sectors);
1211-
12121212
return bdrv_co_do_readv(child, sector_num, nb_sectors, qiov, 0);
12131213
}
12141214

@@ -1526,6 +1526,8 @@ int coroutine_fn bdrv_co_pwritev(BdrvChild *child,
15261526
bool use_local_qiov = false;
15271527
int ret;
15281528

1529+
trace_bdrv_co_pwritev(child->bs, offset, bytes, flags);
1530+
15291531
if (!bs->drv) {
15301532
return -ENOMEDIUM;
15311533
}
@@ -1660,8 +1662,6 @@ static int coroutine_fn bdrv_co_do_writev(BdrvChild *child,
16601662
int coroutine_fn bdrv_co_writev(BdrvChild *child, int64_t sector_num,
16611663
int nb_sectors, QEMUIOVector *qiov)
16621664
{
1663-
trace_bdrv_co_writev(child->bs, sector_num, nb_sectors);
1664-
16651665
return bdrv_co_do_writev(child, sector_num, nb_sectors, qiov, 0);
16661666
}
16671667

‎block/trace-events

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ blk_co_preadv(void *blk, void *bs, int64_t offset, unsigned int bytes, int flags
99
blk_co_pwritev(void *blk, void *bs, int64_t offset, unsigned int bytes, int flags) "blk %p bs %p offset %"PRId64" bytes %u flags 0x%x"
1010

1111
# block/io.c
12-
bdrv_co_readv(void *bs, int64_t sector_num, int nb_sector) "bs %p sector_num %"PRId64" nb_sectors %d"
13-
bdrv_co_writev(void *bs, int64_t sector_num, int nb_sector) "bs %p sector_num %"PRId64" nb_sectors %d"
12+
bdrv_co_preadv(void *bs, int64_t offset, int64_t nbytes, unsigned int flags) "bs %p offset %"PRId64" nbytes %"PRId64" flags 0x%x"
13+
bdrv_co_pwritev(void *bs, int64_t offset, int64_t nbytes, unsigned int flags) "bs %p offset %"PRId64" nbytes %"PRId64" flags 0x%x"
1414
bdrv_co_pwrite_zeroes(void *bs, int64_t offset, int count, int flags) "bs %p offset %"PRId64" count %d flags 0x%x"
1515
bdrv_co_do_copy_on_readv(void *bs, int64_t offset, unsigned int bytes, int64_t cluster_offset, unsigned int cluster_bytes) "bs %p offset %"PRId64" bytes %u cluster_offset %"PRId64" cluster_bytes %u"
1616

0 commit comments

Comments
 (0)
Please sign in to comment.