https://bugs.lttng.org/https://bugs.lttng.org/themes/lttng/favicon/a.ico?14249722912016-07-27T15:16:10ZLTTng bugs repositoryLTTng-UST - Bug #1053: lttng-ust doesn't build on Ubuntu 12.04https://bugs.lttng.org/issues/1053?journal_id=30742016-07-27T15:16:10ZMathieu Desnoyersmathieu.desnoyers@efficios.com
<ul></ul><p>One possible solution would be to grab our own copy of perf-event.h into lttng-ust, and use that local header.</p>
<p>As we do that, we should also check the "version" field of the ABI when interacting with the kernel to ensure<br />that the pmc_width is populated, else we should refuse to interact with the kernel.</p>
<p>Thoughts ?</p> LTTng-UST - Bug #1053: lttng-ust doesn't build on Ubuntu 12.04https://bugs.lttng.org/issues/1053?journal_id=30752016-07-27T15:51:58ZSimon Marchisimon.marchi@polymtl.ca
<ul></ul><p>Yeah it makes sense. I suppose that with the stock 12.04 kernel the ABI version will be too old so the perf counter feature won't be available, but at least it would allow using the rest of lttng-ust. It might not be super useful in itself to get lttng-ust working on 12.04 (it's super ooooold), but it would be useful to put the infrastructure to check the ABI version in place for future breakages.</p> LTTng-UST - Bug #1053: lttng-ust doesn't build on Ubuntu 12.04https://bugs.lttng.org/issues/1053?journal_id=30762016-07-29T21:08:39ZAnonymous
<ul></ul><p><code>linux/perf_event.h</code> is part of the linux-headers package. I guess many users will have kernel headers installed if they also want to compile lttng-modules, but that may not be the case of all of them. Is UST supposed to have a hard dependency on perf/linux-headers? Could that be a configure option, like <code>--disable-perf-counters</code> ?</p> LTTng-UST - Bug #1053: lttng-ust doesn't build on Ubuntu 12.04https://bugs.lttng.org/issues/1053?journal_id=30772016-07-31T23:24:58ZMathieu Desnoyersmathieu.desnoyers@efficios.com
<ul></ul><p>Alex: we're really talking about kernel headers exposing kernel ABI to user-space (make headers_install), not the kernel headers for kernel modules (which are packaged by some distros) here.</p>
<p>The Linux kernel ABI exposed to userspace never breaks, only expands. So it would be safe to build lttng-ust against a local copy of the perf header here.</p>
<p>I don't think we should add yet another configure option. We should instead add a copy of the header into lttng-ust, and dynamically check that the kernel ABI version is appropriate to use the fields we need to use.</p> LTTng-UST - Bug #1053: lttng-ust doesn't build on Ubuntu 12.04https://bugs.lttng.org/issues/1053?journal_id=30862016-08-18T18:16:31ZMathieu Desnoyersmathieu.desnoyers@efficios.com
<ul></ul><p>I'm preparing a patch.</p> LTTng-UST - Bug #1053: lttng-ust doesn't build on Ubuntu 12.04https://bugs.lttng.org/issues/1053?journal_id=30872016-08-19T00:21:37ZMathieu Desnoyersmathieu.desnoyers@efficios.com
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>Assignee</strong> set to <i>Mathieu Desnoyers</i></li></ul><p>The following commit should fix this issue:</p>
<pre>
commit 77d7fa989f79f3c2cb14d26576cbbb54b0637594
Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Date: Thu Aug 18 14:21:46 2016 -0400
Fix: perf counters build against kernel headers < 3.12
Copy Linux kernel perf_event.h installed headers into lttng-ust to know
the recent ABI layout, and use the bit description detailed in the
following Linux kernel commit:
https://github.com/torvalds/linux/commit/fa7315871046b9a4c48627905691dbde57e51033
to check whether the kernel supports rdpmc.
Fall-back on the perf read system call for kernels prior to 3.12,
because older kernels have an ABI bug where a union was used for both
cap_usr_time and cap_usr_rdpmc.
Ensure setup_perf set the pc pointer value before checking whether we
need to the file descriptor open or not.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
</pre> LTTng-UST - Bug #1053: lttng-ust doesn't build on Ubuntu 12.04https://bugs.lttng.org/issues/1053?journal_id=30882016-08-19T14:09:47ZSimon Marchisimon.marchi@polymtl.ca
<ul></ul><p>The build passed on launchpad, but I haven't tested the runtime.</p>
<p>Thanks!</p>