Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#56160 - [collectd] turbostat plugin missing again

Attached to Project: Community Packages
Opened by Ralf Barth (Haggy) - Monday, 30 October 2017, 03:24 GMT
Last edited by Gaetan Bisson (vesath) - Friday, 10 November 2017, 00:22 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Gaetan Bisson (vesath)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
It's missing again since the last update.

Please see/reopen:  FS#55546 
Last time, a clean rebuild did the trick.

Additional info:
* package version(s)
collectd 5.7.2-5
This task depends upon

Closed by  Gaetan Bisson (vesath)
Friday, 10 November 2017, 00:22 GMT
Reason for closing:  Fixed
Additional comments about closing:  5.7.2-6 in [community]
Comment by Gaetan Bisson (vesath) - Monday, 30 October 2017, 06:18 GMT
A clean rebuild doesn't fix the issue this time. It seems like collectd now needs some files from linux-headers at compile time to enable turbostat. Cheers.
Comment by Gaetan Bisson (vesath) - Monday, 30 October 2017, 06:43 GMT
So turbostat needs cpuid.h and asm/msr-index.h which collectd's configure expects to find in the default include directories... That is quite annoying. Either we add -I/usr/lib/modules/4.13.9-1-ARCH/build/include/config/x86/ and -I/usr/lib/modules/4.13.9-1-ARCH/build/arch/x86/include/ to our CPPFLAGS (those dirs would then be used for all of collectd's compilation, yurk) or we manually edit src/turbostat.c to adjust the paths inside the #include. I think I'm going to go with the second option but it's really ugly. If you really want this plugin, could you contact upstream and ask them if they could come up with a nicer way to find those files? Perhaps a configure switch where we could give the location of said files, like `--with-kernel-config-include=/usr/lib/modules/4.13.9-1-ARCH/build/include/config/x86/`? Cheers.
Comment by Ralf Barth (Haggy) - Monday, 30 October 2017, 06:51 GMT Comment by Gaetan Bisson (vesath) - Monday, 30 October 2017, 07:24 GMT
So adding those additional include paths to our CPPFLAGS allows collectd to compile a turbostat module but it fails to load...
Can you please see if you manage to build a working turbostat on your system and send me proposed PKGBUILD changes when you do?
Cheers.
Comment by Gaetan Bisson (vesath) - Monday, 30 October 2017, 07:28 GMT
For the record, I'm attaching the PKGBUILD which compils a turbostat module. Below is the error I get when try to load that module:

collectd: lt_dlopen ("/usr/lib/collectd/turbostat.so") failed: file not found. The most common cause for this problem is missing dependencies. Use ldd(1) to check the dependencies of the plugin / shared object.
collectd: plugin_load: Load plugin "turbostat" failed with status 1.
Comment by Ralf Barth (Haggy) - Thursday, 09 November 2017, 14:06 GMT
Fixed it, please see attached patch against your PKGBUILD.

Reason: Fixing the path of cpuid.h with the added sed, pointed the turbostat module to an empty (0 byte) kernel header file (at least as of 4.13.9 on x86_64). This led to compilation warnings about undefined function calls (implicit function declaration) of __get_cpuid(). This function is defined in cpuid.h, but the file is empty, hence no function declaration. While the module compiled with warnings, it was broken and refused to load in collectd. Removing the cpuid.h fix from your sed line made the module compile and load fine afterwards. Now it's using cpuid.h from default gcc header location (/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/include/cpuid.h) which declares all used functions.

On a sidenote: any idea why /usr/lib/modules/4.13.9-1-ARCH/build/include/config/x86/cpuid.h is an empty file?
Comment by Gaetan Bisson (vesath) - Thursday, 09 November 2017, 16:25 GMT
Thanks. I'll push an updated package to [community] in a few minutes. Could you also contact upstream and ask them for a nice way to specify the header paths? The sed we're doing right now is quite ugly... Perhaps a configure switch like this:

./configure --linux-headers-path=/usr/lib/modules/4.13.11-1-ARCH/build/

Cheers.
Comment by Ralf Barth (Haggy) - Thursday, 09 November 2017, 22:34 GMT
Thanks! I already asked upstream to include such a switch in https://github.com/collectd/collectd/issues/2511.

Loading...