X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=doc%2Fexamples%2Feasy-ust%2Fsample.c;fp=doc%2Fexamples%2Feasy-ust%2Fsample.c;h=d030d700d2bff0489ed384fdcc48f222fad4fcf5;hb=7ccf75d384dd852f7aa51b44663546dd3c6baa83;hp=0000000000000000000000000000000000000000;hpb=b25c5b37ef536d7b09fe901d97e678220ec69c9a;p=lttng-ust.git diff --git a/doc/examples/easy-ust/sample.c b/doc/examples/easy-ust/sample.c new file mode 100644 index 00000000..d030d700 --- /dev/null +++ b/doc/examples/easy-ust/sample.c @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2011-2012 Matthew Khouzam + * Copyright (C) 2012 Mathieu Desnoyers + * + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED + * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * + * Permission is hereby granted to use or copy this program for any + * purpose, provided the above notices are retained on all copies. + * Permission to modify the code and to distribute modified code is + * granted, provided the above notices are retained, and a notice that + * the code was modified is included with the above copyright notice. + */ + +#include + +/* + * We need to define TRACEPOINT_DEFINE in one C file in the program + * before including provider headers. + */ +#define TRACEPOINT_DEFINE +#include "sample_component_provider.h" + +int main(int argc, char **argv) +{ + int i = 0; + + for (i = 0; i < 100000; i++) { + tracepoint(sample_component, message, "Hello World\n"); + usleep(1); + } + return 0; +}