8 //this one is a non blocking sample (not #define LTT_BLOCKING 1)
9 #include <ltt/ltt-facility-user_generic.h>
14 printf("thread 1, thread id : %lu, pid %lu\n", pthread_self(), getpid());
17 trace_user_generic_string("Hello world! Have a nice day.");
20 pthread_exit((void*)1);
24 /* Example of a _bad_ thread, which still works with the tracing */
27 printf("thread 2, thread id : %lu, pid %lu\n", pthread_self(), getpid());
30 trace_user_generic_string("Hello world! Have a nice day.");
43 printf("Will trace the following string : Hello world! Have a nice day.\n");
44 printf("Press CTRL-C to stop.\n");
45 printf("No file is created with this example : it logs through a kernel\n");
46 printf("system call. See the LTTng lttctl command to start tracing.\n\n");
48 printf("thread main, thread id : %lu, pid %lu\n", pthread_self(), getpid());
49 err
= pthread_create(&tid1
, NULL
, thr1
, NULL
);
52 err
= pthread_create(&tid2
, NULL
, thr2
, NULL
);
55 err
= pthread_join(tid1
, &tret
);
58 err
= pthread_join(tid2
, &tret
);
This page took 0.029936 seconds and 4 git commands to generate.