Doc: add CMake example
[lttng-ust.git] / doc / examples / cmake-multiple-shared-libraries / README.md
diff --git a/doc/examples/cmake-multiple-shared-libraries/README.md b/doc/examples/cmake-multiple-shared-libraries/README.md
new file mode 100644 (file)
index 0000000..8b58246
--- /dev/null
@@ -0,0 +1,52 @@
+This examples shows how to use LTTng-UST in a project that uses
+CMake as the build system generator.
+
+Build the libraries and applications
+=====
+
+```bash
+mkdir build
+cd build
+cmake ..
+make
+```
+
+3 shared libraries will be generated
+
+```
+libaligner-lib.so
+libtester-lib.so
+libtracepoint-provider.so
+```
+
+
+and 2 executables will be generated
+
+```
+aligner
+tester
+```
+
+
+
+Trace the application tester
+============================
+
+The script trace.sh can be used.
+
+```bash
+lttng create
+lttng enable-event -u 'gydle_om:*'
+lttng start
+./tester
+lttng stop
+lttng view > trace.txt
+cat trace.txt
+```
+
+The content of trace.txt should be:
+
+```
+[21:45:34.940246019] (+?.?????????) osiris gydle_om:alignQuery: { cpu_id = 2 }, { queryName = "moleculeX" }
+[21:45:34.940263188] (+0.000017169) osiris gydle_om:testAlignment: { cpu_id = 2 }, { alignment = "my-alignment" }
+```
This page took 0.023172 seconds and 4 git commands to generate.