projects
/
sdk
/
emulator
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8e0fdce
)
trace/simple.c: fix deprecated glib2 interface
author
Harsh Prateek Bora
<harsh@linux.vnet.ibm.com>
Thu, 7 Jun 2012 21:50:42 +0000
(
03:20
+0530)
committer
Stefan Hajnoczi
<stefanha@linux.vnet.ibm.com>
Fri, 8 Jun 2012 08:32:40 +0000
(09:32 +0100)
Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
trace/simple.c
patch
|
blob
|
history
diff --git
a/trace/simple.c
b/trace/simple.c
index 33ae48696d194d7890152cf81ca3db619f3c494e..b4a3c6e9501db07a541f8e5cf98cf359adfa57ec 100644
(file)
--- 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,