All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com, mdroth@linux.vnet.ibm.com, quintela@redhat.com
Subject: [Qemu-devel] [PATCH v2 07/10] trace: qemu_(put|get)_(byte|buffer) events
Date: Thu, 27 Oct 2011 12:06:30 -0500	[thread overview]
Message-ID: <1319735193-4718-8-git-send-email-mdroth@linux.vnet.ibm.com> (raw)
In-Reply-To: <1319735193-4718-1-git-send-email-mdroth@linux.vnet.ibm.com>


Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qemu-file.c  |   13 +++++++++++++
 trace-events |   18 ++++++++++++++++++
 2 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/qemu-file.c b/qemu-file.c
index cdfe8a3..89b58be 100644
--- a/qemu-file.c
+++ b/qemu-file.c
@@ -27,6 +27,7 @@
 #include "hw/hw.h"
 #include "qapi/qemu-file-output-visitor.h"
 #include "qapi/qemu-file-input-visitor.h"
+#include "trace.h"
 
 #define IO_BUF_SIZE 32768
 
@@ -454,6 +455,8 @@ void qemu_put_buffer(QEMUFile *f, const uint8_t *buf, int size)
 {
     int l;
 
+    trace_qemu_put_buffer(f, buf, size);
+
     if (!f->last_error && f->is_write == 0 && f->buf_index > 0) {
         fprintf(stderr,
                 "Attempted to write to buffer while read buffer is not empty\n");
@@ -484,6 +487,7 @@ void qemu_put_byte(QEMUFile *f, int v)
         abort();
     }
 
+    trace_qemu_put_byte(f, v & 0xff);
     f->buf[f->buf_index++] = v;
     f->is_write = 1;
     if (f->buf_index >= IO_BUF_SIZE) {
@@ -531,6 +535,8 @@ int qemu_get_buffer(QEMUFile *f, uint8_t *buf, int size)
     int pending = size;
     int done = 0;
 
+    trace_qemu_get_buffer(f, buf, size);
+
     while (pending > 0) {
         int res;
 
@@ -570,6 +576,7 @@ int qemu_get_byte(QEMUFile *f)
 
     result = qemu_peek_byte(f, 0);
     qemu_file_skip(f, 1);
+    trace_qemu_get_byte(f, result);
     return result;
 }
 
@@ -632,6 +639,7 @@ void qemu_put_be16(QEMUFile *f, unsigned int v)
 {
     qemu_put_byte(f, v >> 8);
     qemu_put_byte(f, v);
+    trace_qemu_put_be16(f, v);
 }
 
 void qemu_put_be32(QEMUFile *f, unsigned int v)
@@ -640,12 +648,14 @@ void qemu_put_be32(QEMUFile *f, unsigned int v)
     qemu_put_byte(f, v >> 16);
     qemu_put_byte(f, v >> 8);
     qemu_put_byte(f, v);
+    trace_qemu_put_be32(f, v);
 }
 
 void qemu_put_be64(QEMUFile *f, uint64_t v)
 {
     qemu_put_be32(f, v >> 32);
     qemu_put_be32(f, v);
+    trace_qemu_put_be64(f, v);
 }
 
 unsigned int qemu_get_be16(QEMUFile *f)
@@ -653,6 +663,7 @@ unsigned int qemu_get_be16(QEMUFile *f)
     unsigned int v;
     v = qemu_get_byte(f) << 8;
     v |= qemu_get_byte(f);
+    trace_qemu_get_be16(f, v);
     return v;
 }
 
@@ -663,6 +674,7 @@ unsigned int qemu_get_be32(QEMUFile *f)
     v |= qemu_get_byte(f) << 16;
     v |= qemu_get_byte(f) << 8;
     v |= qemu_get_byte(f);
+    trace_qemu_get_be32(f, v);
     return v;
 }
 
@@ -671,5 +683,6 @@ uint64_t qemu_get_be64(QEMUFile *f)
     uint64_t v;
     v = (uint64_t)qemu_get_be32(f) << 32;
     v |= qemu_get_be32(f);
+    trace_qemu_get_be64(f, v);
     return v;
 }
diff --git a/trace-events b/trace-events
index 820b1d6..6e36266 100644
--- a/trace-events
+++ b/trace-events
@@ -624,3 +624,21 @@ 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"
+
+# qemu-file.c
+qemu_put_buffer(void *f, const uint8_t *buf, int size) "file=%p, buf=%p, size=%d"
+qemu_get_buffer(void *f, const uint8_t *buf, int size) "file=%p, buf=%p, size=%d"
+qemu_put_byte(void *f, int val) "file=%p, val=0x%x"
+qemu_get_byte(void *f, int val) "file=%p, val=0x%x"
+qemu_put_be16(void *f, unsigned int v) "file=%p, val=0x%x"
+qemu_get_be16(void *f, unsigned int v) "file=%p, val=0x%x"
+qemu_put_be32(void *f, unsigned int v) "file=%p, val=0x%x"
+qemu_get_be32(void *f, unsigned int v) "file=%p, val=0x%x"
+qemu_put_be64(void *f, uint64_t v) "file=%p, val=0x%"PRIx64
+qemu_get_be64(void *f, uint64_t v) "file=%p, val=0x%"PRIx64
+qemu_put_sbe16(void *f, int v) "file=%p, val=0x%x"
+qemu_get_sbe16(void *f, int v) "file=%p, val=0x%x"
+qemu_put_sbe32(void *f, int v) "file=%p, val=0x%x"
+qemu_get_sbe32(void *f, int v) "file=%p, val=0x%x"
+qemu_put_sbe64(void *f, int64_t v) "file=%p, val=0x%"PRIx64
+qemu_get_sbe64(void *f, int64_t v) "file=%p, val=0x%"PRIx64
-- 
1.7.4.1

  parent reply	other threads:[~2011-10-27 17:07 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-27 17:06 [Qemu-devel] [PATCH v2 00/10] do savevm/migration save/load via Visitor interface Michael Roth
2011-10-27 17:06 ` [Qemu-devel] [PATCH v2 01/10] qapi: add Visitor interfaces for uint*_t and int*_t Michael Roth
2011-12-20 11:12   ` Paolo Bonzini
2011-12-20 11:43     ` Paolo Bonzini
2011-12-20 12:00       ` Paolo Bonzini
2011-12-20 13:50     ` Anthony Liguori
2011-12-20 14:30       ` Paolo Bonzini
2011-12-20 20:22         ` Michael Roth
2011-12-21 12:29           ` Paolo Bonzini
2011-12-20 20:56         ` Anthony Liguori
2011-12-21 12:35           ` Paolo Bonzini
2011-12-21 14:45             ` Anthony Liguori
2011-12-21 15:39               ` Paolo Bonzini
2011-12-21 16:24                 ` Anthony Liguori
2011-12-21 16:52                   ` Paolo Bonzini
2011-10-27 17:06 ` [Qemu-devel] [PATCH v2 02/10] qapi: add QemuFileOutputVisitor Michael Roth
2011-10-27 17:06 ` [Qemu-devel] [PATCH v2 03/10] qapi: add QemuFileInputVisitor Michael Roth
2011-10-27 17:06 ` [Qemu-devel] [PATCH v2 04/10] savevm: move QEMUFile interfaces into qemu-file.c Michael Roth
2011-10-27 17:06 ` [Qemu-devel] [PATCH v2 05/10] qapi: test cases for QEMUFile input/output visitors Michael Roth
2011-10-27 17:06 ` [Qemu-devel] [PATCH v2 06/10] qemu-file: add QEMUFile<->visitor lookup routines Michael Roth
2011-10-27 17:06 ` Michael Roth [this message]
2011-10-27 17:06 ` [Qemu-devel] [PATCH v2 08/10] trace: add trace statements for visitor interface Michael Roth
2011-10-27 17:06 ` [Qemu-devel] [PATCH v2 09/10] qapi: add trace statements to qapi-visit-core.c Michael Roth
2011-10-27 17:06 ` [Qemu-devel] [PATCH v2 10/10] vmstate: use visitors Michael Roth

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=1319735193-4718-8-git-send-email-mdroth@linux.vnet.ibm.com \
    --to=mdroth@linux.vnet.ibm.com \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.