projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a README.cygwin for Cygwin specific build/install instructions
[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 6acd7a0d083adba911d171e9c2d69e4fd10ada19..69a73b2f235f8ff5bf5046aa2c5f1680428f6ff9 100644
(file)
--- a/
tests/test_ust_data_trace.c
+++ b/
tests/test_ust_data_trace.c
@@
-35,33
+35,36
@@
/* This path will NEVER be created in this test */
#define PATH1 "/tmp/.test-junk-lttng"
/* This path will NEVER be created in this test */
#define PATH1 "/tmp/.test-junk-lttng"
+#define RANDOM_STRING_LEN 11
+
/* For lttngerr.h */
/* For lttngerr.h */
-int opt_quiet = 1;
-int
opt_verbose = 0
;
+int
lttng_
opt_quiet = 1;
+int
lttng_opt_verbose
;
static const char alphanum[] =
"0123456789"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
static const char alphanum[] =
"0123456789"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
+static char random_string[RANDOM_STRING_LEN];
static struct ltt_ust_session *usess;
static struct lttng_domain dom;
/*
* Return random string of 10 characters.
static struct ltt_ust_session *usess;
static struct lttng_domain dom;
/*
* Return random string of 10 characters.
+ * Not thread-safe.
*/
static char *get_random_string(void)
{
int i;
*/
static char *get_random_string(void)
{
int i;
- char *str = malloc(11);
- for (i = 0; i <
10
; i++) {
-
str
[i] = alphanum[rand() % (sizeof(alphanum) - 1)];
+ for (i = 0; i <
RANDOM_STRING_LEN - 1
; i++) {
+
random_string
[i] = alphanum[rand() % (sizeof(alphanum) - 1)];
}
}
-
str[10
] = '\0';
+
random_string[RANDOM_STRING_LEN - 1
] = '\0';
- return
str
;
+ return
random_string
;
}
static void create_one_ust_session(void)
}
static void create_one_ust_session(void)
@@
-104,7
+107,7
@@
static void create_ust_metadata(void)
assert(metadata->attr.overwrite
== DEFAULT_CHANNEL_OVERWRITE);
assert(metadata->attr.subbuf_size
assert(metadata->attr.overwrite
== DEFAULT_CHANNEL_OVERWRITE);
assert(metadata->attr.subbuf_size
- ==
DEFAULT_METADATA_SUBBUF_SIZE
);
+ ==
default_get_metadata_subbuf_size()
);
assert(metadata->attr.num_subbuf
== DEFAULT_METADATA_SUBBUF_NUM);
assert(metadata->attr.switch_timer_interval
assert(metadata->attr.num_subbuf
== DEFAULT_METADATA_SUBBUF_NUM);
assert(metadata->attr.switch_timer_interval
This page took
0.025582 seconds
and
4
git commands to generate.