aboutsummaryrefslogtreecommitdiff
path: root/trace/simple.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-06-11 12:15:51 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2012-06-11 12:15:51 -0500
commit3525c42fd3b70182b1f98d74439e8aeabb565803 (patch)
treecec952b64cbf2222bb0817ea1fc181cc021af6f8 /trace/simple.c
parent39cde84517ce1bcef294dc9e9e0940475c46fab2 (diff)
parent263ddcc81bf45d475ef86100a8567b3fb2129b8d (diff)
downloadqemu-3525c42fd3b70182b1f98d74439e8aeabb565803.zip
qemu-3525c42fd3b70182b1f98d74439e8aeabb565803.tar.gz
qemu-3525c42fd3b70182b1f98d74439e8aeabb565803.tar.bz2
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
* stefanha/trivial-patches: configure: report missing libraries for virtfs trace/simple.c: fix deprecated glib2 interface Clarify comments of tb_invalidate_phys_[page_]range
Diffstat (limited to 'trace/simple.c')
-rw-r--r--trace/simple.c5
1 files changed, 4 insertions, 1 deletions
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,