Comment 3 for bug 1699755

Revision history for this message
Colin Ian King (colin-king) wrote :

With the correct upstream compat patches we still get issues.

  * Cherry picks to fix build isues with 4.11 and 4.12
    - [75833a8] Fix: update mm_vmscan instrumentation for kernel 4.11
    - [e52717e] Fix: update btrfs instrumentation for kernel 4.11
    - [52a391b] Fix: changes to the vm_op fault cb prototype in
                libringbuffer
    - [8a9f549] Fix: update scsi instrumentation for kernel 4.11
    - [678dd1c] Fix: timers cputime_t arguments replaced by ull in kernel
                4.11
    - [4c4d77d] Fix: atomic_add_unless() returns true/false rather than
                prior value
    - [7793231] Fix: kref changes for kernel 4.11
    - [673e9a0] Fix: update sched instrumentation for kernel 4.12
    - [e2833be] Fix: update ringbuffer for kernel 4.12
    - [5807b1a] Fix: update btrfs instrumentation for kernel 4.12
    - [d245707] Fix: update block instrumentation for kernel 4.12
    - [5d84966] Fix: update ftrace probe for kernel 4.12
    - [bc1fb1b] Fix: Build ftrace probe on kernels prior to 4.12

This works fine for 4.11 and passes the regression tests. However with 4.12 we get a DKMS build failure:

WARNING: "lttng_ftrace_destroy_private" [/var/lib/dkms/lttng-modules/2.9.0/build/lttng-tracer.ko] undefined!
WARNING: "lttng_ftrace_register" [/var/lib/dkms/lttng-modules/2.9.0/build/lttng-tracer.ko] undefined!
WARNING: "lttng_ftrace_unregister" [/var/lib/dkms/lttng-modules/2.9.0/build/lttng-tracer.ko] undefined!
WARNING: modpost: Found 1 section mismatch(es).

The reason is because of linux commits:

  ec19b85913486993d7d6f747beed1a711afd47d8
  bca6c8d0480a8aa5c86f8f416db96c71f6b79e29
  b5f081b563a6cdcb85a543df8c851951a8978275
  6e4443199e5354255e8a4c1e8e5cfc8ef064c3ce

but most specifically:

commit 92a68fa047ca5b8e1991af2d50b23ad9452613cd
Author: Steven Rostedt (VMware) <email address hidden>
Date: Fri Mar 31 19:21:41 2017 -0400

    ftrace: Move the function commands into the tracing directory

    As nothing outside the tracing directory uses the function command mechanism,
    I'm moving the prototypes out of the include/linux/ftrace.h and into the
    local kernel/trace/trace.h header. I plan on making them hook to the
    trace_array structure which is local to kernel/trace, and I do not want to
    expose it to the rest of the kernel. This requires that the command functions
    must also be local to tracing. But luckily nothing else uses them.

    Signed-off-by: Steven Rostedt (VMware) <email address hidden>

lttng seems to expect the symbols from the lttng lttng-ftrace.o, but these are dependent on the lttng-ftrace being built, which it is not because of:

commit 5d8496675c9e8ccf169871f4f72022df9677624a
Author: Michael Jeanson <email address hidden>
Date: Thu May 25 16:56:52 2017 -0400

    Fix: update ftrace probe for kernel 4.12

..which effectively disables it:

+ ifeq ($(ftrace),warn)
+ $(warning Files $(ftrace_dep) not found. Probe "ftrace" is disabled. Use full kernel source tree to enable it.)
+ ftrace =
+ endif # $(ftrace),warn

and implies we need the full kernel source to build it. Not so good. I'll reach out to upstream about this.