projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix compilation with uclibc
[lttng-ust.git]
/
libust
/
serialize.c
diff --git
a/libust/serialize.c
b/libust/serialize.c
index bd947ab1f90d9cd1358bae1538d0f80de2429e62..81f8e4c610107e6080c1ea6eee8e3702bcd74cd6 100644
(file)
--- a/
libust/serialize.c
+++ b/
libust/serialize.c
@@
-25,6
+25,7
@@
*/
#define _GNU_SOURCE
*/
#define _GNU_SOURCE
+#define _LGPL_SOURCE
#include <unistd.h>
#include <sys/syscall.h>
#include <stdarg.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <stdarg.h>
@@
-32,7
+33,6
@@
#include <stdint.h>
#include <stdio.h>
#include <stdint.h>
#include <stdio.h>
-#define _LGPL_SOURCE
#include <urcu-bp.h>
#include <urcu/rculist.h>
#include <urcu-bp.h>
#include <urcu/rculist.h>
@@
-40,7
+40,7
@@
#include <ust/clock.h>
#include "buffers.h"
#include "tracer.h"
#include <ust/clock.h>
#include "buffers.h"
#include "tracer.h"
-#include "usterr.h"
+#include "usterr
_signal_safe
.h"
#include "ust_snprintf.h"
/*
#include "ust_snprintf.h"
/*
@@
-429,7
+429,7
@@
static inline size_t serialize_trace_data(struct ust_buffer *buf,
*/
tracer_stack_pos++;
assert(tracer_stack_pos <= TRACER_STACK_LEN);
*/
tracer_stack_pos++;
assert(tracer_stack_pos <= TRACER_STACK_LEN);
- barrier();
+
cmm_
barrier();
tracer_stack[*stack_pos_ctx] =
strlen(tmp.v_string.s) + 1;
}
tracer_stack[*stack_pos_ctx] =
strlen(tmp.v_string.s) + 1;
}
@@
-624,12
+624,12
@@
void ltt_write_event_data(struct ust_buffer *buf, size_t buf_offset,
}
}
-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;
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;
uint16_t eID;
size_t data_size, slot_size;
unsigned int chan_index;
@@
-653,15
+653,15
@@
notrace void ltt_vtrace(const struct marker *mdata, void *probe_data,
if (unlikely(ltt_traces.num_active_traces == 0))
return;
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. */
cpu = ust_get_cpu();
/* Force volatile access. */
-
STORE_SHARED(ltt_nesting,
LOAD_SHARED(ltt_nesting) + 1);
+
CMM_STORE_SHARED(ltt_nesting, CMM_
LOAD_SHARED(ltt_nesting) + 1);
stack_pos_ctx = tracer_stack_pos;
stack_pos_ctx = tracer_stack_pos;
- barrier();
+
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;
eID = mdata->event_id;
chan_index = mdata->channel_id;
closure.callbacks = pdata->probe->callbacks;
@@
-685,7
+685,7
@@
notrace void ltt_vtrace(const struct marker *mdata, void *probe_data,
va_end(args_copy);
/* Iterate on each trace */
va_end(args_copy);
/* Iterate on each trace */
- list_for_each_entry_rcu(trace, <t_traces.head, list) {
+
cds_
list_for_each_entry_rcu(trace, <t_traces.head, list) {
/*
* Expect the filter to filter out events. If we get here,
* we went through tracepoint activation as a first step.
/*
* Expect the filter to filter out events. If we get here,
* we went through tracepoint activation as a first step.
@@
-713,11
+713,12
@@
notrace void ltt_vtrace(const struct marker *mdata, void *probe_data,
if (!channel->active)
continue;
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.
*/
* 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;
}
cpu = 0;
}
@@
-730,7
+731,6
@@
notrace void ltt_vtrace(const struct marker *mdata, void *probe_data,
va_copy(args_copy, *args);
/* FIXME : could probably encapsulate transport better. */
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,
buf = channel->buf[cpu];
/* Out-of-order write : header and data */
buf_offset = ltt_write_event_header(channel, buf, buf_offset,
@@
-745,21
+745,21
@@
notrace void ltt_vtrace(const struct marker *mdata, void *probe_data,
DBG("just commited event (%s/%s) at offset %ld and size %zd", mdata->channel, mdata->name, buf_offset, slot_size);
}
DBG("just commited event (%s/%s) at offset %ld and size %zd", mdata->channel, mdata->name, buf_offset, slot_size);
}
- barrier();
+
cmm_
barrier();
tracer_stack_pos = stack_pos_ctx;
tracer_stack_pos = stack_pos_ctx;
-
STORE_SHARED(ltt_nesting,
LOAD_SHARED(ltt_nesting) - 1);
+
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);
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);
}
va_end(args);
}
@@
-771,7
+771,7
@@
static notrace void skip_space(const char **ps)
static notrace void copy_token(char **out, const char **in)
{
static notrace void copy_token(char **out, const char **in)
{
- while(**in != ' ' && **in != '\0') {
+ while
(**in != ' ' && **in != '\0') {
**out = **in;
(*out)++;
(*in)++;
**out = **in;
(*out)++;
(*in)++;
@@
-808,23
+808,23
@@
int serialize_to_text(char *outbuf, int bufsize, const char *fmt, va_list ap)
int result;
enum { none, cfmt, tracefmt, argname } prev_token = none;
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);
}
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++;
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++;
}
*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 = ' ';
new_fmt_p++;
}
@@
-839,7
+839,7
@@
int serialize_to_text(char *outbuf, int bufsize, const char *fmt, va_list ap)
*new_fmt_p = '\0';
*new_fmt_p = '\0';
- if(outbuf == NULL) {
+ if
(outbuf == NULL) {
/* use this false_buffer for compatibility with pre-C99 */
outbuf = &false_buf;
bufsize = 1;
/* use this false_buffer for compatibility with pre-C99 */
outbuf = &false_buf;
bufsize = 1;
This page took
0.026869 seconds
and
4
git commands to generate.