aliyun / plugsched

Live upgrade Linux kernel scheduler subsystem
BSD 3-Clause "New" or "Revised" License
82 stars 23 forks source link

Some errors about running plugsched in nvidia agx xavier #215

Open HaochunLiang opened 1 year ago

HaochunLiang commented 1 year ago

I want to run plugsched in agx xavier.

[root@0d0115fb895f kernel]# uname -a Linux 0d0115fb895f 4.9.140-tegra #1 SMP PREEMPT Mon Apr 24 16:28:32 CST 2023 aarch64 aarch64 aarch64 GNU/Linux

I write the config file as follows:

mod_files:

The kernel source code has been compiled successfully.

However, when i run the cmd: plugsched-cli dev_init /home/neu/workplace/work/newwork/kernel/kernel-4.9/ ./scheduler It shows the errors: make: *** [/home/neu/workplace/work/newwork/kernel/scheduler/working/Makefile.plugsched:16: collect] Error 2 Traceback (most recent call last): File "/usr/local/bin/plugsched-cli", line 303, in plugsched.cmd_init(kernel_src, sym_vers, kernel_config) File "/usr/local/bin/plugsched-cli", line 192, in cmd_init self.extract() File "/usr/local/bin/plugsched-cli", line 159, in extract self.make(stage = 'collect', plugsched_tmpdir = self.tmp_dir, plugsched_modpath = self.mod_path) File "/usr/local/bin/plugsched-cli", line 154, in make _err=sys.stderr) File "/usr/lib/python3.6/site-packages/sh.py", line 1427, in call return RunningCommand(cmd, call_args, stdin, stdout, stderr) File "/usr/lib/python3.6/site-packages/sh.py", line 774, in init self.wait() File "/usr/lib/python3.6/site-packages/sh.py", line 792, in wait self.handle_command_exit_code(exit_code) File "/usr/lib/python3.6/site-packages/sh.py", line 815, in handle_command_exit_code raise exc sh.ErrorReturnCode_2:

RAN: /usr/bin/make collect objs= plugsched_tmpdir=/home/neu/workplace/work/newwork/kernel/scheduler/working/ plugsched_modpath=/home/neu/workplace/work/newwork/kernel/scheduler/kernel/sched/mod/ --file=/home/neu/workplace/work/newwork/kernel/scheduler/working/Makefile.plugsched --jobs=4

STDOUT:

STDERR:

dtcccc commented 1 year ago

It seems no useful infomation...

Could you try run:

/usr/bin/make collect objs= plugsched_tmpdir=/home/neu/workplace/work/newwork/kernel/scheduler/working/ plugsched_modpath=/home/neu/workplace/work/newwork/kernel/scheduler/kernel/sched/mod/ --file=/home/neu/workplace/work/newwork/kernel/scheduler/working/Makefile.plugsched

directly to see the result?

HaochunLiang commented 1 year ago

Hi,

When I run the command: /usr/bin/make collect objs= plugsched_tmpdir=/home/neu/workplace/work/newwork/kernel/scheduler/working/ plugsched_modpath=/home/neu/workplace/work/newwork/kernel/scheduler/kernel/sched/mod/ --file=/home/neu/workplace/work/newwork/kernel/scheduler/working/Makefile.plugsched

The information is shown in the following: [root@96d2615dad78 newwork]# /usr/bin/make collect objs= plugsched_tmpdir=/home/neu/workplace/work/newwork/kernel/scheduler/working/ plugsched_modpath=/home/neu/workplace/work/newwork/kernel/scheduler/kernel/sched/mod/ --file=/home/neu/workplace/work/newwork/kernel/scheduler/working/Makefile.plugsched make: /home/neu/workplace/work/newwork/kernel/scheduler/working/Makefile.plugsched: No such file or directory make: *** No rule to make target '/home/neu/workplace/work/newwork/kernel/scheduler/working/Makefile.plugsched'. Stop.

I visited the directory /home/neu/workplace/work/newwork/scheduler/working/ and found that the file Makefile.plugsched was not generated.

dtcccc commented 1 year ago

How do you use plugsched? Have you tried with latest plugsched or docker image? Makefile.plugsched should be copied to scheduler/working/ from src/Makefile.plugsched at a very early time (during "init" or "dev_init", before "make collect")...

HaochunLiang commented 1 year ago

I use plugsched with this command: docker pull plugsched-registry.cn-hangzhou.cr.aliyuncs.com/plugsched/plugsched-sdk. Is this the latest plugsched?

[root@96d2615dad78 newwork]# cd scheduler/working/ [root@96d2615dad78 working]# ls Makefile.plugsched analyze.py collect.py hotfix_conflict_check scheduler-installer springboard_search.sh version init.py boundary.yaml extract.py plugsched.service scheduler.spec symbol_resolve

I recheck this folder, the Makefile.plugsched is exist. But when I run this command: /usr/bin/make collect objs= plugsched_tmpdir=/home/neu/workplace/work/newwork/kernel/scheduler/working/ plugsched_modpath=/home/neu/workplace/work/newwork/kernel/scheduler/kernel/sched/mod/ --file=/home/neu/workplace/work/newwork/kernel/scheduler/working/Makefile.plugsched

It still prompts that there is no file Makefile.plugsched。

dtcccc commented 1 year ago

I use plugsched with this command: docker pull plugsched-registry.cn-hangzhou.cr.aliyuncs.com/plugsched/plugsched-sdk. Is this the latest plugsched?

yes

[root@96d2615dad78 newwork]# cd scheduler/working/ [root@96d2615dad78 working]# ls Makefile.plugsched analyze.py collect.py hotfix_conflict_check scheduler-installer springboard_search.sh version init.py boundary.yaml extract.py plugsched.service scheduler.spec symbol_resolve

I recheck this folder, the Makefile.plugsched is exist. But when I run this command: /usr/bin/make collect objs= plugsched_tmpdir=/home/neu/workplace/work/newwork/kernel/scheduler/working/ plugsched_modpath=/home/neu/workplace/work/newwork/kernel/scheduler/kernel/sched/mod/ --file=/home/neu/workplace/work/newwork/kernel/scheduler/working/Makefile.plugsched

It still prompts that there is no file Makefile.plugsched。

Are you sure to run this command under /home/neu/workplace/work/newwork/kernel/scheduler/ path exactly?

dtcccc commented 1 year ago

[root@96d2615dad78 newwork]# cd scheduler/working/ [root@96d2615dad78 working]# ls Makefile.plugsched analyze.py collect.py hotfix_conflict_check scheduler-installer springboard_search.sh version init.py boundary.yaml extract.py plugsched.service scheduler.spec symbol_resolve

wait... It seems Makefile.plugsched is in newwork/scheduler/working/ not newwork/kernel/scheduler/working/, right?

I'm a bit confused with your dir...

HaochunLiang commented 1 year ago

I'm sorry, there was an error in my previous command.

The Makefile.plugsched is exist in the dir: /home/neu/workplace/work/newwork/scheduler/working/

When I run the command: /usr/bin/make collect objs= plugsched_tmpdir=/home/neu/workplace/work/newwork/scheduler/working/ plugsched_modpath=/home/neu/workplace/work/newwork/scheduler/kernel/sched/mod/ --file=/home/neu/workplace/work/newwork/scheduler/working/Makefile.plugsched --jobs=4

It shows the reply: /home/neu/workplace/work/newwork/scheduler/working/Makefile.plugsched:4: Makefile: No such file or directory make: *** No rule to make target 'Makefile'. Stop.

dtcccc commented 1 year ago

ok, then you should cd /home/neu/workplace/work/newwork/scheduler/

and then run this command (after you dev_init failed)

HaochunLiang commented 1 year ago

After I cd /home/neu/workplace/work/newwork/scheduler/ and run this command. It show the follow information:

[root@96d2615dad78 scheduler]# /usr/bin/make collect objs= plugsched_tmpdir=/home/neu/workplace/work/newwork/scheduler/working/ plugsched_modpath=/home/neu/workplace/work/newwork/scheduler/kernel/sched/mod/ --file=/home/neu/workplace/work/newwork/scheduler/working/Makefile.plugsched --jobs=4 CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CC scripts/mod/empty.o CC scripts/mod/devicetable-offsets.s MKELF scripts/mod/elfconfig.h HOSTCC scripts/mod/modpost.o HOSTCC scripts/mod/sumversion.o CHK scripts/mod/devicetable-offsets.h HOSTCC scripts/mod/file2alias.o HOSTLD scripts/mod/modpost CHK include/generated/timeconst.h CC kernel/bounds.s CHK include/generated/bounds.h CC arch/arm64/kernel/asm-offsets.s CHK include/generated/asm-offsets.h CALL scripts/checksyscalls.sh /usr/bin/make CFLAGS_KERNEL="-fplugin=/usr/lib64/gcc-python-plugin/python.so -fplugin-arg-python-script=/home/neu/workplace/work/newwork/scheduler/working//collect.py -fplugin-arg-python-tmpdir=/home/neu/workplace/work/newwork/scheduler/working/" \ CFLAGS_MODULE="-fplugin=/usr/lib64/gcc-python-plugin/python.so -fplugin-arg-python-script=/home/neu/workplace/work/newwork/scheduler/working//collect.py -fplugin-arg-python-tmpdir=/home/neu/workplace/work/newwork/scheduler/working/" init usr arch/arm64/kernel arch/arm64/mm arch/arm64/net arch/arm64/crypto kernel certs mm fs ipc security crypto block drivers sound firmware net arch/arm64/lib lib virt CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CC scripts/mod/empty.o CC scripts/mod/devicetable-offsets.s CHK include/generated/timeconst.h CC kernel/bounds.s ... CC fs/9p/vfs_dir.o CC mm/swap_cgroup.o In file included from ./include/linux/sctp.h:57, from security/lsm_audit.c:31: ./include/uapi/linux/sctp.h:331:1: warning: alignment 4 of 'struct sctp_paddr_change' is less than 8 [-Wpacked-not-aligned] } attribute((packed, aligned(4))); ^ ./include/uapi/linux/sctp.h:605:1: warning: alignment 4 of 'struct sctp_setpeerprim' is less than 8 [-Wpacked-not-aligned] } attribute((packed, aligned(4))); ^ ./include/uapi/linux/sctp.h:604:26: warning: 'sspp_addr' offset 4 in 'struct sctp_setpeerprim' isn't aligned to 8 [-Wpacked-not-aligned] struct sockaddr_storage sspp_addr; ^~~~~ ./include/uapi/linux/sctp.h:618:1: warning: alignment 4 of 'struct sctp_prim' is less than 8 [-Wpacked-not-aligned] } attribute((packed, aligned(4))); ^ ./include/uapi/linux/sctp.h:617:26: warning: 'ssp_addr' offset 4 in 'struct sctp_prim' isn't aligned to 8 [-Wpacked-not-aligned] struct sockaddr_storage ssp_addr; ^~~~ ./include/uapi/linux/sctp.h:665:1: warning: alignment 4 of 'struct sctp_paddrparams' is less than 8 [-Wpacked-not-aligned] } attribute((packed, aligned(4))); ^ ./include/uapi/linux/sctp.h:659:26: warning: 'spp_address' offset 4 in 'struct sctp_paddrparams' isn't aligned to 8 [-Wpacked-not-aligned] struct sockaddr_storage spp_address; ^~~ ./include/uapi/linux/sctp.h:772:1: warning: alignment 4 of 'struct sctp_paddrinfo' is less than 8 [-Wpacked-not-aligned] } attribute((packed, aligned(4))); ^ ./include/uapi/linux/sctp.h:766:26: warning: 'spinfo_address' offset 4 in 'struct sctp_paddrinfo' isn't aligned to 8 [-Wpacked-not-aligned] struct sockaddr_storage spinfo_address; ^~~~~~ CC security/device_cgroup.o CC fs/9p/vfs_dentry.o CC mm/hugetlb_cgroup.o CC fs/9p/v9fs.o ... CC kernel/printk/printk_safe.o kernel/printk/printk.c: In function 'control_devkmsg': kernel/printk/printk.c:138:3: warning: 'strncpy' output truncated before terminating nul copying 2 bytes from a string of the same length [-Wstringop-truncation] strncpy(devkmsg_log_str, "on", 2); ^~~~~~~~~ kernel/printk/printk.c:141:3: warning: 'strncpy' output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation] strncpy(devkmsg_log_str, "off", 3); ^~~~~~~~~~ CC block/bio.o CC crypto/ecdh.o CC crypto/ecdh_helper.o .... CC fs/ext4/extents.o In file included from ./include/trace/define_trace.h:95, from ./include/trace/events/sched.h:1113, from kernel/sched/core.c:94: ./include/trace/events/sched.h: In function 'trace_raw_output_sched_load_avg_task': ./include/trace/events/sched.h:666:12: warning: format '%lu' expects argument of type 'long unsigned int', but argument 10 has type 'u32' {aka 'unsigned int'} [-Wformat=] TP_printk("comm=%s pid=%d cpu=%d load_avg=%lu util_avg=%lu util_fast_avg=%lu" ^~~~~~~~~~~~~~~ ./include/trace/trace_events.h:327:22: note: in definition of macro 'DECLARE_EVENT_CLASS' trace_seq_printf(s, print); \ ^~~~~ ./include/trace/trace_events.h:65:9: note: in expansion of macro 'PARAMS' PARAMS(print)); \ ^~ ./include/trace/events/sched.h:626:1: note: in expansion of macro 'TRACE_EVENT' TRACE_EVENT(sched_load_avg_task, ^~~ ./include/trace/events/sched.h:666:2: note: in expansion of macro 'TP_printk' TP_printk("comm=%s pid=%d cpu=%d load_avg=%lu util_avg=%lu util_fast_avg=%lu" ^~~~~ In file included from ./include/trace/trace_events.h:361, from ./include/trace/define_trace.h:95, from ./include/trace/events/sched.h:1113, from kernel/sched/core.c:94: ./include/trace/events/sched.h:667:39: note: format string is defined here "util_avg_pelt=%lu util_avg_walt=%lu load_sum=%llu" ~~^ %u In file included from ./include/trace/define_trace.h:95, from ./include/trace/events/sched.h:1113, from kernel/sched/core.c:94: ./include/trace/events/sched.h: In function 'trace_raw_output_sched_load_avg_cpu': ./include/trace/events/sched.h:715:12: warning: format '%lu' expects argument of type 'long unsigned int', but argument 8 has type 'u32' {aka 'unsigned int'} [-Wformat=] TP_printk("cpu=%d load_avg=%lu util_avg=%lu util_fast_avg=%lu " ^~~~~~~~~~~~~ ./include/trace/trace_events.h:327:22: note: in definition of macro 'DECLARE_EVENT_CLASS' trace_seq_printf(s, print); \ ^~~~~ ./include/trace/trace_events.h:65:9: note: in expansion of macro 'PARAMS' PARAMS(print)); \ ^~ ./include/trace/events/sched.h:685:1: note: in expansion of macro 'TRACE_EVENT' TRACE_EVENT(sched_load_avg_cpu, ^~~ ./include/trace/events/sched.h:715:2: note: in expansion of macro 'TP_printk' TP_printk("cpu=%d load_avg=%lu util_avg=%lu util_fast_avg=%lu " ^~~~~ In file included from ./include/trace/trace_events.h:361, from ./include/trace/define_trace.h:95, from ./include/trace/events/sched.h:1113, from kernel/sched/core.c:94: ./include/trace/events/sched.h:716:41: note: format string is defined here "util_avg_pelt=%lu util_avg_walt=%lu", ~~^ %u CC crypto/crypto_null.o CC block/blk-sysfs.o CC crypto/sha1_generic.o CC block/blk-flush.o CC crypto/sha256_generic.o CC block/blk-settings.o ... CC fs/kernfs/symlink.o In function 'kernfs_get_target_path', inlined from 'kernfs_getlink.isra.0' at fs/kernfs/symlink.c:109:10, inlined from 'kernfs_iop_get_link.part.1' at fs/kernfs/symlink.c:127:10, inlined from 'kernfs_iop_get_link' at fs/kernfs/symlink.c:115:20: fs/kernfs/symlink.c:91:3: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] strncpy(s + len, kn->name, slen); ^~~~~~~~ fs/kernfs/symlink.c: In function 'kernfs_iop_get_link': fs/kernfs/symlink.c:88:14: note: length computed here int slen = strlen(kn->name); ^~~~ LD fs/kernfs/built-in.o ... CC drivers/base/regmap/regcache-rbtree.o drivers/base/regmap/regcache-rbtree.c:36:1: error: alignment 1 of 'struct regcache_rbtree_node' is less than 8 [-Werror=packed-not-aligned] } attribute ((packed)); ^ CC fs/nfs/nfs3client.o cc1: all warnings being treated as errors make[4]: [scripts/Makefile.build:335: drivers/base/regmap/regcache-rbtree.o] Error 1 make[3]: [scripts/Makefile.build:649: drivers/base/regmap] Error 2 make[2]: [scripts/Makefile.build:649: drivers/base] Error 2 make[1]: [Makefile:1104: drivers] Error 2 make[1]: ** Waiting for unfinished jobs.... CC fs/nfs/nfs3proc.o CC sound/core/memory.o ... CC fs/notify/group.o kernel/watchdog_hld.c:35:22: warning: 'hardlockup_allcpu_dumped' defined but not used [-Wunused-variable] static unsigned long hardlockup_allcpu_dumped; ^~~~~~~~ In file included from ./include/asm-generic/percpu.h:6, from ./arch/arm64/include/asm/percpu.h:277, from ./arch/arm64/include/asm/smp.h:32, from ./include/linux/smp.h:59, from ./include/linux/percpu.h:6, from ./arch/arm64/include/asm/mmu.h:25, from ./include/linux/mm_types.h:17, from ./include/linux/sched.h:27, from ./include/linux/nmi.h:7, from kernel/watchdog_hld.c:14: kernel/watchdog_hld.c:22:44: warning: 'watchdog_ev' defined but not used [-Wunused-variable] static DEFINE_PER_CPU(struct perf_event , watchdog_ev); ^~~ ./include/linux/percpu-defs.h:111:19: note: in definition of macro 'DEFINE_PER_CPU_SECTION' typeof(type) name ^~~~ kernel/watchdog_hld.c:22:8: note: in expansion of macro 'DEFINE_PER_CPU' static DEFINE_PER_CPU(struct perf_event *, watchdog_ev); ^~~~~~ CC fs/ntfs/aops.o CC sound/core/ctljack.o ... CC kernel/membarrier.o CC fs/proc/base.o CC kernel/memremap.o kernel/memremap.c:176: warning: "SECTION_MASK" redefined

define SECTION_MASK ~((1UL << PA_SECTION_SHIFT) - 1)

In file included from ./arch/arm64/include/asm/processor.h:43, from ./arch/arm64/include/asm/spinlock.h:21, from ./include/linux/spinlock.h:87, from ./include/linux/rcupdate.h:38, from ./include/linux/radix-tree.h:29, from kernel/memremap.c:13: ./arch/arm64/include/asm/pgtable-hwdef.h:88: note: this is the location of the previous definition

define SECTION_MASK (~(SECTION_SIZE-1))

kernel/memremap.c:177: warning: "SECTION_SIZE" redefined

define SECTION_SIZE (1UL << PA_SECTION_SHIFT)

In file included from ./arch/arm64/include/asm/processor.h:43, from ./arch/arm64/include/asm/spinlock.h:21, from ./include/linux/spinlock.h:87, from ./include/linux/rcupdate.h:38, from ./include/linux/radix-tree.h:29, from kernel/memremap.c:13: ./arch/arm64/include/asm/pgtable-hwdef.h:87: note: this is the location of the previous definition

define SECTION_SIZE (_AC(1, UL) << SECTION_SHIFT)

CC fs/ntfs/mft.o CC sound/core/pcm_lib.o kernel/memremap.c:176: warning: "SECTION_MASK" redefined

define SECTION_MASK ~((1UL << PA_SECTION_SHIFT) - 1)

In file included from ./arch/arm64/include/asm/processor.h:43, from ./arch/arm64/include/asm/spinlock.h:21, from ./include/linux/spinlock.h:87, from ./include/linux/rcupdate.h:38, from ./include/linux/radix-tree.h:29, from kernel/memremap.c:13: ./arch/arm64/include/asm/pgtable-hwdef.h:88: note: this is the location of the previous definition

define SECTION_MASK (~(SECTION_SIZE-1))

kernel/memremap.c:177: warning: "SECTION_SIZE" redefined

define SECTION_SIZE (1UL << PA_SECTION_SHIFT)

In file included from ./arch/arm64/include/asm/processor.h:43, from ./arch/arm64/include/asm/spinlock.h:21, from ./include/linux/spinlock.h:87, from ./include/linux/rcupdate.h:38, from ./include/linux/radix-tree.h:29, from kernel/memremap.c:13: ./arch/arm64/include/asm/pgtable-hwdef.h:87: note: this is the location of the previous definition

define SECTION_SIZE (_AC(1, UL) << SECTION_SHIFT)

CHK kernel/config_data.h UPD kernel/config_data.h CC kernel/configs.o ... CC sound/core/pcm_dmaengine.o fs/pstore/inode.c: In function 'pstore_unlink': fs/pstore/inode.c:178:6: warning: unused variable 'err' [-Wunused-variable] int err; ^~~ CC fs/ntfs/unistr.o ... CC fs/drop_caches.o LD sound/soc/generic/snd-soc-simple-card.o CC fs/fhandle.o LD sound/soc/generic/snd-soc-simple-card-utils.o LD sound/soc/generic/built-in.o LD sound/soc/tegra-alt/built-in.o LD sound/soc/snd-soc-core.o CC fs/dcookies.o LD sound/soc/built-in.o CC sound/usb/card.o CC sound/last.o CC sound/usb/clock.o LD sound/soundcore.o CC sound/usb/endpoint.o LD fs/built-in.o CC sound/usb/format.o CC sound/usb/helper.o CC sound/usb/mixer.o CC sound/usb/mixer_quirks.o CC sound/usb/mixer_scarlett.o CC sound/usb/pcm.o CC sound/usb/proc.o CC sound/usb/quirks.o CC sound/usb/stream.o CC sound/usb/midi.o LD sound/usb/snd-usb-audio.o LD sound/usb/snd-usbmidi-lib.o LD sound/usb/built-in.o LD sound/built-in.o make: *** [/home/neu/workplace/work/newwork/scheduler/working/Makefile.plugsched:16: collect] Error 2

This still looks to fail.

dtcccc commented 1 year ago

CC drivers/base/regmap/regcache-rbtree.o drivers/base/regmap/regcache-rbtree.c:36:1: error: alignment 1 of 'struct regcache_rbtree_node' is less than 8 [-Werror=packed-not-aligned] } attribute ((packed)); ^

It seems our gcc 8 complained about this code. You need this patch on your linux source code: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=435bba0f11f06789be59757719c161915e92f889

HaochunLiang commented 1 year ago

I'm sorry to bother you again.

I fix the code according to your link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=435bba0f11f06789be59757719c161915e92f889

Then I run the "make" command again, it show the new errors and I can't find a solution online.

The information is below: [root@96d2615dad78 scheduler]# /usr/bin/make collect objs= plugsched_tmpdir=/home/neu/workplace/work/newwork/scheduler/working/ plugsched_modpath=/home/neu/workplace/work/newwork/scheduler/kernel/sched/mod/ --file=/home/neu/workplace/work/newwork/scheduler/working/Makefile.plugsched --jobs=4 CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CC scripts/mod/empty.o CC scripts/mod/devicetable-offsets.s MKELF scripts/mod/elfconfig.h HOSTCC scripts/mod/modpost.o HOSTCC scripts/mod/sumversion.o CHK scripts/mod/devicetable-offsets.h HOSTCC scripts/mod/file2alias.o HOSTLD scripts/mod/modpost CHK include/generated/timeconst.h CC kernel/bounds.s CHK include/generated/bounds.h CC arch/arm64/kernel/asm-offsets.s CHK include/generated/asm-offsets.h CALL scripts/checksyscalls.sh /usr/bin/make CFLAGS_KERNEL="-fplugin=/usr/lib64/gcc-python-plugin/python.so -fplugin-arg-python-script=/home/neu/workplace/work/newwork/scheduler/working//collect.py -fplugin-arg-python-tmpdir=/home/neu/workplace/work/newwork/scheduler/working/" \ CFLAGS_MODULE="-fplugin=/usr/lib64/gcc-python-plugin/python.so -fplugin-arg-python-script=/home/neu/workplace/work/newwork/scheduler/working//collect.py -fplugin-arg-python-tmpdir=/home/neu/workplace/work/newwork/scheduler/working/" init usr arch/arm64/kernel arch/arm64/mm arch/arm64/net arch/arm64/crypto kernel certs mm fs ipc security crypto block drivers sound firmware net arch/arm64/lib lib virt CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CC scripts/mod/empty.o CC scripts/mod/devicetable-offsets.s CHK include/generated/timeconst.h CC kernel/bounds.s MKELF scripts/mod/elfconfig.h HOSTCC scripts/mod/modpost.o HOSTCC scripts/mod/sumversion.o CHK scripts/mod/devicetable-offsets.h HOSTCC scripts/mod/file2alias.o CHK include/generated/bounds.h CC arch/arm64/kernel/asm-offsets.s CHK include/generated/asm-offsets.h CALL scripts/checksyscalls.sh HOSTLD scripts/mod/modpost CHK include/generated/compile.h CHK kernel/config_data.h CC drivers/extcon/extcon.o CC drivers/gpu/drm/drm_crtc_helper.o CC drivers/hid/hid-core.o drivers/extcon/extcon.c: In function 'extcon_dev_register': drivers/extcon/extcon.c:1290:4: error: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation] strncpy(str, buf, strlen(buf)); ^~~~~~~~~~ drivers/extcon/extcon.c:1351:4: error: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation] strncpy(name, buf, strlen(buf)); ^~~~~~~ cc1: all warnings being treated as errors make[3]: [scripts/Makefile.build:335: drivers/extcon/extcon.o] Error 1 make[2]: [scripts/Makefile.build:649: drivers/extcon] Error 2 make[2]: Waiting for unfinished jobs.... CC drivers/gpu/drm/drm_dp_helper.o CC drivers/gpu/drm/drm_probe_helper.o CC drivers/gpu/drm/drm_plane_helper.o CC drivers/gpu/drm/drm_dp_mst_topology.o CC drivers/hid/hid-input.o CC drivers/gpu/drm/drm_atomic_helper.o CC drivers/gpu/drm/drm_kms_helper_common.o CC drivers/gpu/drm/drm_dp_dual_mode_helper.o CC drivers/hid/hid-debug.o CC drivers/gpu/drm/drm_simple_kms_helper.o CC drivers/gpu/drm/drm_modeset_helper.o CC drivers/gpu/drm/drm_fb_helper.o CC drivers/hid/hidraw.o CC drivers/hid/uhid.o CC drivers/gpu/drm/drm_auth.o drivers/hid/uhid.c: In function 'uhid_dev_create2': drivers/hid/uhid.c:513:2: error: 'strncpy' output may be truncated copying 127 bytes from a string of length 127 [-Werror=stringop-truncation] strncpy(hid->name, ev->u.create2.name, len); ^~~~~~~~~~~ drivers/hid/uhid.c:515:2: error: 'strncpy' output may be truncated copying 63 bytes from a string of length 63 [-Werror=stringop-truncation] strncpy(hid->phys, ev->u.create2.phys, len); ^~~~~~~~~~~ drivers/hid/uhid.c:517:2: error: 'strncpy' output may be truncated copying 63 bytes from a string of length 63 [-Werror=stringop-truncation] strncpy(hid->uniq, ev->u.create2.uniq, len); ^~~~~~~~~~~ cc1: all warnings being treated as errors make[3]: [scripts/Makefile.build:335: drivers/hid/uhid.o] Error 1 make[3]: Waiting for unfinished jobs.... CC drivers/gpu/drm/drm_bufs.o make[2]: [scripts/Makefile.build:649: drivers/hid] Error 2 CC drivers/gpu/drm/drm_cache.o CC drivers/gpu/drm/drm_context.o CC drivers/gpu/drm/drm_dma.o CC drivers/gpu/drm/drm_fops.o CC drivers/gpu/drm/drm_gem.o CC drivers/gpu/drm/drm_ioctl.o CC drivers/gpu/drm/drm_irq.o CC drivers/gpu/drm/drm_lock.o CC drivers/gpu/drm/drm_memory.o CC drivers/gpu/drm/drm_drv.o CC drivers/gpu/drm/drm_vm.o CC drivers/gpu/drm/drm_scatter.o CC drivers/gpu/drm/drm_pci.o CC drivers/gpu/drm/drm_platform.o CC drivers/gpu/drm/drm_sysfs.o CC drivers/gpu/drm/drm_hashtab.o CC drivers/gpu/drm/drm_mm.o CC drivers/gpu/drm/drm_crtc.o CC drivers/gpu/drm/drm_fourcc.o CC drivers/gpu/drm/drm_modes.o CC drivers/gpu/drm/drm_edid.o CC drivers/gpu/drm/drm_info.o CC drivers/gpu/drm/drm_debugfs.o CC drivers/gpu/drm/drm_encoder_slave.o CC drivers/gpu/drm/drm_trace_points.o CC drivers/gpu/drm/drm_global.o CC drivers/gpu/drm/drm_prime.o CC drivers/gpu/drm/drm_rect.o CC drivers/gpu/drm/drm_vma_manager.o CC drivers/gpu/drm/drm_flip_work.o CC drivers/gpu/drm/drm_modeset_lock.o CC drivers/gpu/drm/drm_atomic.o CC drivers/gpu/drm/drm_bridge.o CC drivers/gpu/drm/drm_framebuffer.o CC drivers/gpu/drm/drm_connector.o CC drivers/gpu/drm/drm_blend.o CC drivers/gpu/drm/drm_encoder.o CC drivers/gpu/drm/drm_mode_object.o CC drivers/gpu/drm/drm_property.o CC drivers/gpu/drm/drm_plane.o CC drivers/gpu/drm/drm_color_mgmt.o CC drivers/gpu/drm/drm_ioc32.o CC drivers/gpu/drm/ati_pcigart.o CC drivers/gpu/drm/drm_of.o LD drivers/gpu/drm/drm_kms_helper.o LD drivers/gpu/drm/drm.o LD drivers/gpu/drm/built-in.o LD drivers/gpu/built-in.o make[1]: [Makefile:1104: drivers] Error 2 make: [/home/neu/workplace/work/newwork/scheduler/working/Makefile.plugsched:16: collect] Error 2

dtcccc commented 1 year ago

It seems gcc 8 is too new for your kernel version... I'm curious about the result you simply type "make" under the Linux source code to build the kernel (in our container with gcc8)

For your question, please try: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=217c3e0196758662aa0429863b09d1c13da1c5d6

HaochunLiang commented 1 year ago

I'm sorry to create ambiguity. I'm run "make" command means run "/usr/bin/make collect objs= plugsched_tmpdir=/home/neu/workplace/work/newwork/scheduler/working/ plugsched_modpath=/home/neu/workplace/work/newwork/scheduler/kernel/sched/mod/ --file=/home/neu/workplace/work/newwork/scheduler/working/Makefile.plugsched --jobs=4"

According to your link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=217c3e0196758662aa0429863b09d1c13da1c5d6, I add these lines to Makefile:

KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation) KBUILD_CFLAGS += $(call cc-disable-warning, stringop-overflow) KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare) KBUILD_CFLAGS += $(call cc-disable-warning, packed-not-aligned)

The Makefile file is in "/home/neu/workplace/work/newwork/scheduler"

Then I run the command: /usr/bin/make collect objs= plugsched_tmpdir=/home/neu/workplace/work/newwork/scheduler/working/ plugsched_modpath=/home/neu/workplace/work/newwork/scheduler/kernel/sched/mod/ --file=/home/neu/workplace/work/newwork/scheduler/working/Makefile.plugsched --jobs=4

It shows the new errors:

CC drivers/platform/tegra/tegra-mce.o CC drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.o /home/neu/workplace/work/newwork/nvidia/drivers/platform/tegra/tegra-mce.c: In function 'tegra_mce_early_init': /home/neu/workplace/work/newwork/nvidia/drivers/platform/tegra/tegra-mce.c:832:34: error: 'tegra19x_mce_read_rt_safe_mask' undeclared (first use in this function); did you mean 'tegra_mce_read_rt_safe_mask'? _tegra_mce_read_rt_safe_mask = tegra19x_mce_read_rt_safe_mask; ^~~~~~~~~~ tegra_mce_read_rt_safe_mask /home/neu/workplace/work/newwork/nvidia/drivers/platform/tegra/tegra-mce.c:832:34: note: each undeclared identifier is reported only once for each function it appears in /home/neu/workplace/work/newwork/nvidia/drivers/platform/tegra/tegra-mce.c:833:35: error: 'tegra19x_mce_write_rt_safe_mask' undeclared (first use in this function); did you mean 'tegra_mce_write_rt_safe_mask'? _tegra_mce_write_rt_safe_mask = tegra19x_mce_write_rt_safe_mask; ^~~~~~~ tegra_mce_write_rt_safe_mask /home/neu/workplace/work/newwork/nvidia/drivers/platform/tegra/tegra-mce.c:834:34: error: 'tegra19x_mce_read_rt_window_us' undeclared (first use in this function); did you mean 'tegra_mce_read_rt_window_us'? _tegra_mce_read_rt_window_us = tegra19x_mce_read_rt_window_us; ^~~~~~~~~~ tegra_mce_read_rt_window_us /home/neu/workplace/work/newwork/nvidia/drivers/platform/tegra/tegra-mce.c:835:35: error: 'tegra19x_mce_write_rt_window_us' undeclared (first use in this function); did you mean 'tegra_mce_write_rt_window_us'? _tegra_mce_write_rt_window_us = tegra19x_mce_write_rt_window_us; ^~~~~~~ tegra_mce_write_rt_window_us /home/neu/workplace/work/newwork/nvidia/drivers/platform/tegra/tegra-mce.c:837:4: error: 'tegra19x_mce_read_rt_fwd_progress_us' undeclared (first use in this function); did you mean 'tegra_mce_read_rt_fwd_progress_us'? tegra19x_mce_read_rt_fwd_progress_us; ^~~~~~~~ tegra_mce_read_rt_fwd_progress_us /home/neu/workplace/work/newwork/nvidia/drivers/platform/tegra/tegra-mce.c:839:4: error: 'tegra19x_mce_write_rt_fwd_progress_us' undeclared (first use in this function); did you mean 'tegra_mce_write_rt_fwd_progress_us'? tegra19x_mce_write_rt_fwd_progress_us; ^~~~~~~~~ tegra_mce_write_rt_fwd_progress_us make[4]: [scripts/Makefile.build:335: drivers/platform/tegra/tegra-mce.o] Error 1 make[3]: [scripts/Makefile.build:649: drivers/platform/tegra] Error 2 make[2]: [scripts/Makefile.build:649: drivers/platform] Error 2 make[2]: Waiting for unfinished jobs.... CC drivers/net/ethernet/intel/ixgbe/ixgbe_lib.o CC drivers/net/usb/cdc_ncm.o

I think it may be that the compilation failure of the kernel on AGX is associated with Nvidia's library.

dtcccc commented 1 year ago

I'm sorry to create ambiguity.

No ambiguity. I know you typed "make collect xxx", but I'm also curious about typing simply "make" to build the kernel.

I think it may be that the compilation failure of the kernel on AGX is associated with Nvidia's library.

So Nvidia's library cannot work with gcc 8. Actually I've found the reply from nvidia about your first build error: https://forums.developer.nvidia.com/t/error-taking-address-of-packed-member-of-struct-regcache-rbtree-node-may-result-in-an-unaligned-pointer-value/158135 but I didn't say that because I hoped to solve this error and there would be no other errors :-(

dtcccc commented 1 year ago

However, change gcc version is hard for us, because some related libraries (e.g., our customized gcc-python-plugin) need to be rebuild...

HaochunLiang commented 1 year ago

Thank you for your reply. My version of Linux kernel can only be compiled with gcc 7.3.1, so these errors cannot be solved for the time being.

I run the command "make" in dir: /home/neu/workplace/work/newwork/scheduler, it shows the following errors:

CC drivers/platform/tegra/tegra-mce.o /home/neu/workplace/work/newwork/nvidia/drivers/platform/tegra/tegra-mce.c: In function 'tegra_mce_early_init': /home/neu/workplace/work/newwork/nvidia/drivers/platform/tegra/tegra-mce.c:832:34: error: 'tegra19x_mce_read_rt_safe_mask' undeclared (first use in this function); did you mean 'tegra_mce_read_rt_safe_mask'? _tegra_mce_read_rt_safe_mask = tegra19x_mce_read_rt_safe_mask; ^~~~~~~~~~ tegra_mce_read_rt_safe_mask /home/neu/workplace/work/newwork/nvidia/drivers/platform/tegra/tegra-mce.c:832:34: note: each undeclared identifier is reported only once for each function it appears in /home/neu/workplace/work/newwork/nvidia/drivers/platform/tegra/tegra-mce.c:833:35: error: 'tegra19x_mce_write_rt_safe_mask' undeclared (first use in this function); did you mean 'tegra_mce_write_rt_safe_mask'? _tegra_mce_write_rt_safe_mask = tegra19x_mce_write_rt_safe_mask; ^~~~~~~ tegra_mce_write_rt_safe_mask /home/neu/workplace/work/newwork/nvidia/drivers/platform/tegra/tegra-mce.c:834:34: error: 'tegra19x_mce_read_rt_window_us' undeclared (first use in this function); did you mean 'tegra_mce_read_rt_window_us'? _tegra_mce_read_rt_window_us = tegra19x_mce_read_rt_window_us; ^~~~~~~~~~ tegra_mce_read_rt_window_us /home/neu/workplace/work/newwork/nvidia/drivers/platform/tegra/tegra-mce.c:835:35: error: 'tegra19x_mce_write_rt_window_us' undeclared (first use in this function); did you mean 'tegra_mce_write_rt_window_us'? _tegra_mce_write_rt_window_us = tegra19x_mce_write_rt_window_us; ^~~~~~~ tegra_mce_write_rt_window_us /home/neu/workplace/work/newwork/nvidia/drivers/platform/tegra/tegra-mce.c:837:4: error: 'tegra19x_mce_read_rt_fwd_progress_us' undeclared (first use in this function); did you mean 'tegra_mce_read_rt_fwd_progress_us'? tegra19x_mce_read_rt_fwd_progress_us; ^~~~~~~~ tegra_mce_read_rt_fwd_progress_us /home/neu/workplace/work/newwork/nvidia/drivers/platform/tegra/tegra-mce.c:839:4: error: 'tegra19x_mce_write_rt_fwd_progress_us' undeclared (first use in this function); did you mean 'tegra_mce_write_rt_fwd_progress_us'? tegra19x_mce_write_rt_fwd_progress_us; ^~~~~~~~~ tegra_mce_write_rt_fwd_progress_us make[3]: [scripts/Makefile.build:336: drivers/platform/tegra/tegra-mce.o] Error 1 make[2]: [scripts/Makefile.build:649: drivers/platform/tegra] Error 2 make[1]: [scripts/Makefile.build:649: drivers/platform] Error 2 make: [Makefile:1110: drivers] Error 2

So it seems that the compiler version does not match.