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";
26 void create_file(const char *path
)
32 ret
= creat(path
, S_IRWXU
);
34 fprintf(stderr
, "Failed to create file %s\n", path
);
41 int main(int argc
, char **argv
)
44 unsigned int nr_iter
= 100;
45 useconds_t nr_usec
= 0;
46 char *tmp_file_path
= NULL
;
48 if (set_signal_handler()) {
53 nr_iter
= atoi(argv
[1]);
57 /* By default, don't wait unless user specifies. */
58 nr_usec
= atoi(argv
[2]);
62 tmp_file_path
= argv
[3];
65 for (i
= 0; i
< nr_iter
; i
++) {
66 tracef("Test message %d with string \"%s\"", i
, str
);
69 * First loop we create the file if asked to indicate
70 * that at least one tracepoint has been hit.
72 if (i
== 0 && tmp_file_path
) {
73 create_file(tmp_file_path
);
This page took 0.042914 seconds and 5 git commands to generate.