projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Test: add file based synchronization point for python test app
[lttng-tools.git]
/
tests
/
regression
/
ust
/
getcpu-override
/
lttng-ust-getcpu-override-test.c
diff --git
a/tests/regression/ust/getcpu-override/lttng-ust-getcpu-override-test.c
b/tests/regression/ust/getcpu-override/lttng-ust-getcpu-override-test.c
index a5272e12b020e1ae5b403483c3922a1b5ab728c2..5b4e559524058eee0fd32b5a1737015a3da0d4a3 100644
(file)
--- a/
tests/regression/ust/getcpu-override/lttng-ust-getcpu-override-test.c
+++ b/
tests/regression/ust/getcpu-override/lttng-ust-getcpu-override-test.c
@@
-25,12
+25,14
@@
*/
#include <stdlib.h>
*/
#include <stdlib.h>
-#include <time.h>
+#include <
common/compat/
time.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <lttng/ust-getcpu.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <lttng/ust-getcpu.h>
+static long nprocessors;
+
int plugin_getcpu(void)
{
/* Generate a sequence based on the number of configurated processor
int plugin_getcpu(void)
{
/* Generate a sequence based on the number of configurated processor
@@
-63,7
+65,8
@@
int plugin_getcpu(void)
98, 5, 50, 99, 4, 89, 13, 63, 6, 136, 153, 23, 16, 47, 130, 75,
62 };
int ret;
98, 5, 50, 99, 4, 89, 13, 63, 6, 136, 153, 23, 16, 47, 130, 75,
62 };
int ret;
- ret = seq_seed[i] % sysconf(_SC_NPROCESSORS_CONF);
+
+ ret = seq_seed[i] % nprocessors;
i++;
i = i % 256;
return ret;
i++;
i = i % 256;
return ret;
@@
-73,6
+76,12
@@
void lttng_ust_getcpu_plugin_init(void)
{
int ret;
{
int ret;
+ nprocessors = sysconf(_SC_NPROCESSORS_CONF);
+ if (nprocessors < 0) {
+ perror("Failed to get _SC_NPROCESSORS_CONF");
+ goto error;
+ }
+
ret = lttng_ust_getcpu_override(plugin_getcpu);
if (ret) {
fprintf(stderr, "Error enabling getcpu override: %s\n",
ret = lttng_ust_getcpu_override(plugin_getcpu);
if (ret) {
fprintf(stderr, "Error enabling getcpu override: %s\n",
This page took
0.023267 seconds
and
4
git commands to generate.