projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Initialize all stack variables to zero, fix uninitialized loglevel variables
[lttng-tools.git]
/
tests
/
test_ust_data_trace.c
diff --git
a/tests/test_ust_data_trace.c
b/tests/test_ust_data_trace.c
index e4d42b40ab3b148a78a66d9352436979fbfd870f..6acd7a0d083adba911d171e9c2d69e4fd10ada19 100644
(file)
--- a/
tests/test_ust_data_trace.c
+++ b/
tests/test_ust_data_trace.c
@@
-27,7
+27,7
@@
#include <lttng/lttng.h>
#include <bin/lttng-sessiond/lttng-ust-abi.h>
#include <lttng/lttng.h>
#include <bin/lttng-sessiond/lttng-ust-abi.h>
-#include <common/
lttng-share
.h>
+#include <common/
defaults
.h>
#include <bin/lttng-sessiond/trace-ust.h>
#include "utils.h"
#include <bin/lttng-sessiond/trace-ust.h>
#include "utils.h"
@@
-122,6
+122,8
@@
static void create_ust_channel(void)
struct ltt_ust_channel *uchan;
struct lttng_channel attr;
struct ltt_ust_channel *uchan;
struct lttng_channel attr;
+ memset(&attr, 0, sizeof(attr));
+
strncpy(attr.name, "channel0", 8);
printf("Creating UST channel: ");
strncpy(attr.name, "channel0", 8);
printf("Creating UST channel: ");
@@
-147,8
+149,10
@@
static void create_ust_event(void)
struct ltt_ust_event *event;
struct lttng_event ev;
struct ltt_ust_event *event;
struct lttng_event ev;
+ memset(&ev, 0, sizeof(ev));
strncpy(ev.name, get_random_string(), LTTNG_SYMBOL_NAME_LEN);
ev.type = LTTNG_EVENT_TRACEPOINT;
strncpy(ev.name, get_random_string(), LTTNG_SYMBOL_NAME_LEN);
ev.type = LTTNG_EVENT_TRACEPOINT;
+ ev.loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL;
printf("Creating UST event: ");
event = trace_ust_create_event(&ev);
printf("Creating UST event: ");
event = trace_ust_create_event(&ev);
@@
-168,16
+172,18
@@
static void create_ust_event(void)
static void create_ust_context(void)
{
static void create_ust_context(void)
{
- struct lttng_event_context ctx;
+ struct lttng_event_context
e
ctx;
struct ltt_ust_context *uctx;
struct ltt_ust_context *uctx;
+ ectx.ctx = LTTNG_EVENT_CONTEXT_VTID;
+
printf("Creating UST context: ");
printf("Creating UST context: ");
- uctx = trace_ust_create_context(&ctx);
+ uctx = trace_ust_create_context(&
e
ctx);
assert(uctx != NULL);
PRINT_OK();
printf("Validating UST context: ");
assert(uctx != NULL);
PRINT_OK();
printf("Validating UST context: ");
- assert((int)
ctx.ctx == (int)uctx->ctx.ctx
);
+ assert((int)
uctx->ctx.ctx == LTTNG_UST_CONTEXT_VTID
);
PRINT_OK();
}
PRINT_OK();
}
This page took
0.024132 seconds
and
4
git commands to generate.