ccflags-y += -DRT_PATCH_VERSION=$(RT_PATCH_VERSION)
endif
+EXTRA_VERSION_NAME:=$(shell $(TOP_LTTNG_MODULES_DIR)/extra-version-name.sh $(TOP_LTTNG_MODULES_DIR))
+
+ifneq ($(EXTRA_VERSION_NAME), 0)
+ ccflags-y += -DLTTNG_EXTRA_VERSION_NAME='"$(EXTRA_VERSION_NAME)"'
+endif
+
+EXTRA_VERSION_GIT:=$(shell $(TOP_LTTNG_MODULES_DIR)/extra-version-git.sh $(TOP_LTTNG_MODULES_DIR))
+
+ifneq ($(EXTRA_VERSION_GIT), 0)
+ ccflags-y += -DLTTNG_EXTRA_VERSION_GIT='"$(EXTRA_VERSION_GIT)"'
+endif
+
+EXTRA_VERSION_PATCHES:=$(shell $(TOP_LTTNG_MODULES_DIR)/extra-version-patches.sh $(TOP_LTTNG_MODULES_DIR))
+
# Starting with kernel 4.12, the ftrace header was moved to private headers
# and as such is not available when building against distro headers instead
# of the full kernel sources. In the situation, define LTTNG_FTRACE_MISSING_HEADER
--- /dev/null
+#!/bin/sh
+# SPDX-License-Identifier: (GPL-2.0 OR LGPL-2.1)
+
+# First argument is the path to the lttng modules sources.
+TOP_LTTNG_MODULES_DIR="$1"
+
+GIT_VERSION="0"
+
+if test -x "$(which git 2>&1;true)" && test -r "${TOP_LTTNG_MODULES_DIR}/.git"; then
+ GIT_VERSION_STR="$(cd "${TOP_LTTNG_MODULES_DIR}" && git describe --tags --dirty)"
+ GIT_CURRENT_TAG="$(cd "${TOP_LTTNG_MODULES_DIR}" && git describe --tags --exact-match --match="v[0-9]*" HEAD 2> /dev/null)"
+
+ GIT_VERSION="${GIT_VERSION_STR}"
+
+ if ! echo "${GIT_VERSION_STR}" | grep -- "-dirty" >/dev/null && test "x$GIT_CURRENT_TAG" != "x"; then
+ GIT_VERSION="0"
+ fi
+fi
+
+echo "${GIT_VERSION}"
--- /dev/null
+#!/bin/sh
+# SPDX-License-Identifier: (GPL-2.0 OR LGPL-2.1)
+
+# First argument is the path to the lttng modules sources.
+TOP_LTTNG_MODULES_DIR="$1"
+
+if ! test -d "${TOP_LTTNG_MODULES_DIR}"; then
+ exit 1
+fi
+
+TMPFILE="$(mktemp)"
+
+find "${TOP_LTTNG_MODULES_DIR}/extra_version/patches/" -maxdepth 1 ! -name 'README' -type f -printf '%f\n' | sort -r \
+ | sed -E 's/[^a-zA-Z0-9 \.]/-/g ; s/(.*)/MODULE_INFO(extra_version_patch, "\1");/g' >"${TMPFILE}" 2>/dev/null
+
+if test ! -f "${TOP_LTTNG_MODULES_DIR}/extra_version/patches.i" || \
+ test x"$(cat "${TMPFILE}")" != x"$(cat "${TOP_LTTNG_MODULES_DIR}/extra_version/patches.i")"; then
+ mv "${TMPFILE}" "${TOP_LTTNG_MODULES_DIR}/extra_version/patches.i"
+fi
+
+rm -f "${TMPFILE}"
ret = lttng_init_cpu_hotplug();
if (ret)
goto error_hotplug;
+ printk(KERN_NOTICE "LTTng: Loaded modules v%s.%s.%s%s (%s)%s%s\n",
+ __stringify(LTTNG_MODULES_MAJOR_VERSION),
+ __stringify(LTTNG_MODULES_MINOR_VERSION),
+ __stringify(LTTNG_MODULES_PATCHLEVEL_VERSION),
+ LTTNG_MODULES_EXTRAVERSION,
+ LTTNG_VERSION_NAME,
+#ifdef LTTNG_EXTRA_VERSION_GIT
+ LTTNG_EXTRA_VERSION_GIT[0] == '\0' ? "" : " - " LTTNG_EXTRA_VERSION_GIT,
+#else
+ "",
+#endif
+#ifdef LTTNG_EXTRA_VERSION_NAME
+ LTTNG_EXTRA_VERSION_NAME[0] == '\0' ? "" : " - " LTTNG_EXTRA_VERSION_NAME);
+#else
+ "");
+#endif
return 0;
error_hotplug:
lttng_tracepoint_exit();
error_tp:
lttng_context_exit();
+ printk(KERN_NOTICE "LTTng: Failed to load modules v%s.%s.%s%s (%s)%s%s\n",
+ __stringify(LTTNG_MODULES_MAJOR_VERSION),
+ __stringify(LTTNG_MODULES_MINOR_VERSION),
+ __stringify(LTTNG_MODULES_PATCHLEVEL_VERSION),
+ LTTNG_MODULES_EXTRAVERSION,
+ LTTNG_VERSION_NAME,
+#ifdef LTTNG_EXTRA_VERSION_GIT
+ LTTNG_EXTRA_VERSION_GIT[0] == '\0' ? "" : " - " LTTNG_EXTRA_VERSION_GIT,
+#else
+ "",
+#endif
+#ifdef LTTNG_EXTRA_VERSION_NAME
+ LTTNG_EXTRA_VERSION_NAME[0] == '\0' ? "" : " - " LTTNG_EXTRA_VERSION_NAME);
+#else
+ "");
+#endif
return ret;
}
kmem_cache_destroy(event_cache);
lttng_tracepoint_exit();
lttng_context_exit();
+ printk(KERN_NOTICE "LTTng: Unloaded modules v%s.%s.%s%s (%s)%s%s\n",
+ __stringify(LTTNG_MODULES_MAJOR_VERSION),
+ __stringify(LTTNG_MODULES_MINOR_VERSION),
+ __stringify(LTTNG_MODULES_PATCHLEVEL_VERSION),
+ LTTNG_MODULES_EXTRAVERSION,
+ LTTNG_VERSION_NAME,
+#ifdef LTTNG_EXTRA_VERSION_GIT
+ LTTNG_EXTRA_VERSION_GIT[0] == '\0' ? "" : " - " LTTNG_EXTRA_VERSION_GIT,
+#else
+ "",
+#endif
+#ifdef LTTNG_EXTRA_VERSION_NAME
+ LTTNG_EXTRA_VERSION_NAME[0] == '\0' ? "" : " - " LTTNG_EXTRA_VERSION_NAME);
+#else
+ "");
+#endif
}
module_exit(lttng_events_exit);
+#include "extra_version/patches.i"
+#ifdef LTTNG_EXTRA_VERSION_GIT
+MODULE_INFO(extra_version_git, LTTNG_EXTRA_VERSION_GIT);
+#endif
+#ifdef LTTNG_EXTRA_VERSION_NAME
+MODULE_INFO(extra_version_name, LTTNG_EXTRA_VERSION_NAME);
+#endif
MODULE_LICENSE("GPL and additional rights");
MODULE_AUTHOR("Mathieu Desnoyers <mathieu.desnoyers@efficios.com>");
MODULE_DESCRIPTION("LTTng Events");