Disable sched_switch bitwise enum in default build
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 11 May 2021 21:15:15 +0000 (17:15 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 13 May 2021 15:47:10 +0000 (11:47 -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.

Original commit:

  commit 721caea47b6506f7ad9086c3e9801dc9dfe06b6a
  Author: Geneviève Bastien <gbastien@versatic.net>
  Date:   Wed Feb 12 16:58:25 2020 -0500

    sched: Make the sched_switch task state an enum

Change-Id: Ib19d06365fbed7daa9440d5dfff283c4f89db6ee
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/instrumentation/events/sched.h

index 29bce6729b9e5af33a5b7e8eeaaa7f36cf54eee2..91953a6f1ca993990cdd7034efb6aee388357b88 100644 (file)
@@ -165,6 +165,7 @@ static inline long __trace_sched_switch_state(struct task_struct *p)
 
 #endif /* _TRACE_SCHED_DEF_ */
 
+#ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM
 /*
  * Enumeration of the task state bitmask.
  * Only bit flags are enumerated here, not composition of states.
@@ -198,6 +199,7 @@ LTTNG_TRACEPOINT_ENUM(task_state,
                ctf_enum_value("TASK_STATE_MAX", TASK_STATE_MAX)
        )
 )
+#endif /* CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM */
 
 /*
  * Tracepoint for calling kthread_stop, performed to end a kthread:
@@ -339,9 +341,17 @@ LTTNG_TRACEPOINT_EVENT(sched_switch,
                ctf_integer(pid_t, prev_tid, prev->pid)
                ctf_integer(int, prev_prio, prev->prio - MAX_RT_PRIO)
 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,4,0))
+#ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM
                ctf_enum(task_state, long, prev_state, __trace_sched_switch_state(preempt, prev))
 #else
+               ctf_integer(long, prev_state, __trace_sched_switch_state(preempt, prev))
+#endif
+#else
+#ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM
                ctf_enum(task_state, long, prev_state, __trace_sched_switch_state(prev))
+#else
+               ctf_integer(long, prev_state, __trace_sched_switch_state(prev))
+#endif
 #endif
                ctf_array_text(char, next_comm, next->comm, TASK_COMM_LEN)
                ctf_integer(pid_t, next_tid, next->pid)
This page took 0.026294 seconds and 4 git commands to generate.