History

checksyscalls: only run when necessary

Currently checksyscalls.sh is unconditionally executed during each build. Most of these executions are unnecessary. Only run checksyscalls.sh if one of its inputs have changed. This new logic does not work for the multiple invocations done for MIPS. The effect is that checksyscalls.sh is still executed unconditionally. However this is not worse than before.

Thomas Weißschuh committed 7 months ago

Commit b34db3f1 parent e856b6c2 files · +14 −3Browse files

Unified · Split

2 files
  1. Kbuild +9 −3
  2. scripts/checksyscalls.sh +5 −0
Kbuild+9−3
@@ -47,12 +47,18 @@ $(rq-offsets-file): kernel/sched/rq-offsets.s FORCE · 46 unmodified lines
4747
4848 # Check for missing system calls
4949
50+missing-syscalls-file := .tmp_missing-syscalls
51+
52+targets += $(missing-syscalls-file)
53+
5054 quiet_cmd_syscalls = CALL $<
51− cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags)
55+ cmd_syscalls = DEPFILE=$(depfile) $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags); touch $@
56+
57+$(missing-syscalls-file): scripts/checksyscalls.sh $(rq-offsets-file) FORCE
58+ $(call if_changed_dep,syscalls)
5259
5360 PHONY += missing-syscalls
54−missing-syscalls: scripts/checksyscalls.sh $(rq-offsets-file)
55− $(call cmd,syscalls)
61+missing-syscalls: $(missing-syscalls-file)
5662
5763 # Check the manual modification of atomic headers
5864
scripts/checksyscalls.sh+5−0
@@ -275,3 +275,8 @@ syscall_list() { · 274 unmodified lines
275275
276276 (ignore_list && syscall_list ${reference_table}) | \
277277 $* -Wno-error -Wno-unused-macros -E -x c - > /dev/null
278+
279+# For fixdep
280+if [ -n "${DEPFILE}" ]; then
281+ echo "${0}: ${0} ${reference_table}" >> "${DEPFILE}"
282+fi