*/
#define _GNU_SOURCE
+#define _LGPL_SOURCE
#include <unistd.h>
#include <sys/syscall.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
-#define _LGPL_SOURCE
#include <urcu-bp.h>
#include <urcu/rculist.h>
}
-notrace void ltt_vtrace(const struct marker *mdata, void *probe_data,
- struct registers *regs, void *call_data,
+notrace void ltt_vtrace(const struct ust_marker *mdata, void *probe_data,
+ void *call_data,
const char *fmt, va_list *args)
{
int largest_align, ret;
- struct ltt_active_marker *pdata;
+ struct ltt_active_ust_marker *pdata;
uint16_t eID;
size_t data_size, slot_size;
unsigned int chan_index;
if (unlikely(ltt_traces.num_active_traces == 0))
return;
- rcu_read_lock(); //ust// rcu_read_lock_sched_notrace();
+ rcu_read_lock();
cpu = ust_get_cpu();
/* Force volatile access. */
stack_pos_ctx = tracer_stack_pos;
cmm_barrier();
- pdata = (struct ltt_active_marker *)probe_data;
+ pdata = (struct ltt_active_ust_marker *)probe_data;
eID = mdata->event_id;
chan_index = mdata->channel_id;
closure.callbacks = pdata->probe->callbacks;
if (!channel->active)
continue;
- /* If a new cpu was plugged since the trace was started, we did
+ /*
+ * If a new cpu was plugged since the trace was started, we did
* not add it to the trace, and therefore we write the event to
* cpu 0.
*/
- if(cpu >= channel->n_cpus) {
+ if (cpu >= channel->n_cpus) {
cpu = 0;
}
va_copy(args_copy, *args);
/* FIXME : could probably encapsulate transport better. */
-//ust// buf = ((struct rchan *)channel->trans_channel_data)->buf[cpu];
buf = channel->buf[cpu];
/* Out-of-order write : header and data */
buf_offset = ltt_write_event_header(channel, buf, buf_offset,
tracer_stack_pos = stack_pos_ctx;
CMM_STORE_SHARED(ltt_nesting, CMM_LOAD_SHARED(ltt_nesting) - 1);
- rcu_read_unlock(); //ust// rcu_read_unlock_sched_notrace();
+ rcu_read_unlock();
}
-notrace void ltt_trace(const struct marker *mdata, void *probe_data,
- struct registers *regs, void *call_data,
+notrace void ltt_trace(const struct ust_marker *mdata, void *probe_data,
+ void *call_data,
const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
- ltt_vtrace(mdata, probe_data, regs, call_data, fmt, &args);
+ ltt_vtrace(mdata, probe_data, call_data, fmt, &args);
va_end(args);
}
static notrace void copy_token(char **out, const char **in)
{
- while(**in != ' ' && **in != '\0') {
+ while (**in != ' ' && **in != '\0') {
**out = **in;
(*out)++;
(*in)++;
int result;
enum { none, cfmt, tracefmt, argname } prev_token = none;
- while(*orig_fmt_p != '\0') {
- if(*orig_fmt_p == '%') {
+ while (*orig_fmt_p != '\0') {
+ if (*orig_fmt_p == '%') {
prev_token = cfmt;
copy_token(&new_fmt_p, &orig_fmt_p);
}
- else if(*orig_fmt_p == '#') {
+ else if (*orig_fmt_p == '#') {
prev_token = tracefmt;
do {
orig_fmt_p++;
- } while(*orig_fmt_p != ' ' && *orig_fmt_p != '\0');
+ } while (*orig_fmt_p != ' ' && *orig_fmt_p != '\0');
}
- else if(*orig_fmt_p == ' ') {
- if(prev_token == argname) {
+ else if (*orig_fmt_p == ' ') {
+ if (prev_token == argname) {
*new_fmt_p = '=';
new_fmt_p++;
}
- else if(prev_token == cfmt) {
+ else if (prev_token == cfmt) {
*new_fmt_p = ' ';
new_fmt_p++;
}
*new_fmt_p = '\0';
- if(outbuf == NULL) {
+ if (outbuf == NULL) {
/* use this false_buffer for compatibility with pre-C99 */
outbuf = &false_buf;
bufsize = 1;