2 * Copyright (C) 2012 David Goulet <dgoulet@efficios.com>
3 * Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 * SPDX-License-Identifier: LGPL-2.1-only
18 #include <sys/types.h>
21 #include <lttng/tracef.h>
22 #include "signal-helper.h"
24 const char *str
= "test string";
27 void create_file(const char *path
)
33 ret
= creat(path
, S_IRWXU
);
35 fprintf(stderr
, "Failed to create file %s\n", path
);
42 int main(int argc
, char **argv
)
45 unsigned int nr_iter
= 100;
46 useconds_t nr_usec
= 0;
47 char *tmp_file_path
= NULL
;
49 if (set_signal_handler()) {
54 nr_iter
= atoi(argv
[1]);
58 /* By default, don't wait unless user specifies. */
59 nr_usec
= atoi(argv
[2]);
63 tmp_file_path
= argv
[3];
66 for (i
= 0; i
< nr_iter
; i
++) {
67 tracef("Test message %d with string \"%s\"", i
, str
);
70 * First loop we create the file if asked to indicate
71 * that at least one tracepoint has been hit.
73 if (i
== 0 && tmp_file_path
) {
74 create_file(tmp_file_path
);
This page took 0.04983 seconds and 5 git commands to generate.