Move to kernel style SPDX license identifiers
[lttng-ust.git] / doc / examples / demo-tracelog / demo-tracelog.c
1 /*
2 * SPDX-License-Identifier: LGPL-2.1-only
3 *
4 * Copyright (C) 2009 Pierre-Marc Fournier
5 * Copyright (C) 2011-2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 */
7
8 #include <stdlib.h>
9 #include <stdio.h>
10 #include <unistd.h>
11
12 #include <lttng/tracelog.h>
13
14 int main(int argc, char **argv)
15 {
16 int i;
17 int delay = 0;
18
19 if (argc == 2)
20 delay = atoi(argv[1]);
21
22 fprintf(stderr, "Demo program starting.\n");
23
24 sleep(delay);
25
26 fprintf(stderr, "Tracing... ");
27 for (i = 0; i < 5; i++) {
28 tracelog(TRACE_ERR, "Error condition %d", i);
29 }
30 fprintf(stderr, " done.\n");
31 return 0;
32 }
This page took 0.029204 seconds and 4 git commands to generate.