From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTb4h-0007TO-To for qemu-devel@nongnu.org; Thu, 24 Nov 2011 10:18:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTb4g-0007qC-Sq for qemu-devel@nongnu.org; Thu, 24 Nov 2011 10:18:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:9799) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTb4g-0007q4-FE for qemu-devel@nongnu.org; Thu, 24 Nov 2011 10:18:54 -0500 From: Kevin Wolf Date: Thu, 24 Nov 2011 16:22:00 +0100 Message-Id: <1322148120-12769-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH] dma-helpers: Add trace events List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@gmail.com Signed-off-by: Kevin Wolf --- dma-helpers.c | 10 ++++++++++ trace-events | 7 +++++++ 2 files changed, 17 insertions(+), 0 deletions(-) diff --git a/dma-helpers.c b/dma-helpers.c index bdcd38c..9d6b6fa 100644 --- a/dma-helpers.c +++ b/dma-helpers.c @@ -9,6 +9,7 @@ #include "dma.h" #include "block_int.h" +#include "trace.h" void qemu_sglist_init(QEMUSGList *qsg, int alloc_hint) { @@ -83,6 +84,8 @@ static void dma_bdrv_unmap(DMAAIOCB *dbs) static void dma_complete(DMAAIOCB *dbs, int ret) { + trace_dma_complete(dbs, ret, dbs->common.cb); + dma_bdrv_unmap(dbs); if (dbs->common.cb) { dbs->common.cb(dbs->common.opaque, ret); @@ -106,6 +109,8 @@ static void dma_bdrv_cb(void *opaque, int ret) target_phys_addr_t cur_addr, cur_len; void *mem; + trace_dma_bdrv_cb(dbs, ret); + dbs->acb = NULL; dbs->sector_num += dbs->iov.size / 512; dma_bdrv_unmap(dbs); @@ -130,6 +135,7 @@ static void dma_bdrv_cb(void *opaque, int ret) } if (dbs->iov.size == 0) { + trace_dma_map_wait(dbs); cpu_register_map_client(dbs, continue_after_map_failure); return; } @@ -145,6 +151,8 @@ static void dma_aio_cancel(BlockDriverAIOCB *acb) { DMAAIOCB *dbs = container_of(acb, DMAAIOCB, common); + trace_dma_aio_cancel(dbs); + if (dbs->acb) { BlockDriverAIOCB *acb = dbs->acb; dbs->acb = NULL; @@ -168,6 +176,8 @@ BlockDriverAIOCB *dma_bdrv_io( { DMAAIOCB *dbs = qemu_aio_get(&dma_aio_pool, bs, cb, opaque); + trace_dma_bdrv_io(dbs, bs, sector_num, to_dev); + dbs->acb = NULL; dbs->bs = bs; dbs->sg = sg; diff --git a/trace-events b/trace-events index 518b76b..bf1cf57 100644 --- a/trace-events +++ b/trace-events @@ -632,3 +632,10 @@ win_helper_no_switch_pstate(uint32_t new_pstate_regs) "change_pstate: regs new=% win_helper_wrpil(uint32_t psrpil, uint32_t new_pil) "old=%x new=%x" win_helper_done(uint32_t tl) "tl=%d" win_helper_retry(uint32_t tl) "tl=%d" + +# dma-helpers.c +dma_bdrv_io(void *dbs, void *bs, int64_t sector_num, bool to_dev) "dbs=%p bs=%p sector_num=%" PRId64 " to_dev=%d" +dma_aio_cancel(void *dbs) "dbs=%p" +dma_complete(void *dbs, int ret, void *cb) "dbs=%p ret=%d cb=%p" +dma_bdrv_cb(void *dbs, int ret) "dbs=%p ret=%d" +dma_map_wait(void *dbs) "dbs=%p" -- 1.7.6.4