#include "tracer.h"
//#include "list.h"
#include "usterr.h"
+#include "ust_snprintf.h"
enum ltt_type {
LTT_TYPE_SIGNED_INT,
return;
rcu_read_lock(); //ust// rcu_read_lock_sched_notrace();
-//ust// cpu = smp_processor_id();
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;
largest_align = 1; /* must be non-zero for ltt_align */
data_size = ltt_get_data_size(&closure, serialize_private,
&largest_align, fmt, &args_copy);
+ largest_align = min_t(int, largest_align, sizeof(void *));
va_end(args_copy);
/* Iterate on each trace */
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();
}
outbuf = &false_buf;
bufsize = 1;
}
- result = vsnprintf(outbuf, bufsize, new_fmt, ap);
+ result = ust_safe_vsnprintf(outbuf, bufsize, new_fmt, ap);
return result;
}