#include <ltt/ltt-facility-id-user_generic.h>
#include <ltt/ltt-usertrace.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Named types */
/* Event string structures */
static inline void lttng_write_string_user_generic_string_data(
- void *buffer,
+ char *buffer,
size_t *to_base,
size_t *to,
- const void **from,
+ const char **from,
size_t *len,
const char * obj)
{
/* Event string logging function */
+static inline int trace_user_generic_string(
+ const char * lttng_param_data);
+
#ifndef LTT_TRACE_FAST
static inline int trace_user_generic_string(
const char * lttng_param_data)
#else
{
int ret = 0;
- void *buffer = NULL;
+ char *buffer = NULL;
size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
size_t *to_base = &real_to_base;
size_t real_to = 0;
size_t *len = &real_len;
size_t reserve_size;
size_t slot_size;
- const void *real_from;
- const void **from = &real_from;
+ const char *real_from;
+ const char **from = &real_from;
/* For each field, calculate the field size. */
/* size = *to_base + *to + *len */
/* Assume that the padding for alignment starts at a
* sizeof(void *) address. */
- *from = lttng_param_data;
+ *from = (const char*)lttng_param_data;
lttng_write_string_user_generic_string_data(buffer, to_base, to, from, len, lttng_param_data);
reserve_size = *to_base + *to + *len;
*to_base = *to = *len = 0;
- *from = lttng_param_data;
+ *from = (const char*)lttng_param_data;
lttng_write_string_user_generic_string_data(buffer, to_base, to, from, len, lttng_param_data);
/* Flush pending memcpy */
unsigned int index;
struct ltt_trace_info *trace = thread_trace_info;
struct ltt_buf *ltt_buf;
- void *buffer = NULL;
+ char *buffer = NULL;
size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
size_t *to_base = &real_to_base;
size_t real_to = 0;
size_t *len = &real_len;
size_t reserve_size;
size_t slot_size;
- const void *real_from;
- const void **from = &real_from;
+ const char *real_from;
+ const char **from = &real_from;
uint64_t tsc;
size_t before_hdr_pad, after_hdr_pad, header_size;
/* Assume that the padding for alignment starts at a
* sizeof(void *) address. */
- *from = lttng_param_data;
+ *from = (const char*)lttng_param_data;
lttng_write_string_user_generic_string_data(buffer, to_base, to, from, len, lttng_param_data);
reserve_size = *to_base + *to + *len;
reserve_size, before_hdr_pad, tsc);
*to_base += before_hdr_pad + after_hdr_pad + header_size;
- *from = lttng_param_data;
+ *from = (const char*)lttng_param_data;
lttng_write_string_user_generic_string_data(buffer, to_base, to, from, len, lttng_param_data);
/* Flush pending memcpy */
/* Event string_pointer structures */
static inline void lttng_write_string_user_generic_string_pointer_string(
- void *buffer,
+ char *buffer,
size_t *to_base,
size_t *to,
- const void **from,
+ const char **from,
size_t *len,
const char * obj)
{
/* Event string_pointer logging function */
+static inline int trace_user_generic_string_pointer(
+ const char * lttng_param_string,
+ const void * lttng_param_pointer);
+
#ifndef LTT_TRACE_FAST
static inline int trace_user_generic_string_pointer(
const char * lttng_param_string,
#else
{
int ret = 0;
- void *buffer = NULL;
+ char *buffer = NULL;
size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
size_t *to_base = &real_to_base;
size_t real_to = 0;
size_t reserve_size;
size_t slot_size;
size_t align;
- const void *real_from;
- const void **from = &real_from;
+ const char *real_from;
+ const char **from = &real_from;
/* For each field, calculate the field size. */
/* size = *to_base + *to + *len */
/* Assume that the padding for alignment starts at a
* sizeof(void *) address. */
- *from = lttng_param_string;
+ *from = (const char*)lttng_param_string;
lttng_write_string_user_generic_string_pointer_string(buffer, to_base, to, from, len, lttng_param_string);
- *from = <tng_param_pointer;
+ *from = (const char*)<tng_param_pointer;
align = sizeof(const void *);
if(*len == 0) {
*to_base = *to = *len = 0;
- *from = lttng_param_string;
+ *from = (const char*)lttng_param_string;
lttng_write_string_user_generic_string_pointer_string(buffer, to_base, to, from, len, lttng_param_string);
/* Flush pending memcpy */
*len = 0;
}
- *from = <tng_param_pointer;
+ *from = (const char*)<tng_param_pointer;
align = sizeof(const void *);
if(*len == 0) {
unsigned int index;
struct ltt_trace_info *trace = thread_trace_info;
struct ltt_buf *ltt_buf;
- void *buffer = NULL;
+ char *buffer = NULL;
size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
size_t *to_base = &real_to_base;
size_t real_to = 0;
size_t reserve_size;
size_t slot_size;
size_t align;
- const void *real_from;
- const void **from = &real_from;
+ const char *real_from;
+ const char **from = &real_from;
uint64_t tsc;
size_t before_hdr_pad, after_hdr_pad, header_size;
/* Assume that the padding for alignment starts at a
* sizeof(void *) address. */
- *from = lttng_param_string;
+ *from = (const char*)lttng_param_string;
lttng_write_string_user_generic_string_pointer_string(buffer, to_base, to, from, len, lttng_param_string);
- *from = <tng_param_pointer;
+ *from = (const char*)<tng_param_pointer;
align = sizeof(const void *);
if(*len == 0) {
reserve_size, before_hdr_pad, tsc);
*to_base += before_hdr_pad + after_hdr_pad + header_size;
- *from = lttng_param_string;
+ *from = (const char*)lttng_param_string;
lttng_write_string_user_generic_string_pointer_string(buffer, to_base, to, from, len, lttng_param_string);
/* Flush pending memcpy */
*len = 0;
}
- *from = <tng_param_pointer;
+ *from = (const char*)<tng_param_pointer;
align = sizeof(const void *);
if(*len == 0) {
/* Event slow_printf structures */
static inline void lttng_write_string_user_generic_slow_printf_string(
- void *buffer,
+ char *buffer,
size_t *to_base,
size_t *to,
- const void **from,
+ const char **from,
size_t *len,
const char * obj)
{
/* Event slow_printf logging function */
+static inline int trace_user_generic_slow_printf_param_buffer(
+ char *buffer,
+ size_t reserve_size);
+
#ifndef LTT_TRACE_FAST
static inline int trace_user_generic_slow_printf_param_buffer(
- void *buffer,
+ char *buffer,
size_t reserve_size)
#ifndef LTT_TRACE
{
unsigned int index;
struct ltt_trace_info *trace = thread_trace_info;
struct ltt_buf *ltt_buf;
- void *buffer = NULL;
+ char *buffer = NULL;
size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
size_t *to_base = &real_to_base;
size_t real_to = 0;
size_t *len = &real_len;
size_t reserve_size;
size_t slot_size;
- const void *real_from;
- const void **from = &real_from;
+ const char *real_from;
+ const char **from = &real_from;
uint64_t tsc;
size_t before_hdr_pad, after_hdr_pad, header_size;
/* Assume that the padding for alignment starts at a
* sizeof(void *) address. */
- *from = lttng_param_string;
+ *from = (const char*)lttng_param_string;
lttng_write_string_user_generic_slow_printf_string(buffer, to_base, to, from, len, lttng_param_string);
reserve_size = *to_base + *to + *len;
reserve_size, before_hdr_pad, tsc);
*to_base += before_hdr_pad + after_hdr_pad + header_size;
- *from = lttng_param_string;
+ *from = (const char*)lttng_param_string;
lttng_write_string_user_generic_slow_printf_string(buffer, to_base, to, from, len, lttng_param_string);
/* Flush pending memcpy */
/* Event function_entry structures */
/* Event function_entry logging function */
-#ifndef LTT_TRACE_FAST
static inline __attribute__((no_instrument_function)) int trace_user_generic_function_entry(
+ const void * lttng_param_this_fn,
+ const void * lttng_param_call_site);
+
+#ifndef LTT_TRACE_FAST
+static inline int trace_user_generic_function_entry(
const void * lttng_param_this_fn,
const void * lttng_param_call_site)
#ifndef LTT_TRACE
#else
{
int ret = 0;
- void *buffer = NULL;
+ char *buffer = NULL;
size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
size_t *to_base = &real_to_base;
size_t real_to = 0;
size_t reserve_size;
size_t slot_size;
size_t align;
- const void *real_from;
- const void **from = &real_from;
+ const char *real_from;
+ const char **from = &real_from;
/* For each field, calculate the field size. */
/* size = *to_base + *to + *len */
/* Assume that the padding for alignment starts at a
* sizeof(void *) address. */
- *from = <tng_param_this_fn;
+ *from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
if(*len == 0) {
*len += sizeof(const void *);
- *from = <tng_param_call_site;
+ *from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
if(*len == 0) {
*to_base = *to = *len = 0;
- *from = <tng_param_this_fn;
+ *from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
if(*len == 0) {
*len = 0;
}
- *from = <tng_param_call_site;
+ *from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
if(*len == 0) {
unsigned int index;
struct ltt_trace_info *trace = thread_trace_info;
struct ltt_buf *ltt_buf;
- void *buffer = NULL;
+ char *buffer = NULL;
size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
size_t *to_base = &real_to_base;
size_t real_to = 0;
size_t reserve_size;
size_t slot_size;
size_t align;
- const void *real_from;
- const void **from = &real_from;
+ const char *real_from;
+ const char **from = &real_from;
uint64_t tsc;
size_t before_hdr_pad, after_hdr_pad, header_size;
/* Assume that the padding for alignment starts at a
* sizeof(void *) address. */
- *from = <tng_param_this_fn;
+ *from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
if(*len == 0) {
*len += sizeof(const void *);
- *from = <tng_param_call_site;
+ *from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
if(*len == 0) {
reserve_size, before_hdr_pad, tsc);
*to_base += before_hdr_pad + after_hdr_pad + header_size;
- *from = <tng_param_this_fn;
+ *from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
if(*len == 0) {
*len = 0;
}
- *from = <tng_param_call_site;
+ *from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
if(*len == 0) {
/* Event function_exit structures */
/* Event function_exit logging function */
-#ifndef LTT_TRACE_FAST
static inline __attribute__((no_instrument_function)) int trace_user_generic_function_exit(
+ const void * lttng_param_this_fn,
+ const void * lttng_param_call_site);
+
+#ifndef LTT_TRACE_FAST
+static inline int trace_user_generic_function_exit(
const void * lttng_param_this_fn,
const void * lttng_param_call_site)
#ifndef LTT_TRACE
#else
{
int ret = 0;
- void *buffer = NULL;
+ char *buffer = NULL;
size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
size_t *to_base = &real_to_base;
size_t real_to = 0;
size_t reserve_size;
size_t slot_size;
size_t align;
- const void *real_from;
- const void **from = &real_from;
+ const char *real_from;
+ const char **from = &real_from;
/* For each field, calculate the field size. */
/* size = *to_base + *to + *len */
/* Assume that the padding for alignment starts at a
* sizeof(void *) address. */
- *from = <tng_param_this_fn;
+ *from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
if(*len == 0) {
*len += sizeof(const void *);
- *from = <tng_param_call_site;
+ *from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
if(*len == 0) {
*to_base = *to = *len = 0;
- *from = <tng_param_this_fn;
+ *from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
if(*len == 0) {
*len = 0;
}
- *from = <tng_param_call_site;
+ *from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
if(*len == 0) {
unsigned int index;
struct ltt_trace_info *trace = thread_trace_info;
struct ltt_buf *ltt_buf;
- void *buffer = NULL;
+ char *buffer = NULL;
size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
size_t *to_base = &real_to_base;
size_t real_to = 0;
size_t reserve_size;
size_t slot_size;
size_t align;
- const void *real_from;
- const void **from = &real_from;
+ const char *real_from;
+ const char **from = &real_from;
uint64_t tsc;
size_t before_hdr_pad, after_hdr_pad, header_size;
/* Assume that the padding for alignment starts at a
* sizeof(void *) address. */
- *from = <tng_param_this_fn;
+ *from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
if(*len == 0) {
*len += sizeof(const void *);
- *from = <tng_param_call_site;
+ *from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
if(*len == 0) {
reserve_size, before_hdr_pad, tsc);
*to_base += before_hdr_pad + after_hdr_pad + header_size;
- *from = <tng_param_this_fn;
+ *from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
if(*len == 0) {
*len = 0;
}
- *from = <tng_param_call_site;
+ *from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
if(*len == 0) {
/* Event thread_brand structures */
static inline void lttng_write_string_user_generic_thread_brand_name(
- void *buffer,
+ char *buffer,
size_t *to_base,
size_t *to,
- const void **from,
+ const char **from,
size_t *len,
const char * obj)
{
/* Event thread_brand logging function */
+static inline int trace_user_generic_thread_brand(
+ const char * lttng_param_name);
+
#ifndef LTT_TRACE_FAST
static inline int trace_user_generic_thread_brand(
const char * lttng_param_name)
#else
{
int ret = 0;
- void *buffer = NULL;
+ char *buffer = NULL;
size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
size_t *to_base = &real_to_base;
size_t real_to = 0;
size_t *len = &real_len;
size_t reserve_size;
size_t slot_size;
- const void *real_from;
- const void **from = &real_from;
+ const char *real_from;
+ const char **from = &real_from;
/* For each field, calculate the field size. */
/* size = *to_base + *to + *len */
/* Assume that the padding for alignment starts at a
* sizeof(void *) address. */
- *from = lttng_param_name;
+ *from = (const char*)lttng_param_name;
lttng_write_string_user_generic_thread_brand_name(buffer, to_base, to, from, len, lttng_param_name);
reserve_size = *to_base + *to + *len;
*to_base = *to = *len = 0;
- *from = lttng_param_name;
+ *from = (const char*)lttng_param_name;
lttng_write_string_user_generic_thread_brand_name(buffer, to_base, to, from, len, lttng_param_name);
/* Flush pending memcpy */
unsigned int index;
struct ltt_trace_info *trace = thread_trace_info;
struct ltt_buf *ltt_buf;
- void *buffer = NULL;
+ char *buffer = NULL;
size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
size_t *to_base = &real_to_base;
size_t real_to = 0;
size_t *len = &real_len;
size_t reserve_size;
size_t slot_size;
- const void *real_from;
- const void **from = &real_from;
+ const char *real_from;
+ const char **from = &real_from;
uint64_t tsc;
size_t before_hdr_pad, after_hdr_pad, header_size;
/* Assume that the padding for alignment starts at a
* sizeof(void *) address. */
- *from = lttng_param_name;
+ *from = (const char*)lttng_param_name;
lttng_write_string_user_generic_thread_brand_name(buffer, to_base, to, from, len, lttng_param_name);
reserve_size = *to_base + *to + *len;
reserve_size, before_hdr_pad, tsc);
*to_base += before_hdr_pad + after_hdr_pad + header_size;
- *from = lttng_param_name;
+ *from = (const char*)lttng_param_name;
lttng_write_string_user_generic_thread_brand_name(buffer, to_base, to, from, len, lttng_param_name);
/* Flush pending memcpy */
#endif //LTT_TRACE
#endif //LTT_TRACE_FAST
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
+
#endif //_LTT_FACILITY_USER_GENERIC_H_