Doc: add CMake example
authorSebastien Boisvert <sboisvert@gydle.com>
Thu, 16 Jun 2016 15:41:11 +0000 (11:41 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 27 Jun 2016 16:43:11 +0000 (12:43 -0400)
In doc/examples/cmake-multiple-shared-libraries/, a new example lives.
This example requires a C++ compiler (HAVE_CXX) and it requires also a
cmake executable (HAVE_CMAKE). This example relies on the cmake module
called FindLTTngUST, which was kindly provided by Philippe Proulx.

The alignment of a small amount of lines was improved in the FindLTTngUST
module.

This new example generates a shared library (tracepoint provider) that
links with dl and with lttng-ust. Two other shared libraries are also
generated, and these two are linked with the tracepoint provider shared
library.

Link: https://lists.lttng.org/pipermail/lttng-dev/2016-June/026213.html
Link: https://lists.lttng.org/pipermail/lttng-dev/2016-June/026203.html
Link: https://www.pastery.net/fvanfh/raw/
Acked-by: Philippe Proulx <eeppeliteloop@gmail.com>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Sebastien Boisvert <sboisvert@gydle.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 files changed:
doc/examples/cmake-multiple-shared-libraries/CMakeLists.txt [new file with mode: 0644]
doc/examples/cmake-multiple-shared-libraries/README.md [new file with mode: 0644]
doc/examples/cmake-multiple-shared-libraries/aligner-lib.cpp [new file with mode: 0644]
doc/examples/cmake-multiple-shared-libraries/aligner-lib.h [new file with mode: 0644]
doc/examples/cmake-multiple-shared-libraries/aligner.cpp [new file with mode: 0644]
doc/examples/cmake-multiple-shared-libraries/cmake/FindLTTngUST.cmake [new file with mode: 0644]
doc/examples/cmake-multiple-shared-libraries/tester-lib.cpp [new file with mode: 0644]
doc/examples/cmake-multiple-shared-libraries/tester-lib.h [new file with mode: 0644]
doc/examples/cmake-multiple-shared-libraries/tester.cpp [new file with mode: 0644]
doc/examples/cmake-multiple-shared-libraries/trace.sh [new file with mode: 0755]
doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.cpp [new file with mode: 0644]
doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.h [new file with mode: 0644]

diff --git a/doc/examples/cmake-multiple-shared-libraries/CMakeLists.txt b/doc/examples/cmake-multiple-shared-libraries/CMakeLists.txt
new file mode 100644 (file)
index 0000000..71fcf24
--- /dev/null
@@ -0,0 +1,23 @@
+cmake_minimum_required(VERSION 2.8.11)
+project(ALIGNER)
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+
+include_directories(.)
+
+include (FindLTTngUST REQUIRED)
+
+add_library(tracepoint-provider SHARED tracepoint-provider.cpp)
+target_link_libraries(tracepoint-provider LTTng::UST)
+
+add_library(aligner-lib SHARED aligner-lib.cpp)
+target_link_libraries(aligner-lib tracepoint-provider)
+
+add_library(tester-lib SHARED tester-lib.cpp)
+target_link_libraries(tester-lib tracepoint-provider)
+
+link_libraries(aligner-lib)
+
+add_executable(aligner aligner.cpp)
+
+add_executable(tester tester.cpp)
+target_link_libraries(tester tester-lib)
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" }
+```
diff --git a/doc/examples/cmake-multiple-shared-libraries/aligner-lib.cpp b/doc/examples/cmake-multiple-shared-libraries/aligner-lib.cpp
new file mode 100644 (file)
index 0000000..946e5e3
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2016  Sebastien Boisvert <sboisvert@gydle.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#define TRACEPOINT_DEFINE
+
+#include "aligner-lib.h"
+#include "tracepoint-provider.h"
+
+void alignQuery(const std::string & queryName)
+{
+       tracepoint(gydle_om, alignQuery, queryName.c_str());
+
+       /* Do the actual alignment */
+       /* ... */
+}
diff --git a/doc/examples/cmake-multiple-shared-libraries/aligner-lib.h b/doc/examples/cmake-multiple-shared-libraries/aligner-lib.h
new file mode 100644 (file)
index 0000000..d3b40c5
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2016  Sebastien Boisvert <sboisvert@gydle.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef ALIGNER_LIB_H
+#define ALIGNER_LIB_H
+
+#include <string>
+
+void alignQuery(const std::string & queryName);
+
+#endif
diff --git a/doc/examples/cmake-multiple-shared-libraries/aligner.cpp b/doc/examples/cmake-multiple-shared-libraries/aligner.cpp
new file mode 100644 (file)
index 0000000..19adfce
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2016  Sebastien Boisvert <sboisvert@gydle.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "aligner-lib.h"
+
+int main(int argc, char **argv)
+{
+       alignQuery("molecule-foo");
+
+       return 0;
+}
diff --git a/doc/examples/cmake-multiple-shared-libraries/cmake/FindLTTngUST.cmake b/doc/examples/cmake-multiple-shared-libraries/cmake/FindLTTngUST.cmake
new file mode 100644 (file)
index 0000000..18d28bd
--- /dev/null
@@ -0,0 +1,111 @@
+#.rst:
+# FindLTTngUST
+# ------------
+#
+# This module finds the `LTTng-UST <http://lttng.org/>`__ library.
+#
+# Imported target
+# ^^^^^^^^^^^^^^^
+#
+# This module defines the following :prop_tgt:`IMPORTED` target:
+#
+# ``LTTng::UST``
+#   The LTTng-UST library, if found
+#
+# Result variables
+# ^^^^^^^^^^^^^^^^
+#
+# This module sets the following
+#
+# ``LTTNGUST_FOUND``
+#   ``TRUE`` if system has LTTng-UST
+# ``LTTNGUST_INCLUDE_DIRS``
+#   The LTTng-UST include directories
+# ``LTTNGUST_LIBRARIES``
+#   The libraries needed to use LTTng-UST
+# ``LTTNGUST_VERSION_STRING``
+#   The LTTng-UST version
+# ``LTTNGUST_HAS_TRACEF``
+#   ``TRUE`` if the ``tracef()`` API is available in the system's LTTng-UST
+# ``LTTNGUST_HAS_TRACELOG``
+#   ``TRUE`` if the ``tracelog()`` API is available in the system's LTTng-UST
+
+#=============================================================================
+# Copyright 2016 Kitware, Inc.
+# Copyright 2016 Philippe Proulx <pproulx@efficios.com>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+find_path(LTTNGUST_INCLUDE_DIRS NAMES lttng/tracepoint.h)
+find_library(LTTNGUST_LIBRARIES NAMES lttng-ust)
+
+if(LTTNGUST_INCLUDE_DIRS AND LTTNGUST_LIBRARIES)
+  # find tracef() and tracelog() support
+  set(LTTNGUST_HAS_TRACEF 0)
+  set(LTTNGUST_HAS_TRACELOG 0)
+
+  if(EXISTS "${LTTNGUST_INCLUDE_DIRS}/lttng/tracef.h")
+    set(LTTNGUST_HAS_TRACEF TRUE)
+  endif()
+
+  if(EXISTS "${LTTNGUST_INCLUDE_DIRS}/lttng/tracelog.h")
+    set(LTTNGUST_HAS_TRACELOG TRUE)
+  endif()
+
+  # get version
+  set(lttngust_version_file "${LTTNGUST_INCLUDE_DIRS}/lttng/ust-version.h")
+
+  if(EXISTS "${lttngust_version_file}")
+    file(STRINGS "${lttngust_version_file}" lttngust_version_major_string
+         REGEX "^[\t ]*#define[\t ]+LTTNG_UST_MAJOR_VERSION[\t ]+[0-9]+[\t ]*$")
+    file(STRINGS "${lttngust_version_file}" lttngust_version_minor_string
+         REGEX "^[\t ]*#define[\t ]+LTTNG_UST_MINOR_VERSION[\t ]+[0-9]+[\t ]*$")
+    file(STRINGS "${lttngust_version_file}" lttngust_version_patch_string
+         REGEX "^[\t ]*#define[\t ]+LTTNG_UST_PATCHLEVEL_VERSION[\t ]+[0-9]+[\t ]*$")
+    string(REGEX REPLACE ".*([0-9]+).*" "\\1"
+           lttngust_v_major "${lttngust_version_major_string}")
+    string(REGEX REPLACE ".*([0-9]+).*" "\\1"
+           lttngust_v_minor "${lttngust_version_minor_string}")
+    string(REGEX REPLACE ".*([0-9]+).*" "\\1"
+           lttngust_v_patch "${lttngust_version_patch_string}")
+    set(LTTNGUST_VERSION_STRING
+        "${lttngust_v_major}.${lttngust_v_minor}.${lttngust_v_patch}")
+    unset(lttngust_version_major_string)
+    unset(lttngust_version_minor_string)
+    unset(lttngust_version_patch_string)
+    unset(lttngust_v_major)
+    unset(lttngust_v_minor)
+    unset(lttngust_v_patch)
+  endif()
+
+  unset(lttngust_version_file)
+
+  if(NOT TARGET LTTng::UST)
+    add_library(LTTng::UST UNKNOWN IMPORTED)
+    set_target_properties(LTTng::UST PROPERTIES
+      INTERFACE_INCLUDE_DIRECTORIES "${LTTNGUST_INCLUDE_DIRS}"
+      INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS}
+      IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+      IMPORTED_LOCATION "${LTTNGUST_LIBRARIES}")
+  endif()
+
+  # add libdl to required libraries
+  set(LTTNGUST_LIBRARIES ${LTTNGUST_LIBRARIES} ${CMAKE_DL_LIBS})
+endif()
+
+# handle the QUIETLY and REQUIRED arguments and set LTTNGUST_FOUND to
+# TRUE if all listed variables are TRUE
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LTTngUST FOUND_VAR LTTNGUST_FOUND
+  REQUIRED_VARS LTTNGUST_LIBRARIES
+  LTTNGUST_INCLUDE_DIRS
+  VERSION_VAR LTTNGUST_VERSION_STRING)
+mark_as_advanced(LTTNGUST_LIBRARIES LTTNGUST_INCLUDE_DIRS)
diff --git a/doc/examples/cmake-multiple-shared-libraries/tester-lib.cpp b/doc/examples/cmake-multiple-shared-libraries/tester-lib.cpp
new file mode 100644 (file)
index 0000000..8fb90a0
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2016  Sebastien Boisvert <sboisvert@gydle.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#define TRACEPOINT_DEFINE
+
+#include "tester-lib.h"
+#include "tracepoint-provider.h"
+
+void testAlignment(const std::string & alignment)
+{
+       tracepoint(gydle_om, testAlignment, alignment.c_str());
+}
diff --git a/doc/examples/cmake-multiple-shared-libraries/tester-lib.h b/doc/examples/cmake-multiple-shared-libraries/tester-lib.h
new file mode 100644 (file)
index 0000000..994fa00
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2016  Sebastien Boisvert <sboisvert@gydle.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef TEST_LIB_H
+#define TEST_LIB_H
+
+#include <string>
+
+void testAlignment(const std::string & alignment);
+
+#endif
diff --git a/doc/examples/cmake-multiple-shared-libraries/tester.cpp b/doc/examples/cmake-multiple-shared-libraries/tester.cpp
new file mode 100644 (file)
index 0000000..6bc486d
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2016  Sebastien Boisvert <sboisvert@gydle.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "aligner-lib.h"
+#include "tester-lib.h"
+
+int main(int argc, char **argv)
+{
+       /* Generate alignment */
+       alignQuery("moleculeX");
+
+       /* Test alignment */
+       testAlignment("my-alignment");
+
+       return 0;
+}
diff --git a/doc/examples/cmake-multiple-shared-libraries/trace.sh b/doc/examples/cmake-multiple-shared-libraries/trace.sh
new file mode 100755 (executable)
index 0000000..8264ee6
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+lttng create
+lttng enable-event -u 'gydle_om:*'
+lttng start
+./tester
+lttng stop
+lttng view > trace.txt
+cat trace.txt
diff --git a/doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.cpp b/doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.cpp
new file mode 100644 (file)
index 0000000..b39f166
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2016  Sebastien Boisvert <sboisvert@gydle.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#define TRACEPOINT_CREATE_PROBES
+#define TRACEPOINT_DEFINE
+
+#include "tracepoint-provider.h"
diff --git a/doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.h b/doc/examples/cmake-multiple-shared-libraries/tracepoint-provider.h
new file mode 100644 (file)
index 0000000..301f357
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2016  Sebastien Boisvert <sboisvert@gydle.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#undef TRACEPOINT_PROVIDER
+#define TRACEPOINT_PROVIDER gydle_om
+
+#undef TRACEPOINT_INCLUDE
+#define TRACEPOINT_INCLUDE "tracepoint-provider.h"
+
+#if !defined(MY_TRACEPOINT_PROVIDER_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
+#define MY_TRACEPOINT_PROVIDER_H
+
+#include <lttng/tracepoint.h>
+
+TRACEPOINT_EVENT(
+       TRACEPOINT_PROVIDER,
+       alignQuery,
+       TP_ARGS(
+               const char*, queryName
+       ),
+       TP_FIELDS(
+               ctf_string(queryName, queryName)
+       )
+)
+
+TRACEPOINT_EVENT(
+       TRACEPOINT_PROVIDER,
+       testAlignment,
+       TP_ARGS(
+               const char*, alignment
+       ),
+       TP_FIELDS(
+               ctf_string(alignment, alignment)
+       )
+)
+
+
+
+#endif /* MY_TRACEPOINT_PROVIDER_H */
+
+#include <lttng/tracepoint-event.h>
This page took 0.031906 seconds and 4 git commands to generate.