cyring / CoreFreq

CoreFreq : CPU monitoring and tuning software designed for 64-bit processors.
https://www.cyring.fr
GNU General Public License v2.0
1.94k stars 127 forks source link

Building on Almalinux 9 Redux #483

Closed fishbonesnl closed 2 months ago

fishbonesnl commented 2 months ago

Hello,

A few months ago I reported problems building on Almalinux 9, which were fixed.

I performed a kernel update and building CoreFreq breaks. I have downloaded the latest master and it still fails. Sorry to be a bother again.

The error message is as follows (home directory anonymised):

`In file included from ./include/linux/linkage.h:7, from ./include/linux/kernel.h:8, from ./include/linux/list.h:9, from ./include/linux/module.h:12, from /CoreFreq/build/module/corefreqk.c:18:

/CoreFreq/build/module/corefreqk.c: In function ‘CoreFreqK_Create_Device_Level_Up’: ./include/linux/export.h:17:22: error: passing argument 1 of ‘class_create’ from incompatible pointer type [-Werror=incompatible-pointer-types] 17 | #define THIS_MODULE (&__this_module) | ~^~~~~~~~~~~~~~~ | | | struct module * /CoreFreq/build/module/corefreqk.c:23685:41: note: in expansion of macro ‘THIS_MODULE’ 23685 | CoreFreqK.clsdev = class_create(THIS_MODULE, DRV_DEVNAME); | ^~~~~~~~~~~ compilation terminated due to -Wfatal-errors. cc1: some warnings being treated as errors make[2]: *** [scripts/Makefile.build:299: /CoreFreq/build/module/corefreqk.o] Error 1 make[1]: *** [Makefile:1934:/CoreFreq/build] Error 2 make[1]: Leaving directory '/usr/src/kernels/5.14.0-427.16.1.el9_4.x86_64' make: *** [Makefile:102: all] Error 2` uname -a `Linux 5.14.0-427.16.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 9 18:15:59 EDT 2024 x86_64 x86_64 x86_64 GNU/Linux` Any ideas what's going on?
cyring commented 2 months ago

Hello,

I'm downloading this version AlmaLinux OS 9.4 DVD ISO to try building into a VM.

Is it the concerned version ?

fishbonesnl commented 2 months ago

Yes, my version is 9.4. The kernel version is the latest one (updated today via dnf update).

cyring commented 2 months ago

Commit 7aa4aa6d9c8abe9a529feb53bc2706287e7ec428 in branch develop should fix the issue.

Can you please give it a try ?

fishbonesnl commented 2 months ago

I confirm that it builds as intended and that it runs.

Many thanks!

cyring commented 2 months ago

Stay tune, I have to fix other Linux 6.9 conflicts and will merge into master soon.

cyring commented 2 months ago

Merged into master. You can can close your issue.

cyring commented 2 months ago

I'm adding a build and run documentation for AlmaLinux https://github.com/cyring/CoreFreq/tree/develop?tab=readme-ov-file#almalinux

I however had this (non blocking) BTF issue during build and installation

make clean
make -j

2024-05-14-203842_676x539_scrot

sudo make install

2024-05-14-204024_673x533_scrot

Any idea how to fix it in Alma ?

fishbonesnl commented 2 months ago

I don't have this issue on Almalinux, but I have it on Ubuntu, and all I remember is that it has to do with where the code expects the kernel image to be located. See here

BTF issue

Also, I never use sudo in Almalinux. I always change user to root with su - and then execute the commands as root.

And one more thing: instead of modprobe corefreqk I do insmod corefreqk.ko But I'll try your method next.