qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>,
	qemu-devel@nongnu.org,
	Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 2/3] trace/simple.c: fix deprecated glib2 interface
Date: Fri,  8 Jun 2012 11:02:08 +0100	[thread overview]
Message-ID: <1339149729-26331-3-git-send-email-stefanha@linux.vnet.ibm.com> (raw)
In-Reply-To: <1339149729-26331-1-git-send-email-stefanha@linux.vnet.ibm.com>

From: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>

Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 trace/simple.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/trace/simple.c b/trace/simple.c
index 33ae486..b4a3c6e 100644
--- a/trace/simple.c
+++ b/trace/simple.c
@@ -161,8 +161,11 @@ static void trace(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3,
     }
 
     timestamp = get_clock();
-
+#if GLIB_CHECK_VERSION(2, 30, 0)
+    idx = g_atomic_int_add((gint *)&trace_idx, 1) % TRACE_BUF_LEN;
+#else
     idx = g_atomic_int_exchange_and_add((gint *)&trace_idx, 1) % TRACE_BUF_LEN;
+#endif
     trace_buf[idx] = (TraceRecord){
         .event = event,
         .timestamp_ns = timestamp,
-- 
1.7.10

  parent reply	other threads:[~2012-06-08 10:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-08 10:02 [Qemu-devel] [PULL 0/3] Trivial patches for May 2 to June 8 2012 Stefan Hajnoczi
2012-06-08 10:02 ` [Qemu-devel] [PATCH 1/3] Clarify comments of tb_invalidate_phys_[page_]range Stefan Hajnoczi
2012-06-08 10:02 ` Stefan Hajnoczi [this message]
2012-06-08 10:02 ` [Qemu-devel] [PATCH 3/3] configure: report missing libraries for virtfs Stefan Hajnoczi
2012-06-11 18:27 ` [Qemu-devel] [PULL 0/3] Trivial patches for May 2 to June 8 2012 Anthony Liguori

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=1339149729-26331-3-git-send-email-stefanha@linux.vnet.ibm.com \
    --to=stefanha@linux.vnet.ibm.com \
    --cc=aliguori@us.ibm.com \
    --cc=harsh@linux.vnet.ibm.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).