3d57eb5b |
1 | |
2 | #include <stdio.h> |
3 | #include <unistd.h> |
4 | |
5 | #define LTT_TRACE |
972a52cf |
6 | #define LTT_BLOCKING 1 |
3d57eb5b |
7 | #include <ltt/ltt-facility-user_generic.h> |
8 | |
9 | |
10 | int main(int argc, char **argv) |
11 | { |
2c86dabf |
12 | printf("Will trace the following string : \"Hello world! Have a nice day.\"\n"); |
13 | printf("every second.\n"); |
987daa89 |
14 | printf("Abort with CTRL-C.\n"); |
15 | printf("No file is created with this example : it logs through a kernel\n"); |
16 | printf("system call. See the LTTng lttctl command to start tracing.\n"); |
3d57eb5b |
17 | |
18 | while(1) { |
19 | trace_user_generic_string("Hello world! Have a nice day."); |
20 | sleep(1); |
21 | } |
22 | |
23 | return 0; |
24 | } |
25 | |