add readme
[lttv.git] / usertrace-generic / sample-printf.c
CommitLineData
e36efdc5 1
2#include <stdio.h>
3#include <unistd.h>
4
5#define LTT_TRACE
6#define LTT_BLOCKING 1
7#include <ltt/ltt-facility-user_generic.h>
8#include <ltt/ltt-facility-custom-user_generic.h>
9
10
11int main(int argc, char **argv)
12{
13 printf("Will trace a printf of an incrementing counter.\n");
14 unsigned int count = 0;
15
16 while(1) {
15146922 17 trace_user_generic_slow_printf("in: %s at: %s:%d: Counter value is: %u.",
18 __FILE__, __func__, __LINE__, count);
e36efdc5 19 count++;
20 sleep(1);
21 }
22
23 return 0;
24}
25
This page took 0.022708 seconds and 4 git commands to generate.