<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><span id="zwchr" data-marker="__DIVIDER__">----- On Apr 28, 2019, at 6:11 AM, Nicholas Sadjoli <nick.sadjoli@gmail.com> wrote:<br></span></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div dir="ltr">Hello again Mathieu,<br><div>I apologize that this is a rather late re-opening of the topic again. However, after consulting with the RPi kernel side, it seems that even after trying to fix for the mentioned issue (i.e. by upgrading to the listed 'fixed' commit), I am still having issues installing the lttng-modules. The following link is the thread that I am having with the RPi kernel github: <a href="https://github.com/raspberrypi/linux/issues/2930" target="_blank">https://github.com/raspberrypi/linux/issues/2930</a><br data-mce-bogus="1"></div></div></blockquote><div>As replied by "pelwell" on the tracker:<br></div><div><br data-mce-bogus="1"></div><div>"I think that the problem isn't with how you applied the back-ported patch, but with the detection of the problem by lttng. It seems that the obvious course of action is not sufficient to fix the problem, and I can't spare the time to start building lttng just to debug it for you - sorry."</div><div><br></div><div>Cherry-picking the kernel fix is not sufficient to let the lttng-modules kernel version blacklist mechanism know that<br data-mce-bogus="1"></div><div>the kernel indeed has the fix. That's because the blacklist is based on the kernel version ranges, and you did<br data-mce-bogus="1"></div><div>not change the kernel version.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div dir="ltr"><br><div>Even though it is listed that version 2.9 seems to be okay, recently I tried to re-install the lttng-modules onto another RPi, but this time even with the 'fixed' commit as suggested in the thread, lttng-modules still give the same 'buggy kernel implementation' error. Please do note that it seems CONFIG_OPTPROBES cannot be turned off at all during the kernel build, as it will be overriden by default and seems to be integral to the build of the RPi's RT kernel as well, hence this is not really an option either.</div></div></blockquote><div>I my prior response, I never recommended to just cherry-pick the fix. I recommended that<br></div><div>you upgrade your kernel tree to one that contains the fix (and has a version tag which<br data-mce-bogus="1"></div><div>guarantees that).<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div dir="ltr"><br><div>Is there a specific way on how to upgrade to the mentioned 'fixed' commit without requiring a complete kernel overhaul? I am getting rather desparate as I need this to work for an upcoming assignment deadline this week. So I'm hoping that there is still potential solution to this.</div></div></blockquote><div>If you just cherry-picked the fix without changing the kernel version, the lttng-modules blacklist will still refuse to compile<br></div><div>against your kernel, because the blacklist is based on kernel version range checks.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>There are a few solutions here:<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>1) Turn off CONFIG_OPTPROBES with the help of the RPi community,<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>2) Upgrade your kernel tree to a kernel version that is outside of the blacklist range. Not just cherry-picking the specific fix.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>3) If you choose to just cherry-pick the fix and not change the kernel version, you<br data-mce-bogus="1"></div><div> can force lttng-modules to build against a blacklisted kernel version by removing<br data-mce-bogus="1"></div><div> those lines in the lttng-modules source tree:<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>blacklist/kprobes.h:<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>#if LTTNG_KERNEL_RANGE(4,20,0, 4,20,13) \<br> || LTTNG_KERNEL_RANGE(4,19,9, 4,19,26) \<br> || LTTNG_KERNEL_RANGE(4,14,87, 4,14,104)<br># if defined(CONFIG_ARM) && defined(CONFIG_OPTPROBES)<br># error "Your kernel is known to have buggy optimized kprobes implementation. Fixed by commit 0ac569bf6a7983c0c5747d6df8db9dc05bc92b6c \"ARM: 8834/1: Fix: kprobes: optimized kprobes illegal instruction\" in Linux. Disable CONFIG_OPTPROBES or upgrade your kernel."<br># endif /* #if defined(CONFIG_ARM) && defined(CONFIG_OPTPROBES) */<br>#endif<br><br data-mce-bogus="1"></div><div>This will ensure lttng-modules builds against your kernel even though it's in the range<br data-mce-bogus="1"></div><div>of kernel versions known to cause issues. But considering you cherry-picked the<br data-mce-bogus="1"></div><div>fix, then you should be fine.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>However, doing so removes the "belts and suspenders" we put in place to ensure<br data-mce-bogus="1"></div><div>you don't try to use a bogus kprobes. I therefore recommend solutions 1 or 2 rather<br data-mce-bogus="1"></div><div>than 3, but solution 3 might do the trick considering your short time-frame.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Good luck,<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Mathieu<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div dir="ltr"><br><br><div>Best Regards,</div><br><br><br><div>Nicholas Sadjoli</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 15, 2019 at 10:11 PM Mathieu Desnoyers <<a href="mailto:mathieu.desnoyers@efficios.com" target="_blank">mathieu.desnoyers@efficios.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><div><span id="gmail-m_9106008346192568069zwchr">----- On Apr 15, 2019, at 7:07 AM, Nicholas Sadjoli <<a href="mailto:nick.sadjoli@gmail.com" target="_blank">nick.sadjoli@gmail.com</a>> wrote:<br></span></div><div><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Dear Lttng dev Team,<br><div>I am currently interested in using lttng to measure the interrupt or hardware real-time latencies experienced within my user-space applications. Unfortunately I have been having issues installing lttng on my Raspberry Pi that is using the PREEMPT_RT patched kernel, version <span style="color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">4.14.91-rt49-v7+. The problems so far can be seen documented in the RPi Linux github forum page here: </span><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" color="#24292e"><span style="font-size:14px"><a href="https://github.com/raspberrypi/linux/issues/2930" target="_blank">https://github.com/raspberrypi/linux/issues/2930</a></span></font><br></div><div><span style="color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px"><br></span></div><div><span style="color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">Initially I was about to just install the Debian package of the lttng onto the RPi, and just proceeded with the commands '</span><font face="Andale Mono WT, Andale Mono, Bitstream Vera Sans Mono, Liberation Mono, Nimbus Mono L, Ubuntu Mono, Monaco, Consolas, Lucida Console, Lucida Sans Typewriter, Courier New, Courier, monospace" color="rgba(0, 0, 0, 0.749019607843137)">sudo apt-get install lttng-modules-dkms liblttng-ust-dev lttng-tools' </font>However, I was unable to use lttng package at all and found out that for the RPi, a build from source is necessary for lttng, as described here: <span style="background-color:transparent"><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" color="#24292e"><span style="font-size:14px"><a href="https://stackoverflow.com/questions/52386448/linux-trace-tool-lttng-on-raspbian-kernel-tracer-not-available" target="_blank">https://stackoverflow.com/questions/52386448/linux-trace-tool-lttng-on-raspbian-kernel-tracer-not-available</a></span></font></span><br></div><div><span style="background-color:transparent"><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" color="#24292e"><span style="font-size:14px"><br></span></font></span></div><div><span style="background-color:transparent"><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" color="#24292e"><span style="font-size:14px">Following their suggestion, I then tried to build the lttng packages from source, and even re-building the RPi kernel locally to ensure the kernel headers are in the RPi and linked up properly to the source packages. </span></font></span></div><div><span style="background-color:transparent"><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" color="#24292e"><span style="font-size:14px"><br></span></font></span></div><div><span style="background-color:transparent"><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" color="#24292e"><span style="font-size:14px">Unfortunately when I tried to do this for the lttng-modules package, it instead gave me the following warning in my latest attempt: </span></font></span></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" color="#24292e"><span style="font-size:14px"><br></span></font></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" color="#24292e"><span style="font-size:14px">I</span></font><span style="font-size:14px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"">n file included from /home/pi/BangEco_rvmscan/stagelight_project/lttng/lttng-modules/probes/lttng-kprobes.c:31:0:</span></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" color="#24292e"><span style="font-size:14px">/home/pi/BangEco_rvmscan/stagelight_project/lttng/lttng-modules/probes/../blacklist/kprobes.h:19:4: error: #error "Your kernel is known to have buggy optimized kprobes implementation. Fixed by commit 0ac569bf6a7983c0c5747d6df8db9dc05bc92b6c \"ARM: 8834/1: Fix: kprobes: optimized kprobes illegal instruction\" in Linux. Disable CONFIG_OPTPROBES or upgrade your kernel."</span></font></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" color="#24292e"><span style="font-size:14px"> # error "Your kernel is known to have buggy optimized kprobes implementation. Fixed by commit 0ac569bf6a7983c0c5747d6df8db9dc05bc92b6c \"ARM: 8834/1: Fix: kprobes: optimized kprobes illegal instruction\" in Linux. Disable CONFIG_OPTPROBES or upgrade your kernel."</span></font></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" color="#24292e"><span style="font-size:14px"><br></span></font></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" color="#24292e"><span style="font-size:14px">I then tried to turn off the CONFIG_OPTPROBES kernel config, but it seemed to be automatically overwritten during kernel building and is considered an important part of the real-time RPi kernels. Has such problems been reported with this version of the PREEMPT_RT kernel in the past (again, the current kernel version that I am using is </span></font><span style="color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">4.14.91-rt49-v7+)? If there are I would like to know how this issue was resolved so that I can properly build and use the lttng package for my project.</span></div></div></div></div></div></blockquote><div>Hi Nicholas,<br></div><br><div>It looks like our lttng-modules kernel version blacklist is acting exactly as it should. Looking at this<br></div><div>git tree:<br></div><br><div>git clone <a href="https://github.com/raspberrypi/linux.git" target="_blank">https://github.com/raspberrypi/linux.git</a> -b rpi-4.14.y-rt<br></div><div>I notice that in the git log, we find this bogus commit:<br></div><br><div>commit f9e0bc710347fadad55910846ee36f0681d0dca8<br>Author: Kees Cook <<a href="mailto:keescook@chromium.org" target="_blank">keescook@chromium.org</a>><br>Date: Tue Oct 30 22:12:56 2018 +0100<br><br> ARM: 8806/1: kprobes: Fix false positive with FORTIFY_SOURCE<br> <br> commit e46daee53bb50bde38805f1823a182979724c229 upstream.<br><br></div><div>But not the fix for it (upstream):<br></div><br><div>commit 0ac569bf6a7983c0c5747d6df8db9dc05bc92b6c<br>Author: Mathieu Desnoyers <<a href="mailto:mathieu.desnoyers@efficios.com" target="_blank">mathieu.desnoyers@efficios.com</a>><br>Date: Tue Feb 5 16:37:40 2019 +0100<br><br> ARM: 8834/1: Fix: kprobes: optimized kprobes illegal instruction<br><br></div><div>So lttng-modules refuses to build against your kernel configuration with CONFIG_OPTPROBES=y</div><div>to save you the trouble of having kprobes trigger illegal instruction OOPS at runtime.<br></div><br><div>I'm unusure who maintains that raspberrypi rt kernel tree. However, the upstream rt tree<br></div><div>for 4.14-rt maintained by Tom Zanussi seems to contain the fix:<br></div><br><div><a href="https://kernel.googlesource.com/pub/scm/linux/kernel/git/rt/linux-stable-rt/+/refs/heads/v4.14-rt" target="_blank">https://kernel.googlesource.com/pub/scm/linux/kernel/git/rt/linux-stable-rt/+/refs/heads/v4.14-rt</a><br></div><br><div>(currently at 4.14.109-rt57).<br></div><br><div>So you should contact your raspberrypi linux rt tree clone maintainer and ask him<br></div><div>to upgrade, or, as stated in the #error generated by lttng-modules, simply ensure<br></div><div>CONFIG_OPTPROBES is unset when you build your kernel. You should ask the<br></div><div>raspberrypi community advice on how to ensure this configuration option is not</div><div>overridden by the raspberrypi build system.<br></div><br><div>Thanks,<br></div><br><div>Mathieu</div><br><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><span style="color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px"><br></span></div><div><span style="color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px"><br></span></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" color="#24292e"><span style="font-size:14px">Thank you so much for your attention and looking forward to your reply soon.</span></font></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" color="#24292e"><span style="font-size:14px"><br></span></font></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" color="#24292e"><span style="font-size:14px"><br></span></font></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" color="#24292e"><span style="font-size:14px"><br></span></font></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" color="#24292e"><span style="font-size:14px">Best Regards,</span></font></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" color="#24292e"><span style="font-size:14px"><br></span></font></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" color="#24292e"><span style="font-size:14px"><br></span></font></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" color="#24292e"><span style="font-size:14px"><br></span></font></div><div><font face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" color="#24292e"><span style="font-size:14px">Nicholas Sadjoli</span></font></div></div></div></div></div>
<br>_______________________________________________<br>lttng-dev mailing list<br><a href="mailto:lttng-dev@lists.lttng.org" target="_blank">lttng-dev@lists.lttng.org</a><br><a href="https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" target="_blank">https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><br></blockquote></div><br><div>-- <br></div><div>Mathieu Desnoyers<br>EfficiOS Inc.<br><a href="http://www.efficios.com" target="_blank">http://www.efficios.com</a><br data-mce-bogus="1"></div></div></div></blockquote></div><br></blockquote></div><div><br></div><div data-marker="__SIG_POST__">-- <br></div><div>Mathieu Desnoyers<br>EfficiOS Inc.<br>http://www.efficios.com</div></div></body></html>