projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tests for the session rotation feature
[lttng-tools.git]
/
tests
/
utils
/
testapp
/
gen-ust-nevents
/
gen-ust-nevents.c
diff --git
a/tests/utils/testapp/gen-ust-nevents/gen-ust-nevents.c
b/tests/utils/testapp/gen-ust-nevents/gen-ust-nevents.c
index c7a5e5fb7081c8270ae80abeb6796fc337f9b91e..17fd8626ca5e03b14852a5c1466313aa5fc5924b 100644
(file)
--- a/
tests/utils/testapp/gen-ust-nevents/gen-ust-nevents.c
+++ b/
tests/utils/testapp/gen-ust-nevents/gen-ust-nevents.c
@@
-15,6
+15,7
@@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#define _LGPL_SOURCE
#include <arpa/inet.h>
#include <stdarg.h>
#include <stdio.h>
#include <arpa/inet.h>
#include <stdarg.h>
#include <stdio.h>
@@
-24,13
+25,15
@@
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
+#include "utils.h"
+#include "signal-helper.h"
#define TRACEPOINT_DEFINE
#include "tp.h"
int main(int argc, char **argv)
{
#define TRACEPOINT_DEFINE
#include "tp.h"
int main(int argc, char **argv)
{
- int i, netint;
+ int i, netint
, ret = 0
;
long values[] = { 1, 2, 3 };
char text[10] = "test";
double dbl = 2.0;
long values[] = { 1, 2, 3 };
char text[10] = "test";
double dbl = 2.0;
@@
-38,6
+41,11
@@
int main(int argc, char **argv)
unsigned int nr_iter = 100;
useconds_t nr_usec = 0;
unsigned int nr_iter = 100;
useconds_t nr_usec = 0;
+ if (set_signal_handler()) {
+ ret = -1;
+ goto end;
+ }
+
if (argc >= 2) {
nr_iter = atoi(argv[1]);
}
if (argc >= 2) {
nr_iter = atoi(argv[1]);
}
@@
-59,8
+67,17
@@
int main(int argc, char **argv)
dbl, flt);
tracepoint(tp, tptest5, i, netint, values, text, strlen(text),
dbl, flt);
dbl, flt);
tracepoint(tp, tptest5, i, netint, values, text, strlen(text),
dbl, flt);
- usleep(nr_usec);
+ if (nr_usec) {
+ if (usleep_safe(nr_usec)) {
+ ret = -1;
+ goto end;
+ }
+ }
+ if (should_quit) {
+ break;
+ }
}
}
- return 0;
+end:
+ exit(!ret ? EXIT_SUCCESS : EXIT_FAILURE);
}
}
This page took
0.024739 seconds
and
4
git commands to generate.