From: Mathieu Desnoyers Date: Mon, 4 May 2020 19:00:53 +0000 (-0400) Subject: Unbreak LTTng for kernel 5.7 X-Git-Tag: v2.13.0-rc1~236 X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;h=a65765406b03e4f3b7a4303e1c9ed83c86cdd358;hp=a65765406b03e4f3b7a4303e1c9ed83c86cdd358;p=lttng-modules.git Unbreak LTTng for kernel 5.7 Linux commit 0bd476e6c67190b5eb7b6e105c8db8ff61103281 ("kallsyms: unexport kallsyms_lookup_name() and kallsyms_on_each_symbol()") breaks LTTng-modules by removing symbols used by the LTTng-modules out-of-tree tracer. I pointed this out when the change was originally considered before the 5.7 merge window. This generated some discussion but it did not lead to any concrete proposal to fix the issue. [1] The commit has been merged in the 5.7 merge window. At that point, as maintainer of LTTng, I immediately raised a flag about this issue, proposing an alternative approach to solve this: expose the few symbols needed by LTTng to GPL modules. This was NACKed on the ground that the Linux kernel cannot export GPL symbols when there are no in-tree users. [2] Steven Rostedt has shown interest in merging LTTng-modules upstream. LTTng-modules being LGPL, this is very much doable. I have prepared a tree of LTTng-modules "for upstreaming" and sent it to him privately so he can review it. Even if in an ideal scenario LTTng-modules is merged for the following merge window, it leaves LTTng-modules broken on the 5.7 kernel. In order to ensure that the LTTng-modules kernel tracer continues working for my end users on kernels 5.7 onwards, as a very last resort, this is with great reluctance that I created this fix for LTTng modules. It basically uses kprobes to lookup the kallsyms_lookup_name symbol, and continues using kallsyms_lookup_name as before. Link: https://lore.kernel.org/r/20200302192811.n6o5645rsib44vco@localhost [1] Link: https://lore.kernel.org/r/20200409193543.18115-1-mathieu.desnoyers@efficios.com [2] Link: https://lwn.net/Articles/817988/ Signed-off-by: Mathieu Desnoyers CC: Thomas Gleixner CC: Will Deacon CC: akpm@linux-foundation.org CC: Greg Kroah-Hartman CC: Masami Hiramatsu CC: rostedt@goodmis.org CC: Alexei Starovoitov ---