Add experimental bitwise enum config option
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 12 May 2021 20:21:50 +0000 (16:21 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 13 May 2021 18:07:50 +0000 (14:07 -0400)
Only generate the bitwise enumerations when
CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM is enabled, so the default build
does not generate traces which lead to warnings when viewed with
babeltrace 1.x and babeltrace 2 with default options.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Id54ae3df470b9cdbc0edc0a528fa79532493d1ad

Kconfig
Makefile
README.md
lttng-events.c

diff --git a/Kconfig b/Kconfig
index 0ea350923a967b9d0667774cc25453bf0264848b..abaa41200e82c79e20cf586fe1e706dd6ed8dacd 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -14,4 +14,15 @@ config LTTNG
 
          If unsure, say N.
 
+config LTTNG_EXPERIMENTAL_BITWISE_ENUM
+       bool "LTTng experimental bitwise enum support"
+       default n
+       depends on LTTNG
+       help
+         Enable experimental bitwise enumerations. The traces produced with
+         this option enabled will generate warnings when read by trace
+         viewers with default options.
+
+         If unsure, say N.
+
 source "lttng/tests/Kconfig"
index a9aff3f181da92899f593de71cad640d4c59157e..c6173690da4402147698243c3fb6a3d5bdea5e1f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -147,18 +147,36 @@ KERNELDIR ?= /lib/modules/$(shell uname -r)/build
 PWD := $(shell pwd)
 CFLAGS = $(EXTCFLAGS)
 
+# Experimental bitwise enum defaults to disabled.
+CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM ?= n
+
+# Emulate Kconfig behavior of setting defines for config options.
+LKCPPFLAGS = $(KCPPFLAGS)
+ifeq ($(CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM),y)
+LKCPPFLAGS += -DCONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM=y
+endif
+
 default: modules
 
 modules:
-       $(MAKE) -C $(KERNELDIR) M=$(PWD) CONFIG_LTTNG=m CONFIG_LTTNG_CLOCK_PLUGIN_TEST=m modules
+       $(MAKE) -C $(KERNELDIR) M=$(PWD) \
+               CONFIG_LTTNG=m CONFIG_LTTNG_CLOCK_PLUGIN_TEST=m \
+               KCPPFLAGS='$(LKCPPFLAGS)' \
+               modules
 
 modules_install:
-       $(MAKE) -C $(KERNELDIR) M=$(PWD) CONFIG_LTTNG=m CONFIG_LTTNG_CLOCK_PLUGIN_TEST=m modules_install
+       $(MAKE) -C $(KERNELDIR) M=$(PWD) \
+               CONFIG_LTTNG=m CONFIG_LTTNG_CLOCK_PLUGIN_TEST=m \
+               KCPPFLAGS='$(LKCPPFLAGS)' \
+               modules_install
 
 clean:
        $(MAKE) -C $(KERNELDIR) M=$(PWD) clean
 
 %.i: %.c
-       $(MAKE) -C $(KERNELDIR) M=$(PWD) CONFIG_LTTNG=m CONFIG_LTTNG_CLOCK_PLUGIN_TEST=m $@
+       $(MAKE) -C $(KERNELDIR) M=$(PWD) \
+               CONFIG_LTTNG=m CONFIG_LTTNG_CLOCK_PLUGIN_TEST=m \
+               KCPPFLAGS='$(LKCPPFLAGS)' \
+               $@
 
 endif # KERNELRELEASE
index 7b04cd83b04991153ce8f7282ef3203a24489661..fc083249cd5982b20dd1b0c9115ebda612868e72 100644 (file)
--- a/README.md
+++ b/README.md
@@ -95,6 +95,21 @@ available from LTTng:
   - `CONFIG_KALLSYMS_ALL`: state dump of mapping between block device
     number and name
 
+### LTTng specific kernel config options
+
+The following kernel configuration options are provided by LTTng:
+
+  - `CONFIG_LTTNG`: Build LTTng (Defaults to 'm').
+  - `CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM`: Enable the experimental bitwise
+    enumerations (Defaults to 'n'). This can be enabled by building with:
+
+         make CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM=y
+
+  - `CONFIG_LTTNG_CLOCK_PLUGIN_TEST`: Build the test clock plugin (Defaults to
+    'm'). This plugin overrides the trace clock and should always be built as a
+    module for testing.
+
+
 Customization/Extension
 -----------------------
 
index 3450fa40dbcdb2966f9dac8855d3d4cb0cd1a5ed..dfd112abffc52919bf365869ea97be04422e565a 100644 (file)
@@ -3096,6 +3096,9 @@ static int __init lttng_events_init(void)
 #else
                "");
 #endif
+#ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM
+       printk(KERN_NOTICE "LTTng: Experimental bitwise enum enabled.\n");
+#endif /* CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM */
        return 0;
 
 error_hotplug:
This page took 0.028547 seconds and 4 git commands to generate.