projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix: string constants (-Wwrite-strings)
[lttng-ust.git]
/
tests
/
compile
/
test-app-ctx
/
hello.c
diff --git
a/tests/compile/test-app-ctx/hello.c
b/tests/compile/test-app-ctx/hello.c
index 3d026095039091c6610e00557303c3ee3c9c78b2..da347714d5d8fc68906bc38ebcc75ca1406bf9e2 100644
(file)
--- a/
tests/compile/test-app-ctx/hello.c
+++ b/
tests/compile/test-app-ctx/hello.c
@@
-28,67
+28,68
@@
struct mmsghdr;
#define TRACEPOINT_DEFINE
#include "ust_tests_hello.h"
#define TRACEPOINT_DEFINE
#include "ust_tests_hello.h"
-/* Internal header. */
#include <lttng/ust-events.h>
#include <lttng/ust-events.h>
-#include <lttng/ringbuffer-config.h>
+#include <lttng/ringbuffer-context.h>
+/* Internal header. */
#include <ust-context-provider.h>
static __thread unsigned int test_count;
#include <ust-context-provider.h>
static __thread unsigned int test_count;
+static
void test_inc_count(void)
{
test_count++;
}
static
void test_inc_count(void)
{
test_count++;
}
static
-size_t test_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t test_get_size(struct lttng_
ust_
ctx_field *field, size_t offset)
{
int sel = test_count % _NR_LTTNG_UST_DYNAMIC_TYPES;
size_t size = 0;
{
int sel = test_count % _NR_LTTNG_UST_DYNAMIC_TYPES;
size_t size = 0;
- size += l
ib_ring_buffer_align(offset, lttng
_alignof(char));
+ size += l
ttng_ust_lib_ring_buffer_align(offset, lttng_ust_rb
_alignof(char));
size += sizeof(char); /* tag */
switch (sel) {
case LTTNG_UST_DYNAMIC_TYPE_NONE:
break;
case LTTNG_UST_DYNAMIC_TYPE_S8:
size += sizeof(char); /* tag */
switch (sel) {
case LTTNG_UST_DYNAMIC_TYPE_NONE:
break;
case LTTNG_UST_DYNAMIC_TYPE_S8:
- size += l
ib_ring_buffer_align(offset, lttng
_alignof(int8_t));
+ size += l
ttng_ust_lib_ring_buffer_align(offset, lttng_ust_rb
_alignof(int8_t));
size += sizeof(int8_t); /* variant */
break;
case LTTNG_UST_DYNAMIC_TYPE_S16:
size += sizeof(int8_t); /* variant */
break;
case LTTNG_UST_DYNAMIC_TYPE_S16:
- size += l
ib_ring_buffer_align(offset, lttng
_alignof(int16_t));
+ size += l
ttng_ust_lib_ring_buffer_align(offset, lttng_ust_rb
_alignof(int16_t));
size += sizeof(int16_t); /* variant */
break;
case LTTNG_UST_DYNAMIC_TYPE_S32:
size += sizeof(int16_t); /* variant */
break;
case LTTNG_UST_DYNAMIC_TYPE_S32:
- size += l
ib_ring_buffer_align(offset, lttng
_alignof(int32_t));
+ size += l
ttng_ust_lib_ring_buffer_align(offset, lttng_ust_rb
_alignof(int32_t));
size += sizeof(int32_t); /* variant */
break;
case LTTNG_UST_DYNAMIC_TYPE_S64:
size += sizeof(int32_t); /* variant */
break;
case LTTNG_UST_DYNAMIC_TYPE_S64:
- size += l
ib_ring_buffer_align(offset, lttng
_alignof(int64_t));
+ size += l
ttng_ust_lib_ring_buffer_align(offset, lttng_ust_rb
_alignof(int64_t));
size += sizeof(int64_t); /* variant */
break;
case LTTNG_UST_DYNAMIC_TYPE_U8:
size += sizeof(int64_t); /* variant */
break;
case LTTNG_UST_DYNAMIC_TYPE_U8:
- size += l
ib_ring_buffer_align(offset, lttng
_alignof(uint8_t));
+ size += l
ttng_ust_lib_ring_buffer_align(offset, lttng_ust_rb
_alignof(uint8_t));
size += sizeof(uint8_t); /* variant */
break;
case LTTNG_UST_DYNAMIC_TYPE_U16:
size += sizeof(uint8_t); /* variant */
break;
case LTTNG_UST_DYNAMIC_TYPE_U16:
- size += l
ib_ring_buffer_align(offset, lttng
_alignof(uint16_t));
+ size += l
ttng_ust_lib_ring_buffer_align(offset, lttng_ust_rb
_alignof(uint16_t));
size += sizeof(uint16_t); /* variant */
break;
case LTTNG_UST_DYNAMIC_TYPE_U32:
size += sizeof(uint16_t); /* variant */
break;
case LTTNG_UST_DYNAMIC_TYPE_U32:
- size += l
ib_ring_buffer_align(offset, lttng
_alignof(uint32_t));
+ size += l
ttng_ust_lib_ring_buffer_align(offset, lttng_ust_rb
_alignof(uint32_t));
size += sizeof(uint32_t); /* variant */
break;
case LTTNG_UST_DYNAMIC_TYPE_U64:
size += sizeof(uint32_t); /* variant */
break;
case LTTNG_UST_DYNAMIC_TYPE_U64:
- size += l
ib_ring_buffer_align(offset, lttng
_alignof(uint64_t));
+ size += l
ttng_ust_lib_ring_buffer_align(offset, lttng_ust_rb
_alignof(uint64_t));
size += sizeof(uint64_t); /* variant */
break;
case LTTNG_UST_DYNAMIC_TYPE_FLOAT:
size += sizeof(uint64_t); /* variant */
break;
case LTTNG_UST_DYNAMIC_TYPE_FLOAT:
- size += l
ib_ring_buffer_align(offset, lttng
_alignof(float));
+ size += l
ttng_ust_lib_ring_buffer_align(offset, lttng_ust_rb
_alignof(float));
size += sizeof(float); /* variant */
break;
case LTTNG_UST_DYNAMIC_TYPE_DOUBLE:
size += sizeof(float); /* variant */
break;
case LTTNG_UST_DYNAMIC_TYPE_DOUBLE:
- size += l
ib_ring_buffer_align(offset, lttng
_alignof(double));
+ size += l
ttng_ust_lib_ring_buffer_align(offset, lttng_ust_rb
_alignof(double));
size += sizeof(double); /* variant */
break;
case LTTNG_UST_DYNAMIC_TYPE_STRING:
size += sizeof(double); /* variant */
break;
case LTTNG_UST_DYNAMIC_TYPE_STRING:
@@
-102,15
+103,14
@@
size_t test_get_size(struct lttng_ctx_field *field, size_t offset)
}
static
}
static
-void test_record(struct lttng_ctx_field *field,
+void test_record(struct lttng_
ust_
ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
- struct lttng_
channel *chan
)
+ struct lttng_
ust_channel_buffer *lttng_chan_buf
)
{
int sel = test_count % _NR_LTTNG_UST_DYNAMIC_TYPES;
char sel_char = (char) sel;
{
int sel = test_count % _NR_LTTNG_UST_DYNAMIC_TYPES;
char sel_char = (char) sel;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(char));
- chan->ops->event_write(ctx, &sel_char, sizeof(sel_char));
+ lttng_chan_buf->ops->event_write(ctx, &sel_char, sizeof(sel_char), lttng_ust_rb_alignof(char));
switch (sel) {
case LTTNG_UST_DYNAMIC_TYPE_NONE:
break;
switch (sel) {
case LTTNG_UST_DYNAMIC_TYPE_NONE:
break;
@@
-118,86
+118,76
@@
void test_record(struct lttng_ctx_field *field,
{
int8_t v = -8;
{
int8_t v = -8;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(v));
- chan->ops->event_write(ctx, &v, sizeof(v));
+ lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v), lttng_ust_rb_alignof(v));
break;
}
case LTTNG_UST_DYNAMIC_TYPE_S16:
{
int16_t v = -16;
break;
}
case LTTNG_UST_DYNAMIC_TYPE_S16:
{
int16_t v = -16;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(v));
- chan->ops->event_write(ctx, &v, sizeof(v));
+ lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v), lttng_ust_rb_alignof(v));
break;
}
case LTTNG_UST_DYNAMIC_TYPE_S32:
{
int32_t v = -32;
break;
}
case LTTNG_UST_DYNAMIC_TYPE_S32:
{
int32_t v = -32;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(v));
- chan->ops->event_write(ctx, &v, sizeof(v));
+ lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v), lttng_ust_rb_alignof(v));
break;
}
case LTTNG_UST_DYNAMIC_TYPE_S64:
{
int64_t v = -64;
break;
}
case LTTNG_UST_DYNAMIC_TYPE_S64:
{
int64_t v = -64;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(v));
- chan->ops->event_write(ctx, &v, sizeof(v));
+ lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v), lttng_ust_rb_alignof(v));
break;
}
case LTTNG_UST_DYNAMIC_TYPE_U8:
{
uint8_t v = 8;
break;
}
case LTTNG_UST_DYNAMIC_TYPE_U8:
{
uint8_t v = 8;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(v));
- chan->ops->event_write(ctx, &v, sizeof(v));
+ lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v), lttng_ust_rb_alignof(v));
break;
}
case LTTNG_UST_DYNAMIC_TYPE_U16:
{
uint16_t v = 16;
break;
}
case LTTNG_UST_DYNAMIC_TYPE_U16:
{
uint16_t v = 16;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(v));
- chan->ops->event_write(ctx, &v, sizeof(v));
+ lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v), lttng_ust_rb_alignof(v));
break;
}
case LTTNG_UST_DYNAMIC_TYPE_U32:
{
uint32_t v = 32;
break;
}
case LTTNG_UST_DYNAMIC_TYPE_U32:
{
uint32_t v = 32;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(v));
- chan->ops->event_write(ctx, &v, sizeof(v));
+ lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v), lttng_ust_rb_alignof(v));
break;
}
case LTTNG_UST_DYNAMIC_TYPE_U64:
{
uint64_t v = 64;
break;
}
case LTTNG_UST_DYNAMIC_TYPE_U64:
{
uint64_t v = 64;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(v));
- chan->ops->event_write(ctx, &v, sizeof(v));
+ lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v), lttng_ust_rb_alignof(v));
break;
}
case LTTNG_UST_DYNAMIC_TYPE_FLOAT:
{
float f = 22322.0;
break;
}
case LTTNG_UST_DYNAMIC_TYPE_FLOAT:
{
float f = 22322.0;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(f));
- chan->ops->event_write(ctx, &f, sizeof(f));
+ lttng_chan_buf->ops->event_write(ctx, &f, sizeof(f), lttng_ust_rb_alignof(f));
break;
}
case LTTNG_UST_DYNAMIC_TYPE_DOUBLE:
{
double d = 2.0;
break;
}
case LTTNG_UST_DYNAMIC_TYPE_DOUBLE:
{
double d = 2.0;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(d));
- chan->ops->event_write(ctx, &d, sizeof(d));
+ lttng_chan_buf->ops->event_write(ctx, &d, sizeof(d), lttng_ust_rb_alignof(d));
break;
}
case LTTNG_UST_DYNAMIC_TYPE_STRING:
{
const char *str = "teststr";
break;
}
case LTTNG_UST_DYNAMIC_TYPE_STRING:
{
const char *str = "teststr";
-
chan->ops->event_write(ctx, str, strlen(str) +
1);
+
lttng_chan_buf->ops->event_write(ctx, str, strlen(str) + 1,
1);
break;
}
default:
break;
}
default:
@@
-206,8
+196,8
@@
void test_record(struct lttng_ctx_field *field,
}
static
}
static
-void test_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void test_get_value(struct lttng_
ust_
ctx_field *field,
+ struct lttng_
ust_
ctx_value *value)
{
int sel = test_count % _NR_LTTNG_UST_DYNAMIC_TYPES;
{
int sel = test_count % _NR_LTTNG_UST_DYNAMIC_TYPES;
@@
-253,19
+243,23
@@
void test_get_value(struct lttng_ctx_field *field,
}
}
}
}
+static char myprovider_name[] = "$app.myprovider";
struct lttng_ust_context_provider myprovider = {
struct lttng_ust_context_provider myprovider = {
- .name = "$app.myprovider",
+ .struct_size = sizeof(struct lttng_ust_context_provider),
+ .name = myprovider_name,
.get_size = test_get_size,
.record = test_record,
.get_value = test_get_value,
};
.get_size = test_get_size,
.record = test_record,
.get_value = test_get_value,
};
+static
void inthandler(int sig)
{
printf("in SIGUSR1 handler\n");
tracepoint(ust_tests_hello, tptest_sighandler);
}
void inthandler(int sig)
{
printf("in SIGUSR1 handler\n");
tracepoint(ust_tests_hello, tptest_sighandler);
}
+static
int init_int_handler(void)
{
int result;
int init_int_handler(void)
{
int result;
@@
-293,8
+287,6
@@
int init_int_handler(void)
return 0;
}
return 0;
}
-void test_inc_count(void);
-
int main(int argc, char **argv)
{
int i, netint;
int main(int argc, char **argv)
{
int i, netint;
This page took
0.026939 seconds
and
4
git commands to generate.