From: Li Zhi Hui <zhihuili@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Li Zhi Hui <zhihuili@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 3/3 v6] fdc.c: add tracing
Date: Tue, 15 May 2012 17:17:25 +0800 [thread overview]
Message-ID: <1337073445-9679-4-git-send-email-zhihuili@linux.vnet.ibm.com> (raw)
In-Reply-To: <1337073445-9679-1-git-send-email-zhihuili@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Li Zhi Hui <zhihuili@linux.vnet.ibm.com>
---
hw/fdc.c | 19 +++++++++++++++++++
trace-events | 8 ++++++++
2 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/hw/fdc.c b/hw/fdc.c
index 29ab29d..7ab8a1f 100644
--- a/hw/fdc.c
+++ b/hw/fdc.c
@@ -36,6 +36,7 @@
#include "qdev-addr.h"
#include "blockdev.h"
#include "sysemu.h"
+#include "trace.h"
/********************************************************/
/* debug Floppy devices */
@@ -1039,6 +1040,7 @@ static void fdctrl_stop_transfer(FDCtrl *fdctrl, uint8_t status0,
FDrive *cur_drv;
cur_drv = get_cur_drv(fdctrl);
+ trace_fdctrl_stop_transfer(cur_drv, status0, status1, status2);
FLOPPY_DPRINTF("transfer status: %02x %02x %02x (%02x)\n",
status0, status1, status2,
@@ -1077,6 +1079,11 @@ static void fdctrl_start_transfer(FDCtrl *fdctrl, int direction)
GET_CUR_DRV(fdctrl), kh, kt, ks,
fd_sector_calc(kh, kt, ks, cur_drv->last_sect,
NUM_SIDES(cur_drv)));
+
+ trace_fdctrl_start_transfer(cur_drv, direction, kh, kt, ks,
+ fd_sector_calc(kh, kt, ks, cur_drv->last_sect,
+ NUM_SIDES(cur_drv)));
+
switch (fd_seek(cur_drv, kh, kt, ks, fdctrl->config & FD_CONFIG_EIS)) {
case 2:
/* sect too big */
@@ -1190,6 +1197,10 @@ static void fdctrl_start_transfer_del(FDCtrl *fdctrl, int direction)
static int fdctrl_end_DMA(FDCtrl *fdctrl, int ret)
{
+ trace_fdctrl_end_DMA(get_cur_drv(fdctrl), ret,
+ fd_sector(get_cur_drv(fdctrl)), fdctrl->dma_pos,
+ fdctrl->dma_status2);
+
if (ret < 0) {
/* Sure, image size is too small... */
fdctrl->dma_pos = fdctrl->dma_len;
@@ -1224,6 +1235,10 @@ static int fdctrl_read_DMA(FDCtrl *fdctrl, int ret)
int nchan = fdctrl->dma_chann;
int len;
+ trace_fdctrl_read_DMA(cur_drv, ret, fdctrl->data_pos,
+ fd_sector(cur_drv), fdctrl->dma_pos,
+ fdctrl->dma_status2);
+
if (ret < 0) {
fdctrl->dma_status2 = 0x00;
return fdctrl_end_DMA(fdctrl, ret);
@@ -1287,6 +1302,8 @@ static int fdctrl_write_DMA(FDCtrl *fdctrl, int ret)
FDrive *cur_drv = get_cur_drv(fdctrl);
int len;
+ trace_fdctrl_write_DMA(cur_drv, ret, fd_sector(cur_drv), fdctrl->dma_pos);
+
if (!fdctrl_seek_to_next_sect(fdctrl, cur_drv)) {
fdctrl->dma_len = fdctrl->dma_pos;
}
@@ -1319,6 +1336,8 @@ static int fdctrl_transfer_handler (void *opaque, int nchan,
int len;
assert(fdctrl->dma_chann == nchan);
+ trace_fdctrl_transfer_handler(cur_drv, dma_pos, dma_len,
+ fdctrl->dma_pos, fdctrl->dma_len);
if (fdctrl->msr & FD_MSR_RQM) {
FLOPPY_DPRINTF("Not in DMA transfer mode !\n");
diff --git a/trace-events b/trace-events
index 87cb96c..f540302 100644
--- a/trace-events
+++ b/trace-events
@@ -805,3 +805,11 @@ qxl_render_blit_guest_primary_initialized(void) ""
qxl_render_blit(int32_t stride, int32_t left, int32_t right, int32_t top, int32_t bottom) "stride=%d [%d, %d, %d, %d]"
qxl_render_guest_primary_resized(int32_t width, int32_t height, int32_t stride, int32_t bytes_pp, int32_t bits_pp) "%dx%d, stride %d, bpp %d, depth %d"
qxl_render_update_area_done(void *cookie) "%p"
+
+# hw/fdc.c
+fdctrl_stop_transfer(void *cur_drv, int status0, int status1, int status2) "drive=%p status=%02x/%02x/%02x"
+fdctrl_start_transfer(void *cur_drv, int direction, int kh, int kt, int ks, int sector) "drive=%p dir=%d h%d/t%d/s%d (sector %d)"
+fdctrl_transfer_handler(void *cur_drv, int dma_pos, int dma_len, int fdctrl_dma_pos, int fdctrl_dma_len) "drive=%p pos=%d/%d (expected %d/%d)"
+fdctrl_end_DMA(void *cur_drv, int ret, int sector, int pos, int status2) "drive=%p ret=%d sector=%d pos=%d status2=%02x"
+fdctrl_read_DMA(void *cur_drv, int ret, int data_pos, int sector, int pos, int status2) "drive=%p ret=%d data_pos=%d sector=%d pos=%d status2=%02x"
+fdctrl_write_DMA(void *cur_drv, int ret, int sector, int pos) "drive=%p ret=%d sector=%d pos=%d"
--
1.7.4.1
prev parent reply other threads:[~2012-05-15 9:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-15 9:17 [Qemu-devel] [PATCH 0/3 v6] Replace bdrv_* to bdrv_aio_* functions in DMA mode in fdc.c Li Zhi Hui
2012-05-15 9:17 ` [Qemu-devel] [PATCH 1/3 v6] add function DMA_set_return and DMA_set_channel_async in dma.c Li Zhi Hui
2012-05-15 9:17 ` [Qemu-devel] [PATCH 2/3 v6] Replace bdrv_* to bdrv_aio_* functions in DMA mode in fdc.c Li Zhi Hui
2012-05-15 9:27 ` Paolo Bonzini
2012-05-15 9:33 ` Kevin Wolf
2012-05-15 9:38 ` Paolo Bonzini
2012-05-16 8:23 ` Zhi Hui Li
2012-05-16 9:11 ` Paolo Bonzini
2012-05-16 10:59 ` Kevin Wolf
2012-05-15 20:49 ` Hervé Poussineau
2012-05-16 7:58 ` Zhi Hui Li
2012-05-15 9:17 ` Li Zhi Hui [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1337073445-9679-4-git-send-email-zhihuili@linux.vnet.ibm.com \
--to=zhihuili@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).