From a2514adbda2b159a730d883cb0c7ce68fe6aa2d2 Mon Sep 17 00:00:00 2001 From: Yihao Wu Date: Wed, 15 Jun 2022 13:04:53 +0800 Subject: [PATCH 1/3] cli: optimize logging for better user experience `make` command always generate thousands of lines of output. But all output was wrapped by python sh module. In order to debug more easily. We print the original output on the screen. Signed-off-by: Yihao Wu --- cli.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli.py b/cli.py index 19c2592..3bc0d80 100755 --- a/cli.py +++ b/cli.py @@ -140,7 +140,9 @@ class Plugsched(object): 'objs=%s' % ' '.join(objs), *['%s=%s' % i for i in kwargs.items()], file=os.path.join(self.tmp_dir, 'Makefile.plugsched'), - jobs=self.threads) + jobs=self.threads, + _out=sys.stdout, + _err=sys.stderr) def fix_up(self): self.mod_sh.sed("s/#include \"/#include \"..\//g;" + \ -- Gitee From 2ed82330e061468cf4a137e47932eaeab6107034 Mon Sep 17 00:00:00 2001 From: Yihao Wu Date: Wed, 15 Jun 2022 13:08:06 +0800 Subject: [PATCH 2/3] src: fix the bug kernel modules don't inflect outsiders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For example, kvm calls yield_to. So unless yield_to is assigned by the user as an interface function, it should be infected. Apart from yield_to, there are mcryptd、idle_inject、intel_powerclamp, that have the similar problems. Before this bugfix, once user modifiese the following functions, potential bugs arise. - preempt_notifier_inc - preempt_notifier_dec - preempt_notifier_register - preempt_notifier_unregister - preempt_count_add - preempt_count_sub - yield_to - single_task_running - play_idle Signed-off-by: Yihao Wu --- src/Makefile.plugsched | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Makefile.plugsched b/src/Makefile.plugsched index 4825438..80834be 100644 --- a/src/Makefile.plugsched +++ b/src/Makefile.plugsched @@ -11,16 +11,16 @@ GCC_PLUGIN_FLAGS := -fplugin=/usr/lib64/gcc-python-plugin/python.so \ PHONY += plugsched sidecar collect extract -collect: CFLAGS_KERNEL = $(GCC_PLUGIN_FLAGS)collect -extract: CFLAGS_KERNEL = $(GCC_PLUGIN_FLAGS)extract - plugsched: scripts prepare sidecar $(MAKE) CFLAGS_MODULE=-fkeep-static-functions -C $(srctree) M=$(plugsched_modpath) modules sidecar: $(plugsched_modpath)/export_jump_sidecar.h python2 $(plugsched_tmpdir)/sidecar.py $< ./vmlinux $(plugsched_tmpdir) $(plugsched_modpath) -collect: $(core-y) $(core-m) $(drivers-y) $(drivers-m) $(net-y) $(net-m) $(virt-y) +collect: + $(MAKE) CFLAGS_KERNEL="$(GCC_PLUGIN_FLAGS)collect" \ + CFLAGS_MODULE="$(GCC_PLUGIN_FLAGS)collect" analyze: python2 $(plugsched_tmpdir)/process.py ./vmlinux $(plugsched_tmpdir) $(plugsched_modpath) extract: $(objs) + $(MAKE) CFLAGS_KERNEL="$(GCC_PLUGIN_FLAGS)extract" $(objs) -- Gitee From 4f64c64fe449f10c07d70abcea07b415294a1da5 Mon Sep 17 00:00:00 2001 From: Yihao Wu Date: Wed, 15 Jun 2022 13:11:10 +0800 Subject: [PATCH 3/3] config: add yield_to as an interface function Since the previous bugfix, yield_to was inflected as an outsider. So this patch adds it back to the scheduler boundary by adding it as an interface function. Signed-off-by: Yihao Wu --- configs/4.19/sched_boundary.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/4.19/sched_boundary.yaml b/configs/4.19/sched_boundary.yaml index d93af55..73ddebf 100644 --- a/configs/4.19/sched_boundary.yaml +++ b/configs/4.19/sched_boundary.yaml @@ -30,6 +30,7 @@ interface_prefix: - __arm64_compat_sys_ function: interface: + - yield_to - wake_up_idle_ht - __balance_callback - do_set_cpus_allowed -- Gitee