Closed mikealanni closed 1 month ago
I don't understand this issue.
Mainline function prototype within Linux 6.10
int (*exit)(struct cpufreq_policy *policy);
CoreFreq function prototype
static int CoreFreqK_Policy_Exit(struct cpufreq_policy *policy)
Still the same prototype as previous Linux versions.
Which distribution are you using ? Is your kernel patched ?
ArchLinux: build and boot the kernel 6.10.
No compilation issues encountered
cc -Wall -Wfatal-errors -pthread -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 -D ARCH_PMC=UMC \
-c x86_64/corefreqd.c -o build/corefreqd.o
cc -Wall -Wfatal-errors -pthread -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 -D ARCH_PMC=UMC \
-c x86_64/corefreqm.c -o build/corefreqm.o
cc -Wall -Wfatal-errors -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 -D ARCH_PMC=UMC \
-c x86_64/corefreq-cli.c -o build/corefreq-cli.o
cc -Wall -Wfatal-errors -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 -D ARCH_PMC=UMC \
-c x86_64/corefreq-ui.c -o build/corefreq-ui.o
cc -Wall -Wfatal-errors -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 -D ARCH_PMC=UMC \
-c x86_64/corefreq-cli-rsc.c -o build/corefreq-cli-rsc.o
cc -Wall -Wfatal-errors -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 -D ARCH_PMC=UMC \
-c x86_64/corefreq-cli-json.c -o build/corefreq-cli-json.o
cc -Wall -Wfatal-errors -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 -D ARCH_PMC=UMC \
-c x86_64/corefreq-cli-extra.c -o build/corefreq-cli-extra.o
cc -o build/corefreqd \
build/corefreqd.o build/corefreqm.o -lpthread -lm -lrt -lc
cc -o build/corefreq-cli \
build/corefreq-cli.o build/corefreq-ui.o \
build/corefreq-cli-rsc.o build/corefreq-cli-json.o \
build/corefreq-cli-extra.o -lm -lrt -lc
make[1]: Entering directory '/usr/lib/modules/6.10.0-arch1-1/build'
CC [M] CoreFreq/build/module/corefreqk.o
LD [M] CoreFreq/build/corefreqk.o
MODPOST CoreFreq/build/Module.symvers
CC [M] CoreFreq/build/corefreqk.mod.o
LD [M] CoreFreq/build/corefreqk.ko
BTF [M] CoreFreq/build/corefreqk.ko
make[1]: Leaving directory '/usr/lib/modules/6.10.0-arch1-1/build'
Ubuntu 22.04, no extra kernel patch, just downloaded the source, compiled it and installed it
Ubuntu 22.04, no extra kernel patch, just downloaded the source, compiled it and installed it
Link to the kernel source code please ?
ChatGPT offered to change static init to static void and remove the return line and add &
to the line 510 .exit = &CoreFreqK_Policy_Exit
.
That's fixed the issue but I have no clue what is it and will that affect the app
ChatGPT offered to change static init to static void and remove the return line and add
&
to the line 510.exit = &CoreFreqK_Policy_Exit
.That's fixed the issue but I have no clue what is it and will that affect the app
Sure. But why are you having a Linux source code apparently not official ?
Oh didn't know that. Sorry not expert but I got Linus git
Oh didn't know that. Sorry not expert but I got Linus git
From here ? https://kernel.org/
I did git clone to this git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git a while back then I did git pull and build it. I'm doing something wrong?
There is only one prototype in kernel.org so far and up to to 6.10
int (*exit)(struct cpufreq_policy *policy);
I did git clone to this git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git a while back then I did git pull and build it. I'm doing something wrong?
Since kernel 3.0
that exit
function within structure cpufreq_driver
has not changed!
Make sur to clean everything up
Clone again Linux kernel 6.10
and build it by hand:
make distclean
and make clean
before your make defconfig
Clone latest CoreFreq version:
corefreqk.ko corefreqd corefreq-cli
make -j clean
make -j
insmod build/corefreqk.ko
./build/corefreqd -q &
./buid/corefreq-cli
Wait a minute; I found that major change in github.com/torvalds
struct cpufreq_driver {
...
void (*exit)(struct cpufreq_policy *policy);
...
};
And here's the root cause https://github.com/torvalds/linux/commit/b4b1ddc9dfe997a5f492fa3a36487f8e7a5de30d
Until I'm committing a change you can fix source code by yourself as below
CoreFreqK_Policy_Exit
function in x86_64/corefreqk.c
fileand replace with:
static void CoreFreqK_Policy_Exit(struct cpufreq_policy *policy)
{
UNUSED(policy);
}
x86_64/corefreqk.h
and replace with
static void CoreFreqK_Policy_Exit(struct cpufreq_policy *policy) ;
make -j clean
make -j
insmod build/corefreqk.ko
./build/corefreqd
./build/corefreq-cli
Man I just want to thank for your fast response, will try it and feedback
It is working now, and I think this the same I did earlier when chatgpt asks about change int to void and remove return line. don't know that AI do these things tho 😅
@mikealanni Hello,
Fix is now available in commit 0db6f0a18d3b03a26287fd30d27bb3fd24a2a3c2
Hi was trying to rebuild from the source and I'm getting this Error after kernel 6.10 install
make -j8 cc -Wall -Wfatal-errors -pthread -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 \ -c x86_64/corefreqd.c -o build/corefreqd.o cc -Wall -Wfatal-errors -pthread -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 \ -c x86_64/corefreqm.c -o build/corefreqm.o cc -Wall -Wfatal-errors -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 \ -c x86_64/corefreq-cli.c -o build/corefreq-cli.o cc -Wall -Wfatal-errors -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 \ -c x86_64/corefreq-ui.c -o build/corefreq-ui.o cc -Wall -Wfatal-errors -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 \ -c x86_64/corefreq-cli-rsc.c -o build/corefreq-cli-rsc.o cc -Wall -Wfatal-errors -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 \ -c x86_64/corefreq-cli-json.c -o build/corefreq-cli-json.o cc -Wall -Wfatal-errors -D CORE_COUNT=256 -D TASK_ORDER=5 -D MAX_FREQ_HZ=7125000000 -D UBENCH=0 -D DELAY_TSC=1 \ -c x86_64/corefreq-cli-extra.c -o build/corefreq-cli-extra.o cc -o build/corefreqd \ build/corefreqd.o build/corefreqm.o -lpthread -lm -lrt -lc cc -o build/corefreq-cli \ build/corefreq-cli.o build/corefreq-ui.o \ build/corefreq-cli-rsc.o build/corefreq-cli-json.o \ build/corefreq-cli-extra.o -lm -lrt -lc make[1]: Entering directory '/home/majed/linux' CC [M] /home/majed/CoreFreq/build/module/corefreqk.o /home/majed/CoreFreq/build/module/corefreqk.c:510:35: error: initialization of ‘void (*)(struct cpufreq_policy *)’ from incompatible pointer type ‘int (*)(struct cpufreq_policy *)’ [-Werror=incompatible-pointer-types] 510 | .exit = CoreFreqK_Policy_Exit, | ^~~~~~~~~~~~~~~~~~~~~ compilation terminated due to -Wfatal-errors. cc1: some warnings being treated as errors make[3]: *** [scripts/Makefile.build:244: /home/majed/CoreFreq/build/module/corefreqk.o] Error 1 make[2]: *** [/home/majed/linux/Makefile:1934: /home/majed/CoreFreq/build] Error 2 make[1]: *** [Makefile:240: __sub-make] Error 2 make[1]: Leaving directory '/home/majed/linux' make: *** [Makefile:110: all] Error 2