Signed-off by : Prerna (prerna@linux.vnet.ibm.com)
===================================================================
@@ -19,6 +19,10 @@
# include <scsi/sg.h>
#endif
+#ifdef CONFIG_QEMU_TRACE
+#include "trace-entries.h"
+#endif
+
typedef struct VirtIOBlock
{
VirtIODevice vdev;
@@ -87,6 +91,8 @@ static void virtio_blk_rw_complete(void
{
VirtIOBlockReq *req = opaque;
+ trace_virtio_blk_rw_complete(req, ret);
+
if (ret) {
int is_read = !(req->out->type & VIRTIO_BLK_T_OUT);
if (virtio_blk_handle_rw_error(req, -ret, is_read))
===================================================================
@@ -29,6 +29,9 @@
#include "block/raw-posix-aio.h"
+#ifdef CONFIG_QEMU_TRACE
+#include "trace-entries.h"
+#endif
struct qemu_paiocb {
BlockDriverAIOCB common;
@@ -565,6 +568,7 @@ BlockDriverAIOCB *paio_submit(BlockDrive
{
struct qemu_paiocb *acb;
+ trace_paio_submit(fd, sector_num);
acb = qemu_aio_get(&raw_aio_pool, bs, cb, opaque);
if (!acb)
return NULL;
===================================================================
@@ -29,5 +29,20 @@ void init_tracepoints(void);
* ),
* )
*/
+DECLARE_TRACE(virtio_blk_rw_complete,
+ TP_PROTO(void* req, int ret),
+ TP_STRUCT__entry(
+ __field(void*, req);
+ __field(int, ret);
+ )
+)
+
+DECLARE_TRACE(paio_submit,
+ TP_PROTO(int fd, int64_t sector_num),
+ TP_STRUCT__entry(
+ __field(int, fd);
+ __field(int64_t, sector_num);
+ )
+)
#endif /*__TRACE_ENTRIES_H__ */
===================================================================
@@ -20,7 +20,8 @@
void init_tracepoints(void)
{
// INIT_TRACE(foo);
-
+ INIT_TRACE(virtio_blk_rw_complete);
+ INIT_TRACE(paio_submit);
return;
}
@@ -37,4 +38,23 @@ void init_tracepoints(void)
* )
*
*/
+DEFINE_TRACE( virtio_blk_rw_complete,
+ TP_PROTO(void* req, int ret),
+ TP_fast_assign(
+ __entry->req = req;
+ __entry->ret = ret;
+ ),
+ TP_printk("virtio_blk_rw_complete: req %p ret %d\n",__entry->req,
+ __entry->ret)
+)
+
+DEFINE_TRACE( paio_submit,
+ TP_PROTO(int fd, int64_t sector_num),
+ TP_fast_assign(
+ __entry->fd = fd;
+ __entry->sector_num = sector_num;
+ ),
+ TP_printk("paio_submit: fd %d sector_num %ld\n",__entry->fd,
+ __entry->sector_num)
+)