summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
90440c0)
.name = LTT_FACILITY_NAME,
.num_events = LTT_FACILITY_NUM_EVENTS,
#ifndef LTT_PACK
.name = LTT_FACILITY_NAME,
.num_events = LTT_FACILITY_NUM_EVENTS,
#ifndef LTT_PACK
- .alignment = sizeof(void*),
+ .alignment = LTT_FACILITY_ALIGNMENT?sizeof(void*):0,
#else
.alignment = 0,
#endif //LTT_PACK
#else
.alignment = 0,
#endif //LTT_PACK
err = ltt_register_generic(<T_FACILITY_SYMBOL, &facility);
LTT_FACILITY_CHECKSUM_SYMBOL = LTT_FACILITY_SYMBOL;
err = ltt_register_generic(<T_FACILITY_SYMBOL, &facility);
LTT_FACILITY_CHECKSUM_SYMBOL = LTT_FACILITY_SYMBOL;
#ifdef LTT_SHOW_DEBUG
perror("Error in ltt_register_generic");
#endif //LTT_SHOW_DEBUG
#ifdef LTT_SHOW_DEBUG
perror("Error in ltt_register_generic");
#endif //LTT_SHOW_DEBUG
#define LTT_FACILITY_NAME "user_generic"
#define LTT_FACILITY_NUM_EVENTS facility_user_generic_num_events
#define LTT_FACILITY_NAME "user_generic"
#define LTT_FACILITY_NUM_EVENTS facility_user_generic_num_events
+#define LTT_FACILITY_ALIGNMENT 1
+
#endif //_LTT_FACILITY_LOADER_USER_GENERIC_H_
#endif //_LTT_FACILITY_LOADER_USER_GENERIC_H_
size_t align;
/* Flush pending memcpy */
size_t align;
/* Flush pending memcpy */
- if(*len != 0) {
- if(buffer != NULL)
+ if (*len != 0) {
+ if (buffer != NULL)
memcpy(buffer+*to_base+*to, *from, *len);
}
*to += *len;
memcpy(buffer+*to_base+*to, *from, *len);
}
*to += *len;
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
/* Contains variable sized fields : must explode the structure */
size = strlen(obj) + 1; /* Include final NULL char. */
/* Contains variable sized fields : must explode the structure */
size = strlen(obj) + 1; /* Include final NULL char. */
memcpy(buffer+*to_base+*to, obj, size);
*to += size;
memcpy(buffer+*to_base+*to, obj, size);
*to += size;
lttng_write_string_user_generic_string_data(buffer, to_base, to, from, len, lttng_param_data);
/* Flush pending memcpy */
lttng_write_string_user_generic_string_data(buffer, to_base, to, from, len, lttng_param_data);
/* Flush pending memcpy */
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
const char *real_from;
const char **from = &real_from;
uint64_t tsc;
const char *real_from;
const char **from = &real_from;
uint64_t tsc;
- size_t before_hdr_pad, after_hdr_pad, header_size;
-
- if(!trace) {
ltt_thread_init();
trace = thread_trace_info;
}
ltt_thread_init();
trace = thread_trace_info;
}
ltt_buf = ltt_get_channel_from_index(trace, index);
slot_size = 0;
buffer = ltt_reserve_slot(trace, ltt_buf,
ltt_buf = ltt_get_channel_from_index(trace, index);
slot_size = 0;
buffer = ltt_reserve_slot(trace, ltt_buf,
- reserve_size, &slot_size, &tsc,
- &before_hdr_pad, &after_hdr_pad, &header_size);
- if(!buffer) goto end; /* buffer full */
+ reserve_size, &slot_size, &tsc);
+ if (!buffer)
+ goto end; /* buffer full */
*to_base = *to = *len = 0;
*to_base = *to = *len = 0;
- ltt_write_event_header(trace, ltt_buf, buffer,
+ buffer = ltt_write_event_header(trace, ltt_buf, buffer,
ltt_facility_user_generic_B1865E44, event_user_generic_string,
ltt_facility_user_generic_B1865E44, event_user_generic_string,
- reserve_size, before_hdr_pad, tsc);
- *to_base += before_hdr_pad + after_hdr_pad + header_size;
-
*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 */
*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 */
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
size_t align;
/* Flush pending memcpy */
size_t align;
/* Flush pending memcpy */
- if(*len != 0) {
- if(buffer != NULL)
+ if (*len != 0) {
+ if (buffer != NULL)
memcpy(buffer+*to_base+*to, *from, *len);
}
*to += *len;
memcpy(buffer+*to_base+*to, *from, *len);
}
*to += *len;
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
/* Contains variable sized fields : must explode the structure */
size = strlen(obj) + 1; /* Include final NULL char. */
/* Contains variable sized fields : must explode the structure */
size = strlen(obj) + 1; /* Include final NULL char. */
memcpy(buffer+*to_base+*to, obj, size);
*to += size;
memcpy(buffer+*to_base+*to, obj, size);
*to += size;
*from = (const char*)<tng_param_pointer;
align = sizeof(const void *);
*from = (const char*)<tng_param_pointer;
align = sizeof(const void *);
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
lttng_write_string_user_generic_string_pointer_string(buffer, to_base, to, from, len, lttng_param_string);
/* Flush pending memcpy */
lttng_write_string_user_generic_string_pointer_string(buffer, to_base, to, from, len, lttng_param_string);
/* Flush pending memcpy */
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
*from = (const char*)<tng_param_pointer;
align = sizeof(const void *);
*from = (const char*)<tng_param_pointer;
align = sizeof(const void *);
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*len += sizeof(const void *);
/* Flush pending memcpy */
*len += sizeof(const void *);
/* Flush pending memcpy */
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
const char *real_from;
const char **from = &real_from;
uint64_t tsc;
const char *real_from;
const char **from = &real_from;
uint64_t tsc;
- size_t before_hdr_pad, after_hdr_pad, header_size;
-
- if(!trace) {
ltt_thread_init();
trace = thread_trace_info;
}
ltt_thread_init();
trace = thread_trace_info;
}
*from = (const char*)<tng_param_pointer;
align = sizeof(const void *);
*from = (const char*)<tng_param_pointer;
align = sizeof(const void *);
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
ltt_buf = ltt_get_channel_from_index(trace, index);
slot_size = 0;
buffer = ltt_reserve_slot(trace, ltt_buf,
ltt_buf = ltt_get_channel_from_index(trace, index);
slot_size = 0;
buffer = ltt_reserve_slot(trace, ltt_buf,
- reserve_size, &slot_size, &tsc,
- &before_hdr_pad, &after_hdr_pad, &header_size);
- if(!buffer) goto end; /* buffer full */
+ reserve_size, &slot_size, &tsc);
+ if (!buffer)
+ goto end; /* buffer full */
*to_base = *to = *len = 0;
*to_base = *to = *len = 0;
- ltt_write_event_header(trace, ltt_buf, buffer,
+ buffer = ltt_write_event_header(trace, ltt_buf, buffer,
ltt_facility_user_generic_B1865E44, event_user_generic_string_pointer,
ltt_facility_user_generic_B1865E44, event_user_generic_string_pointer,
- reserve_size, before_hdr_pad, tsc);
- *to_base += before_hdr_pad + after_hdr_pad + header_size;
-
*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 */
*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 */
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
*from = (const char*)<tng_param_pointer;
align = sizeof(const void *);
*from = (const char*)<tng_param_pointer;
align = sizeof(const void *);
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*len += sizeof(const void *);
/* Flush pending memcpy */
*len += sizeof(const void *);
/* Flush pending memcpy */
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
size_t align;
/* Flush pending memcpy */
size_t align;
/* Flush pending memcpy */
- if(*len != 0) {
- if(buffer != NULL)
+ if (*len != 0) {
+ if (buffer != NULL)
memcpy(buffer+*to_base+*to, *from, *len);
}
*to += *len;
memcpy(buffer+*to_base+*to, *from, *len);
}
*to += *len;
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
/* Contains variable sized fields : must explode the structure */
size = strlen(obj) + 1; /* Include final NULL char. */
/* Contains variable sized fields : must explode the structure */
size = strlen(obj) + 1; /* Include final NULL char. */
memcpy(buffer+*to_base+*to, obj, size);
*to += size;
memcpy(buffer+*to_base+*to, obj, size);
*to += size;
const char *real_from;
const char **from = &real_from;
uint64_t tsc;
const char *real_from;
const char **from = &real_from;
uint64_t tsc;
- size_t before_hdr_pad, after_hdr_pad, header_size;
-
- if(!trace) {
ltt_thread_init();
trace = thread_trace_info;
}
ltt_thread_init();
trace = thread_trace_info;
}
ltt_buf = ltt_get_channel_from_index(trace, index);
slot_size = 0;
buffer = ltt_reserve_slot(trace, ltt_buf,
ltt_buf = ltt_get_channel_from_index(trace, index);
slot_size = 0;
buffer = ltt_reserve_slot(trace, ltt_buf,
- reserve_size, &slot_size, &tsc,
- &before_hdr_pad, &after_hdr_pad, &header_size);
- if(!buffer) goto end; /* buffer full */
+ reserve_size, &slot_size, &tsc);
+ if (!buffer)
+ goto end; /* buffer full */
*to_base = *to = *len = 0;
*to_base = *to = *len = 0;
- ltt_write_event_header(trace, ltt_buf, buffer,
+ buffer = ltt_write_event_header(trace, ltt_buf, buffer,
ltt_facility_user_generic_B1865E44, event_user_generic_slow_printf,
ltt_facility_user_generic_B1865E44, event_user_generic_slow_printf,
- reserve_size, before_hdr_pad, tsc);
- *to_base += before_hdr_pad + after_hdr_pad + header_size;
-
*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 */
*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 */
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
*from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
*from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
*from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
*from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*len += sizeof(const void *);
/* Flush pending memcpy */
*len += sizeof(const void *);
/* Flush pending memcpy */
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
*from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
*from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*len += sizeof(const void *);
/* Flush pending memcpy */
*len += sizeof(const void *);
/* Flush pending memcpy */
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
const char *real_from;
const char **from = &real_from;
uint64_t tsc;
const char *real_from;
const char **from = &real_from;
uint64_t tsc;
- size_t before_hdr_pad, after_hdr_pad, header_size;
-
- if(!trace) {
ltt_thread_init();
trace = thread_trace_info;
}
ltt_thread_init();
trace = thread_trace_info;
}
*from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
*from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
*from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
ltt_buf = ltt_get_channel_from_index(trace, index);
slot_size = 0;
buffer = ltt_reserve_slot(trace, ltt_buf,
ltt_buf = ltt_get_channel_from_index(trace, index);
slot_size = 0;
buffer = ltt_reserve_slot(trace, ltt_buf,
- reserve_size, &slot_size, &tsc,
- &before_hdr_pad, &after_hdr_pad, &header_size);
- if(!buffer) goto end; /* buffer full */
+ reserve_size, &slot_size, &tsc);
+ if (!buffer)
+ goto end; /* buffer full */
*to_base = *to = *len = 0;
*to_base = *to = *len = 0;
- ltt_write_event_header(trace, ltt_buf, buffer,
+ buffer = ltt_write_event_header(trace, ltt_buf, buffer,
ltt_facility_user_generic_B1865E44, event_user_generic_function_entry,
ltt_facility_user_generic_B1865E44, event_user_generic_function_entry,
- reserve_size, before_hdr_pad, tsc);
- *to_base += before_hdr_pad + after_hdr_pad + header_size;
-
*from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
*from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*len += sizeof(const void *);
/* Flush pending memcpy */
*len += sizeof(const void *);
/* Flush pending memcpy */
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
*from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
*from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*len += sizeof(const void *);
/* Flush pending memcpy */
*len += sizeof(const void *);
/* Flush pending memcpy */
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
*from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
*from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
*from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
*from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*len += sizeof(const void *);
/* Flush pending memcpy */
*len += sizeof(const void *);
/* Flush pending memcpy */
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
*from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
*from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*len += sizeof(const void *);
/* Flush pending memcpy */
*len += sizeof(const void *);
/* Flush pending memcpy */
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
const char *real_from;
const char **from = &real_from;
uint64_t tsc;
const char *real_from;
const char **from = &real_from;
uint64_t tsc;
- size_t before_hdr_pad, after_hdr_pad, header_size;
-
- if(!trace) {
ltt_thread_init();
trace = thread_trace_info;
}
ltt_thread_init();
trace = thread_trace_info;
}
*from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
*from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
*from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
ltt_buf = ltt_get_channel_from_index(trace, index);
slot_size = 0;
buffer = ltt_reserve_slot(trace, ltt_buf,
ltt_buf = ltt_get_channel_from_index(trace, index);
slot_size = 0;
buffer = ltt_reserve_slot(trace, ltt_buf,
- reserve_size, &slot_size, &tsc,
- &before_hdr_pad, &after_hdr_pad, &header_size);
- if(!buffer) goto end; /* buffer full */
+ reserve_size, &slot_size, &tsc);
+ if (!buffer)
+ goto end; /* buffer full */
*to_base = *to = *len = 0;
*to_base = *to = *len = 0;
- ltt_write_event_header(trace, ltt_buf, buffer,
+ buffer = ltt_write_event_header(trace, ltt_buf, buffer,
ltt_facility_user_generic_B1865E44, event_user_generic_function_exit,
ltt_facility_user_generic_B1865E44, event_user_generic_function_exit,
- reserve_size, before_hdr_pad, tsc);
- *to_base += before_hdr_pad + after_hdr_pad + header_size;
-
*from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
*from = (const char*)<tng_param_this_fn;
align = sizeof(const void *);
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*len += sizeof(const void *);
/* Flush pending memcpy */
*len += sizeof(const void *);
/* Flush pending memcpy */
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
*from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
*from = (const char*)<tng_param_call_site;
align = sizeof(const void *);
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*len += sizeof(const void *);
/* Flush pending memcpy */
*len += sizeof(const void *);
/* Flush pending memcpy */
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
size_t align;
/* Flush pending memcpy */
size_t align;
/* Flush pending memcpy */
- if(*len != 0) {
- if(buffer != NULL)
+ if (*len != 0) {
+ if (buffer != NULL)
memcpy(buffer+*to_base+*to, *from, *len);
}
*to += *len;
memcpy(buffer+*to_base+*to, *from, *len);
}
*to += *len;
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
*to += ltt_align(*to, align); /* align output */
} else {
*len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
/* Contains variable sized fields : must explode the structure */
size = strlen(obj) + 1; /* Include final NULL char. */
/* Contains variable sized fields : must explode the structure */
size = strlen(obj) + 1; /* Include final NULL char. */
memcpy(buffer+*to_base+*to, obj, size);
*to += size;
memcpy(buffer+*to_base+*to, obj, size);
*to += size;
lttng_write_string_user_generic_thread_brand_name(buffer, to_base, to, from, len, lttng_param_name);
/* Flush pending memcpy */
lttng_write_string_user_generic_thread_brand_name(buffer, to_base, to, from, len, lttng_param_name);
/* Flush pending memcpy */
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
const char *real_from;
const char **from = &real_from;
uint64_t tsc;
const char *real_from;
const char **from = &real_from;
uint64_t tsc;
- size_t before_hdr_pad, after_hdr_pad, header_size;
-
- if(!trace) {
ltt_thread_init();
trace = thread_trace_info;
}
ltt_thread_init();
trace = thread_trace_info;
}
ltt_buf = ltt_get_channel_from_index(trace, index);
slot_size = 0;
buffer = ltt_reserve_slot(trace, ltt_buf,
ltt_buf = ltt_get_channel_from_index(trace, index);
slot_size = 0;
buffer = ltt_reserve_slot(trace, ltt_buf,
- reserve_size, &slot_size, &tsc,
- &before_hdr_pad, &after_hdr_pad, &header_size);
- if(!buffer) goto end; /* buffer full */
+ reserve_size, &slot_size, &tsc);
+ if (!buffer)
+ goto end; /* buffer full */
*to_base = *to = *len = 0;
*to_base = *to = *len = 0;
- ltt_write_event_header(trace, ltt_buf, buffer,
+ buffer = ltt_write_event_header(trace, ltt_buf, buffer,
ltt_facility_user_generic_B1865E44, event_user_generic_thread_brand,
ltt_facility_user_generic_B1865E44, event_user_generic_thread_brand,
- reserve_size, before_hdr_pad, tsc);
- *to_base += before_hdr_pad + after_hdr_pad + header_size;
-
*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 */
*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 */
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
memcpy(buffer+*to_base+*to, *from, *len);
*to += *len;
*len = 0;
#define LTT_TRACER_VERSION_MINOR 8
#ifndef atomic_cmpxchg
#define LTT_TRACER_VERSION_MINOR 8
#ifndef atomic_cmpxchg
-#define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new))
+#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new))
#endif //atomic_cmpxchg
struct ltt_trace_header {
#endif //atomic_cmpxchg
struct ltt_trace_header {
* for every trace).
*/
static inline unsigned int __attribute__((no_instrument_function))
* for every trace).
*/
static inline unsigned int __attribute__((no_instrument_function))
- ltt_get_index_from_facility(ltt_facility_t fID,
+ ltt_get_index_from_facility(uint8_t fID,
uint8_t eID)
{
return GET_CHANNEL_INDEX(process);
uint8_t eID)
{
return GET_CHANNEL_INDEX(process);
static inline unsigned char __attribute__((no_instrument_function))
ltt_get_header_size(struct ltt_trace_info *trace,
void *address,
static inline unsigned char __attribute__((no_instrument_function))
ltt_get_header_size(struct ltt_trace_info *trace,
void *address,
- size_t *before_hdr_pad,
- size_t *after_hdr_pad,
- size_t *header_size)
+ size_t data_size,
+ size_t *before_hdr_pad)
{
unsigned int padding;
unsigned int header;
{
unsigned int padding;
unsigned int header;
header = sizeof(struct ltt_event_header_nohb);
header = sizeof(struct ltt_event_header_nohb);
/* Padding after header, considering header aligned on ltt_align.
* Calculated statically if header size if known. */
/* Padding after header, considering header aligned on ltt_align.
* Calculated statically if header size if known. */
- *after_hdr_pad = ltt_align(header, sizeof(void*));
- padding += *after_hdr_pad;
-
- *header_size = header;
+ after_hdr_pad = ltt_align(header, sizeof(void*));
+ padding += after_hdr_pad;
* @fID : facility ID
* @eID : event ID
* @event_size : size of the event, excluding the event header.
* @fID : facility ID
* @eID : event ID
* @event_size : size of the event, excluding the event header.
- * @offset : offset of the beginning of the header, for alignment.
- * Calculated by ltt_get_event_header_size.
* @tsc : time stamp counter.
*/
* @tsc : time stamp counter.
*/
-static inline void __attribute__((no_instrument_function))
+static inline char *__attribute__((no_instrument_function))
ltt_write_event_header(
struct ltt_trace_info *trace, struct ltt_buf *buf,
ltt_write_event_header(
struct ltt_trace_info *trace, struct ltt_buf *buf,
- void *ptr, ltt_facility_t fID, uint32_t eID, size_t event_size,
- size_t offset, uint64_t tsc)
+ void *ptr, uint8_t fID, uint32_t eID, size_t event_size,
+ uint64_t tsc)
struct ltt_event_header_nohb *nohb;
event_size = min(event_size, 0xFFFFU);
struct ltt_event_header_nohb *nohb;
event_size = min(event_size, 0xFFFFU);
- nohb = (struct ltt_event_header_nohb *)(ptr+offset);
+ nohb = (struct ltt_event_header_nohb *)(ptr);
nohb->timestamp = (uint64_t)tsc;
nohb->facility_id = fID;
nohb->event_id = eID;
nohb->event_size = (uint16_t)event_size;
nohb->timestamp = (uint64_t)tsc;
nohb->facility_id = fID;
nohb->event_id = eID;
nohb->event_size = (uint16_t)event_size;
+ after_hdr_pad = ltt_align(sizeof(*nohb), sizeof(void*));
+ return ptr + sizeof(*nohb) + after_hdr_pad;
struct ltt_buf *ltt_buf,
unsigned int data_size,
size_t *slot_size,
struct ltt_buf *ltt_buf,
unsigned int data_size,
size_t *slot_size,
- uint64_t *tsc,
- size_t *before_hdr_pad,
- size_t *after_hdr_pad,
- size_t *header_size)
{
int offset_begin, offset_end, offset_old;
//int has_switch;
int begin_switch, end_switch_current, end_switch_old;
int reserve_commit_diff = 0;
unsigned int size;
{
int offset_begin, offset_end, offset_old;
//int has_switch;
int begin_switch, end_switch_current, end_switch_old;
int reserve_commit_diff = 0;
unsigned int size;
int consumed_old, consumed_new;
int commit_count, reserve_count;
int ret;
int consumed_old, consumed_new;
int commit_count, reserve_count;
int ret;
begin_switch = 1; /* For offset_begin */
} else {
size = ltt_get_header_size(trace, ltt_buf->start + offset_begin,
begin_switch = 1; /* For offset_begin */
} else {
size = ltt_get_header_size(trace, ltt_buf->start + offset_begin,
- before_hdr_pad, after_hdr_pad, header_size)
+ data_size, &before_hdr_pad)
+ data_size;
if((SUBBUF_OFFSET(offset_begin, ltt_buf)+size)>ltt_buf->subbuf_size) {
+ data_size;
if((SUBBUF_OFFSET(offset_begin, ltt_buf)+size)>ltt_buf->subbuf_size) {
* sem_wait. */
}
size = ltt_get_header_size(trace, ltt_buf->start + offset_begin,
* sem_wait. */
}
size = ltt_get_header_size(trace, ltt_buf->start + offset_begin,
- before_hdr_pad, after_hdr_pad, header_size) + data_size;
+ data_size, &before_hdr_pad) + data_size;
if((SUBBUF_OFFSET(offset_begin,ltt_buf)+size)>ltt_buf->subbuf_size) {
/* Event too big for subbuffers, report error, don't complete
* the sub-buffer switch. */
if((SUBBUF_OFFSET(offset_begin,ltt_buf)+size)>ltt_buf->subbuf_size) {
/* Event too big for subbuffers, report error, don't complete
* the sub-buffer switch. */
//BUG_ON(*slot_size != (data_size + *before_hdr_pad + *after_hdr_pad + *header_size));
//BUG_ON(*slot_size != (offset_end - offset_begin));
//BUG_ON(*slot_size != (data_size + *before_hdr_pad + *after_hdr_pad + *header_size));
//BUG_ON(*slot_size != (offset_end - offset_begin));
- return ltt_buf->start + BUFFER_OFFSET(offset_begin, ltt_buf);
+ return ltt_buf->start + BUFFER_OFFSET(offset_begin, ltt_buf) + before_hdr_pad;
#ifndef LTT_BLOCKING
#define LTT_BLOCKING 0
#endif //LTT_BLOCKING
#ifndef LTT_BLOCKING
#define LTT_BLOCKING 0
#endif //LTT_BLOCKING
typedef unsigned int ltt_facility_t;
struct user_facility_info {
typedef unsigned int ltt_facility_t;
struct user_facility_info {