diff options
author | Harsh Prateek Bora <harsh@linux.vnet.ibm.com> | 2012-06-08 03:20:42 +0530 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2012-06-25 08:52:44 -0500 |
commit | 08375616a0e24484f313900311e1748a2fe12f87 (patch) | |
tree | cb3c52f297feeacb71023e949332c5b94c29fdb8 | |
parent | b993b863e78ae54c5e966f4e1626bc37c560e6aa (diff) |
trace/simple.c: fix deprecated glib2 interface
Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
(cherry picked from commit 0d665005c7fd3800f1ae590701f60fe7e4c9a57a)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r-- | trace/simple.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/trace/simple.c b/trace/simple.c index 33ae48696d..b4a3c6e950 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, |