2 * Copyright (C) - 2012 David Goulet <dgoulet@efficios.com>
3 * Copyright (C) - 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 * This library is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU Lesser General Public License as published by the
7 * Free Software Foundation; version 2.1 of the License.
9 * This library is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this library; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
28 #include <sys/types.h>
31 #include <lttng/tracef.h>
33 const char *str
= "test string";
35 void create_file(const char *path
)
41 ret
= creat(path
, S_IRWXU
);
43 fprintf(stderr
, "Failed to create file %s\n", path
);
50 int main(int argc
, char **argv
)
53 unsigned int nr_iter
= 100;
54 useconds_t nr_usec
= 0;
55 char *tmp_file_path
= NULL
;
58 nr_iter
= atoi(argv
[1]);
62 /* By default, don't wait unless user specifies. */
63 nr_usec
= atoi(argv
[2]);
67 tmp_file_path
= argv
[3];
70 for (i
= 0; i
< nr_iter
; i
++) {
71 tracef("Test message %d with string \"%s\"", i
, str
);
74 * First loop we create the file if asked to indicate
75 * that at least one tracepoint has been hit.
77 if (i
== 0 && tmp_file_path
) {
78 create_file(tmp_file_path
);
This page took 0.032586 seconds and 5 git commands to generate.