From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sckbf-00042b-Q9 for qemu-devel@nongnu.org; Thu, 07 Jun 2012 17:51:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sckbd-0008Bk-Im for qemu-devel@nongnu.org; Thu, 07 Jun 2012 17:51:03 -0400 Received: from e28smtp05.in.ibm.com ([122.248.162.5]:59494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sckbc-00085K-Ud for qemu-devel@nongnu.org; Thu, 07 Jun 2012 17:51:01 -0400 Received: from /spool/local by e28smtp05.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 8 Jun 2012 03:20:52 +0530 From: Harsh Prateek Bora Date: Fri, 8 Jun 2012 03:20:42 +0530 Message-Id: <1339105843-30064-2-git-send-email-harsh@linux.vnet.ibm.com> In-Reply-To: <1339105843-30064-1-git-send-email-harsh@linux.vnet.ibm.com> References: <1339105843-30064-1-git-send-email-harsh@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 1/2] trace/simple.c: fix deprecated glib2 interface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org Cc: Harsh Prateek Bora , stefanha@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com Signed-off-by: Harsh Prateek Bora --- 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.2