projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
convert ltt_nesting to a per_thread variable, and access it with volatile access
[lttng-ust.git]
/
libust
/
serialize.c
diff --git
a/libust/serialize.c
b/libust/serialize.c
index 6a8688420369ee073d3ae3fba779ed70d23181e1..4c23e8dd02451d46d6b8de34c418d40e872bc9f3 100644
(file)
--- a/
libust/serialize.c
+++ b/
libust/serialize.c
@@
-41,6
+41,7
@@
#include "tracer.h"
//#include "list.h"
#include "usterr.h"
#include "tracer.h"
//#include "list.h"
#include "usterr.h"
+#include "ust_snprintf.h"
enum ltt_type {
LTT_TYPE_SIGNED_INT,
enum ltt_type {
LTT_TYPE_SIGNED_INT,
@@
-622,11
+623,11
@@
notrace void ltt_vtrace(const struct marker *mdata, void *probe_data,
return;
rcu_read_lock(); //ust// rcu_read_lock_sched_notrace();
return;
rcu_read_lock(); //ust// rcu_read_lock_sched_notrace();
-//ust// cpu = smp_processor_id();
cpu = ust_get_cpu();
cpu = ust_get_cpu();
-//ust// __get_cpu_var(ltt_nesting)++;
- /* FIXME: should nesting be per-cpu? */
- ltt_nesting++;
+
+ /* Force volatile access. */
+ STORE_SHARED(ltt_nesting, LOAD_SHARED(ltt_nesting) + 1);
+ barrier();
pdata = (struct ltt_active_marker *)probe_data;
eID = mdata->event_id;
pdata = (struct ltt_active_marker *)probe_data;
eID = mdata->event_id;
@@
-709,10
+710,12
@@
notrace void ltt_vtrace(const struct marker *mdata, void *probe_data,
va_end(args_copy);
/* Out-of-order commit */
ltt_commit_slot(channel, buf, buf_offset, data_size, slot_size);
va_end(args_copy);
/* Out-of-order commit */
ltt_commit_slot(channel, buf, buf_offset, data_size, slot_size);
- DBG("just commited event
at offset %ld and size %zd"
, buf_offset, slot_size);
+ DBG("just commited event
(%s/%s) at offset %ld and size %zd", mdata->channel, mdata->name
, buf_offset, slot_size);
}
}
-//ust// __get_cpu_var(ltt_nesting)--;
- ltt_nesting--;
+
+ barrier();
+ STORE_SHARED(ltt_nesting, LOAD_SHARED(ltt_nesting) - 1);
+
rcu_read_unlock(); //ust// rcu_read_unlock_sched_notrace();
}
rcu_read_unlock(); //ust// rcu_read_unlock_sched_notrace();
}
@@
-808,7
+811,7
@@
int serialize_to_text(char *outbuf, int bufsize, const char *fmt, va_list ap)
outbuf = &false_buf;
bufsize = 1;
}
outbuf = &false_buf;
bufsize = 1;
}
- result = vsnprintf(outbuf, bufsize, new_fmt, ap);
+ result =
ust_safe_
vsnprintf(outbuf, bufsize, new_fmt, ap);
return result;
}
return result;
}
This page took
0.024764 seconds
and
4
git commands to generate.