Feature #338 ยป 0001-Fix-make-hello.cxx-compile-with-g.patch
include/lttng/ringbuffer-config.h | ||
---|---|---|
unsigned int switch_timer_interval,
|
||
unsigned int read_timer_interval)
|
||
{
|
||
#ifdef __cplusplus
|
||
if (config->alloc == lttng_ust_lib_ring_buffer_config::RING_BUFFER_ALLOC_GLOBAL
|
||
&& config->sync == lttng_ust_lib_ring_buffer_config::RING_BUFFER_SYNC_PER_CPU
|
||
#else
|
||
if (config->alloc == RING_BUFFER_ALLOC_GLOBAL
|
||
&& config->sync == RING_BUFFER_SYNC_PER_CPU
|
||
#endif
|
||
&& switch_timer_interval)
|
||
return -EINVAL;
|
||
return 0;
|
include/lttng/tracepoint-event.h | ||
---|---|---|
* SOFTWARE.
|
||
*/
|
||
#ifdef TRACEPOINT_CREATE_PROBES
|
||
#ifdef __cplusplus
|
||
extern "C" {
|
||
#endif
|
||
#ifdef TRACEPOINT_CREATE_PROBES
|
||
#define __tp_stringify1(x) #x
|
||
#define __tp_stringify(x) __tp_stringify1(x)
|
||
... | ... | |
#undef TRACEPOINT_INCLUDE_FILE
|
||
#undef TRACEPOINT_INCLUDE
|
||
#define TRACEPOINT_CREATE_PROBES
|
||
#endif /* TRACEPOINT_CREATE_PROBES */
|
||
#ifdef __cplusplus
|
||
}
|
||
#endif
|
||
#define TRACEPOINT_CREATE_PROBES
|
||
#endif /* TRACEPOINT_CREATE_PROBES */
|
include/lttng/ust-events.h | ||
---|---|---|
#define __type_integer(_type, _byte_order, _base, _encoding) \
|
||
{ \
|
||
.atype = atype_integer, \
|
||
.u.basic.integer = \
|
||
.u = {.basic = {.integer = \
|
||
{ \
|
||
.size = sizeof(_type) * CHAR_BIT, \
|
||
.alignment = lttng_alignof(_type) * CHAR_BIT, \
|
||
... | ... | |
.reverse_byte_order = _byte_order != BYTE_ORDER, \
|
||
.base = _base, \
|
||
.encoding = lttng_encode_##_encoding, \
|
||
}, \
|
||
}}}, \
|
||
} \
|
||
#define LTTNG_UST_INTEGER_TYPE_PADDING 24
|
||
... | ... | |
#define __type_float(_type) \
|
||
{ \
|
||
.atype = atype_float, \
|
||
.u.basic._float = \
|
||
.u = {.basic = {._float = \
|
||
{ \
|
||
.exp_dig = sizeof(_type) * CHAR_BIT \
|
||
- _float_mant_dig(_type), \
|
||
.mant_dig = _float_mant_dig(_type), \
|
||
.alignment = lttng_alignof(_type) * CHAR_BIT, \
|
||
.reverse_byte_order = BYTE_ORDER != FLOAT_WORD_ORDER, \
|
||
}, \
|
||
}}}, \
|
||
} \
|
||
#define LTTNG_UST_FLOAT_TYPE_PADDING 24
|
include/lttng/ust-tracepoint-event.h | ||
---|---|---|
.type = \
|
||
{ \
|
||
.atype = atype_array, \
|
||
.u.array = \
|
||
.u = {.array = \
|
||
{ \
|
||
.length = _length, \
|
||
.elem_type = __type_integer(_type, BYTE_ORDER, 10, _encoding), \
|
||
.length = _length, \
|
||
}, \
|
||
}, \
|
||
}}, \
|
||
.nowrite = _nowrite, \
|
||
},
|
||
... | ... | |
.type = \
|
||
{ \
|
||
.atype = atype_sequence, \
|
||
.u.sequence = \
|
||
.u = {.sequence = \
|
||
{ \
|
||
.length_type = __type_integer(_length_type, BYTE_ORDER, 10, none), \
|
||
.elem_type = __type_integer(_type, BYTE_ORDER, 10, _encoding), \
|
||
}, \
|
||
}}, \
|
||
}, \
|
||
.nowrite = _nowrite, \
|
||
},
|
||
... | ... | |
.type = \
|
||
{ \
|
||
.atype = atype_string, \
|
||
.u.basic.string.encoding = lttng_encode_UTF8, \
|
||
.u = {.basic = {.string = {.encoding = lttng_encode_UTF8}}}, \
|
||
}, \
|
||
.nowrite = _nowrite, \
|
||
},
|
||
... | ... | |
static \
|
||
void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)) \
|
||
{ \
|
||
struct lttng_event *__event = __tp_data; \
|
||
struct lttng_event *__event = (struct lttng_event*) __tp_data; \
|
||
struct lttng_channel *__chan = __event->chan; \
|
||
struct lttng_ust_lib_ring_buffer_ctx __ctx; \
|
||
size_t __event_len, __event_align; \
|
||
... | ... | |
__ref_model_emf_uri___##_provider##___##_name \
|
||
__attribute__((weakref ("_model_emf_uri___" #_provider "___" #_name)));\
|
||
const struct lttng_event_desc __event_desc___##_provider##_##_name = { \
|
||
.fields = __event_fields___##_provider##___##_template, \
|
||
.name = #_provider ":" #_name, \
|
||
.probe_callback = (void (*)(void)) &__event_probe__##_provider##___##_template,\
|
||
.ctx = NULL, \
|
||
.fields = __event_fields___##_provider##___##_template, \
|
||
.nr_fields = _TP_ARRAY_SIZE(__event_fields___##_provider##___##_template), \
|
||
.loglevel = &__ref_loglevel___##_provider##___##_name, \
|
||
.signature = __tp_event_signature___##_provider##___##_template, \
|
||
.u.ext.model_emf_uri = &__ref_model_emf_uri___##_provider##___##_name, \
|
||
.u = {.ext = {.model_emf_uri = &__ref_model_emf_uri___##_provider##___##_name}},\
|
||
};
|
||
#include TRACEPOINT_INCLUDE
|
tests/hello.cxx/Makefile.am | ||
---|---|---|
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -Wsystem-headers
|
||
noinst_PROGRAMS = hello
|
||
hello_SOURCES = hello.cpp tp.c ust_tests_hello.h
|
||
hello_SOURCES = hello.cpp tp.cpp ust_tests_hello.h
|
||
hello_LDADD = $(top_builddir)/liblttng-ust/liblttng-ust.la
|
||
if LTTNG_UST_BUILD_WITH_LIBDL
|
tests/hello.cxx/tp.c | ||
---|---|---|
/*
|
||
* tp.c
|
||
*
|
||
* Copyright (c) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
||
*
|
||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
* of this software and associated documentation files (the "Software"), to deal
|
||
* in the Software without restriction, including without limitation the rights
|
||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
* copies of the Software, and to permit persons to whom the Software is
|
||
* furnished to do so, subject to the following conditions:
|
||
*
|
||
* The above copyright notice and this permission notice shall be included in
|
||
* all copies or substantial portions of the Software.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||
* SOFTWARE.
|
||
*/
|
||
#define TRACEPOINT_CREATE_PROBES
|
||
#include "ust_tests_hello.h"
|
tests/hello.cxx/tp.cpp | ||
---|---|---|
/*
|
||
* tp.cpp
|
||
*
|
||
* Copyright (c) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
||
*
|
||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
* of this software and associated documentation files (the "Software"), to deal
|
||
* in the Software without restriction, including without limitation the rights
|
||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
* copies of the Software, and to permit persons to whom the Software is
|
||
* furnished to do so, subject to the following conditions:
|
||
*
|
||
* The above copyright notice and this permission notice shall be included in
|
||
* all copies or substantial portions of the Software.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||
* SOFTWARE.
|
||
*/
|
||
#define TRACEPOINT_CREATE_PROBES
|
||
#include "ust_tests_hello.h"
|