hamadmarri / TT-CPU-Scheduler

Task Type (TT) is an alternative CPU Scheduler for linux.
107 stars 12 forks source link

error: implicit declaration of function ‘printk_deferred_once’ #7

Closed RiverOnVenus closed 2 years ago

RiverOnVenus commented 2 years ago

Hi, Hamad. When I compiled with the latest patch tt-5.15-r2 I encountered the following error.

  CC      kernel/sched/bs.o
In file included from kernel/sched/bs.c:9:
kernel/sched/tt_stats.h: In function ‘check_schedstat_required’:
kernel/sched/tt_stats.h:794:17: error: implicit declaration of function ‘printk_deferred_once’ [-Werror=implicit-function-declaration]
  794 |                 printk_deferred_once("Scheduler tracepoints stat_sleep, stat_iowait, "
      |                 ^~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:277: kernel/sched/bs.o] Error 1
make[1]: *** [scripts/Makefile.build:540: kernel/sched] Error 2
make: *** [Makefile:1868: kernel] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

I see it on line 5313 of the latest commit.

hamadmarri commented 2 years ago

Hi @RiverOnVenus

Could you please attach the .config

RiverOnVenus commented 2 years ago

Sorry, I just forgot to attach my kernel config file. config.zip

RiverOnVenus commented 2 years ago

@hamadmarri

I just found out that this error only occurs when I use both the patch-5.15.2-rt19.patch and the tt-5.15-r2.patch. No problems with TT on its own。 patch-5.15.2-rt19.zip

hamadmarri commented 2 years ago

Could you please try this fix:

diff --git a/kernel/sched/tt_stats.h b/kernel/sched/tt_stats.h
index 7aa1e8936be4..c12f60830791 100644
--- a/kernel/sched/tt_stats.h
+++ b/kernel/sched/tt_stats.h
@@ -791,10 +791,7 @@ static inline void check_schedstat_required(void)
            trace_sched_stat_iowait_enabled()  ||
            trace_sched_stat_blocked_enabled() ||
            trace_sched_stat_runtime_enabled())  {
-       printk_deferred_once("Scheduler tracepoints stat_sleep, stat_iowait, "
-                "stat_blocked and stat_runtime require the "
-                "kernel parameter schedstats=enable or "
-                "kernel.sched_schedstats=1\n");
+       printk_once("Scheduler tracepoints stat_sleep, stat_iowait, stat_blocked and stat_runtime require the kernel parameter schedstats=enable or kernel.sched_schedstats=1\n");
    }
 #endif
 }

rt-fix.patch.zip

hamadmarri commented 2 years ago

@RiverOnVenus

I have updated the rt.patch too https://github.com/hamadmarri/TT-CPU-Scheduler/blob/04d6c8dcb2f6688621e49f458bb4451a00f43e27/patches/5.15/rt/rt.patch

RiverOnVenus commented 2 years ago

@hamadmarri

I'm a bit late in replying, it's working, thank you.