[DTrace-devel] DTrace-ized 5.4.2 pushed to oss.oracle.com and github

Nick Alcock nick.alcock at oracle.com
Mon Dec 9 11:25:02 PST 2019


Tests passed on x86-64 and AArch64 with dtrace-utils 1.2.1.

Pushed to <https://github.com/oracle/dtrace-linux-kernel> and
<https://oss.oracle.com/git/gitweb.cgi?p=dtrace-linux-kernel.git>, , as
branches with v1 in the name. (Something may have gone wrong with the
OSS push -- I'm getting strange locking errors -- but the other repo
is there.)

This push is of DTrace v1, with a specialized kernel module.

Changes since v5.3.6 are mostly adaptations to the Makefile.modfinal
change, adaptations to BTF integration, some adjustment to new exit
paths in IPv6 and x86 NMI code, and some unhiding of newly-hidden mutex
machinery which DTrace uses.  (Most of these changes are in
as-yet-unsquashed-back commits at the tip.)

There is also a new sample script for building DTrace on Fedora, and
some additions to the FBT blacklist to avoid crashes in extreme edge
cases.

 1:  3229529bfdb3 !  1:  ed3c61aaede5 ctf: generate CTF information for the kernel
    @@ Commit message
     
      ## .gitignore ##
     @@
    - *.xz
      Module.symvers
      modules.builtin
    + modules.order
     +modules_thick.builtin
     +objects.builtin
      
      #
      # Top-level generic files
    -@@ .gitignore: modules.builtin
    +@@ .gitignore: modules.order
      /linux
      /vmlinux
      /vmlinux.32
    @@ Makefile: cmd_link-vmlinux =                                                 \
      
      targets := vmlinux
     @@ Makefile: modules: $(if $(KBUILD_BUILTIN),vmlinux) modules.order modules.builtin
    - modules.order: $(vmlinux-dirs)
    - 	$(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(vmlinux-dirs)) > $@
    + modules.order: descend
    + 	$(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(build-dirs)) > $@
      
    --modbuiltin-dirs := $(addprefix _modbuiltin_, $(vmlinux-dirs))
    +-modbuiltin-dirs := $(addprefix _modbuiltin_, $(build-dirs))
     +ifneq (CONFIG_CTF@,'@')
      
     -modules.builtin: $(modbuiltin-dirs)
    --	$(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(vmlinux-dirs)) > $@
    +-	$(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(build-dirs)) > $@
     +# We need to force everything to be built, since we need the .o files below.
     +KBUILD_BUILTIN := 1
      
    @@ Makefile: modules: $(if $(KBUILD_BUILTIN),vmlinux) modules.order modules.builtin
     -# here to make it self-healing in case somebody accidentally removes it.
     -$(modbuiltin-dirs): include/config/tristate.conf
     -	$(Q)$(MAKE) $(modbuiltin)=$(patsubst _modbuiltin_%,%,$@)
    -+# Set a default CTF filename.
    -+CTF_FILENAME := vmlinux.ctfa
    -+
     +# This contains all the object files that are built directly into the
     +# kernel (including built-in modules), for consumption by dwarf2ctf in
     +# Makefile.modpost.
    @@ Makefile: modules: $(if $(KBUILD_BUILTIN),vmlinux) modules.order modules.builtin
     +		$(AR) t "$$archive" >> objects.builtin; \
     +	done
     +
    -+CTF_DEBUGDIR := .
    -+
    -+ctf: $(CTF_FILENAME)
    ++ctf: vmlinux.ctfa
     +PHONY += ctf
     +
     +# Making CTF needs the builtin files unless out-of-tree.
     +ifeq ($(KBUILD_EXTMOD),)
    -+$(CTF_FILENAME): modules_thick.builtin objects.builtin
    ++vmlinux.ctfa: modules_thick.builtin objects.builtin
     +endif
    -+$(CTF_FILENAME):
    -+	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost CTF_FILENAME=$(CTF_FILENAME) CTF_DEBUGDIR=$(CTF_DEBUGDIR) $(CTF_FILENAME)
    ++vmlinux.ctfa:
    ++	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modfinal vmlinux.ctfa
     +else
     +PHONY += objects.builtin
     +objects.builtin:
    @@ Makefile: _modinst_:
      	@sed 's:^:kernel/:' modules.order > $(MODLIB)/modules.order
      	@sed 's:^:kernel/:' modules.builtin > $(MODLIB)/modules.builtin
      	@cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/
    -+	@if [ -f $(objtree)/$(CTF_FILENAME) ] ; then \
    -+		cp -f $(objtree)/$(CTF_FILENAME) $(MODLIB)/kernel ; \
    ++	@if [ -f $(objtree)/vmlinux.ctfa ] ; then \
    ++		cp -f $(objtree)/vmlinux.ctfa $(MODLIB)/kernel ; \
     +	fi
      	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
      
    @@ Makefile: modules modules_install:
     +# given object file is part of.  (We cannot eliminate the slight redundancy here
     +# without double-expansion.)
     +
    -+modbuiltin-dirs := $(addprefix _modbuiltin_, $(vmlinux-dirs))
    -+modthickbuiltin-dirs := $(addprefix _modthickbuiltin_, $(vmlinux-dirs))
    ++modbuiltin-dirs := $(addprefix _modbuiltin_, $(build-dirs))
    ++modthickbuiltin-dirs := $(addprefix _modthickbuiltin_, $(build-dirs))
     +
     +modules.builtin: $(modbuiltin-dirs)
    -+	$(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(vmlinux-dirs)) > $@
    ++	$(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(build-dirs)) > $@
     +
     +modules_thick.builtin: $(modthickbuiltin-dirs)
    -+	$(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(vmlinux-dirs)) > $@
    ++	$(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(build-dirs)) > $@
     +
     +PHONY += $(modbuiltin-dirs) $(modthickbuiltin-dirs)
     +# tristate.conf is not included from this Makefile. Add it as a prerequisite
    @@ Makefile: endif # CONFIG_MODULES
     -CLEAN_DIRS  += include/ksym
     -CLEAN_FILES += modules.builtin.modinfo
     +CLEAN_DIRS  += include/ksym .ctf
    -+CLEAN_FILES += modules.builtin.modinfo .ctf.filelist
    ++CLEAN_FILES += modules.builtin.modinfo .ctf.filelist .ctf.filelist.raw
      
      # Directories & files removed with 'make mrproper'
      MRPROPER_DIRS  += include/config include/generated          \
    @@ scripts/Makefile.modbuiltin: FORCE:
      
      .PHONY: $(PHONY)
     
    - ## scripts/Makefile.modpost ##
    + ## scripts/Makefile.modfinal ##
     @@
    - # 3)  create one <module>.mod.c file pr. module
    - # 4)  create one Module.symvers file with CRC for all exported symbols
    - # 5) compile all <module>.mod.c files
    --# 6) final link of the module to a <module.ko> file
    -+# 6) for external modules, generate CTF for the module (there is an extra,
    + # SPDX-License-Identifier: GPL-2.0-only
    + # ===========================================================================
    +-# Module final link
    ++# Module final link and CTF generation
    + # ===========================================================================
    ++# 1) compile all <module>.mod.c files
    ++# 2) for external modules, generate CTF for the module (there is an extra,
     +#    externally-invoked target that does this for the entire kernel but does
     +#    not invoke the rst of the module-building process)
    -+# 7) final link of the module to a <module.ko> file
    - 
    - # Step 3 is used to place certain information in the module's ELF
    - # section, including information such as:
    -@@
    - # Step 4 is solely used to allow module versioning in external modules,
    - # where the CRC of each module is retrieved from the Module.symvers file.
    - 
    ++# 3) final link of the module to a <module.ko> file
    ++
     +# We need secondary expansion for 'module-ctfs-modular-prereq', below.
     +
     +.SECONDEXPANSION:
    -+
    - # KBUILD_MODPOST_WARN can be set to avoid error out in case of undefined
    - # symbols in the final module linking stage
    - # KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
    -@@ scripts/Makefile.modpost: $(modules:.ko=.mod.o): %.mod.o: %.mod.c FORCE
      
    - targets += $(modules:.ko=.mod.o)
    + PHONY := __modfinal
    + __modfinal:
    + 
    ++include include/config/auto.conf
    + include $(srctree)/scripts/Kbuild.include
      
    --ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
    -+# Step 6), generate CTF for the entire kernel (in a separate $(CTF_FILENAME)),
    -+# or for the module alone if this is a build of an external module.
    + # for c_flags
    +@@ scripts/Makefile.modfinal: quiet_cmd_cc_o_c = CC [M]  $@
    + %.mod.o: %.mod.c FORCE
    + 	$(call if_changed_dep,cc_o_c)
    + 
    ++# Generate CTF for the entire kernel, or for the module alone if this is a
    ++# build of an external module.
     +
     +# These are overridden below for standalone modules only.
     +module-ctfs-modular-prereq =
    @@ scripts/Makefile.modpost: $(modules:.ko=.mod.o): %.mod.o: %.mod.c FORCE
     +ifeq ($(KBUILD_EXTMOD),)
     +ctf-dir-mk :=
     +quiet_cmd_ctf = CTFA
    -+      cmd_ctf = scripts/dwarf2ctf/dwarf2ctf $(CTF_FILENAME) $(srctree) objects.builtin modules_thick.builtin $(srctree)/scripts/dwarf2ctf/member.blacklist $(ctf-filelist)
    ++      cmd_ctf = scripts/dwarf2ctf/dwarf2ctf vmlinux.ctfa $(srctree) objects.builtin modules_thick.builtin $(srctree)/scripts/dwarf2ctf/member.blacklist $(ctf-filelist)
     +ctf-builtins := objects.builtin
     +ctf-builtins-prereq := $(ctf-builtins)
    -+ ctf-modules := $(shell find $(CTF_DEBUGDIR) \( -name '*.ko' -o -name '*.ko.debug' \) -print)
    ++ ctf-modules := $(shell find . -name '*.ko' -print)
     +ctf-filelist := .ctf.filelist
    ++ctf-filelist-raw := .ctf.filelist.raw
     +ctf-stamp :=
    - 
    --# Step 6), final link of the modules with optional arch pass after final link
    ++
     +else
     +ctf-dir := $(KBUILD_EXTMOD)/.ctf
     +ctf-dir-mk := $(ctf-dir)
    @@ scripts/Makefile.modpost: $(modules:.ko=.mod.o): %.mod.o: %.mod.c FORCE
     +ctf-builtins-prereq :=
     +ctf-modules := $(modules:.ko=.o)
     +ctf-filelist := $(ctf-dir)/$(notdir $(M)-extmod).ctf.filelist
    ++ctf-filelist-raw := $(ctf-dir)/$(notdir $(M)-extmod).ctf.filelist.raw
     +ctf-stamp = $(ctf-dir)/$(notdir $(M)-extmod).stamp
     +
     +# All the modules' CTF depends on the stamp file.
    @@ scripts/Makefile.modpost: $(modules:.ko=.mod.o): %.mod.o: %.mod.c FORCE
     +
     +endif
     +
    -+$(ctf-filelist): $(ctf-builtins-prereq) $(ctf-modules)
    -+	@rm -f $(ctf-filelist);
    ++# Split a list up like shell xargs does.
    ++define xargs =
    ++$(1) $(wordlist 1,1024,$(2))
    ++$(if $(word 1025,$(2)),$(call xargs,$(1),$(wordlist 1025,$(words $(2)),$(2))))
    ++endef
    ++
    ++$(ctf-filelist-raw): $(ctf-builtins-prereq) $(ctf-modules)
    ++	@rm -f $(ctf-filelist-raw);
     +	@if [[ -n "$(ctf-dir-mk)" ]]; then \
     +		mkdir -p "$(ctf-dir-mk)"; \
     +	fi
    -+	@for obj in $^; do \
    ++	$(call xargs, at printf "%s\n" >> $(ctf-filelist-raw),$^)
    ++	@touch $(ctf-filelist-raw)
    ++
    ++$(ctf-filelist): $(ctf-filelist-raw)
    ++	@rm -f $(ctf-filelist);
    ++	@cat $(ctf-filelist-raw) | while read -r obj; do \
     +		case $$obj in \
     +		$(ctf-builtins)) cat $$obj >> $(ctf-filelist);; \
     +		*.a) ar t $$obj > $(ctf-filelist);; \
    @@ scripts/Makefile.modpost: $(modules:.ko=.mod.o): %.mod.o: %.mod.c FORCE
     +		*) echo "$$obj" >> $(ctf-filelist);; \
     +		esac; \
     +	done
    ++	@touch $(ctf-filelist)
     +
     +ifeq ($(KBUILD_EXTMOD),)
     +# The CTF depends on the output CTF file list, and that depends
     +# on the .ko files for the modules.
    -+$(CTF_FILENAME): $(ctf-filelist)
    ++vmlinux.ctfa: $(ctf-filelist)
     +	$(call if_changed,ctf)
     +else
     +
    @@ scripts/Makefile.modpost: $(modules:.ko=.mod.o): %.mod.o: %.mod.c FORCE
     +
     +endif		# !CONFIG_CTF
     +
    -+# Step 7), final link of the modules with optional arch pass after final link
    -+ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
    + ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
    + 
      quiet_cmd_ld_ko_o = LD [M]  $@
    --      cmd_ld_ko_o =                                                     \
    -+      cmd_ld_ko_o =                     				\
    - 	$(LD) -r $(KBUILD_LDFLAGS)                                      \
    --                 $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE)             \
    --                 -o $@ $(real-prereqs) ;                                \
    -+                 $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) 		\
    +@@ scripts/Makefile.modfinal: quiet_cmd_ld_ko_o = LD [M]  $@
    + 	$(LD) -r $(KBUILD_LDFLAGS)					\
    + 		$(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE)		\
    + 		$(addprefix -T , $(KBUILD_LDS_MODULE))			\
    +-		-o $@ $(filter %.o, $^);				\
     +                 $(LDFLAGS_$(modname)) -o $@.tmp            		\
    -+                 $(patsubst $(ctf-dir)/%,,$(real-prereqs)) &&	\
    ++		-o $@.tmp $(patsubst $(ctf-dir)/%,,$(filter %.o, $^)) && \
     +        $(OBJCOPY) $(module-ctf-flags) $@.tmp $@ && rm -f $@.tmp ;	\
      	$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
      
    --$(modules): %.ko :%.o %.mod.o FORCE
    -+$(modules): %.ko : %.o %.mod.o $(module-ctfs-modular-prereq) FORCE
    +-$(modules): %.ko: %.o %.mod.o $(KBUILD_LDS_MODULE) FORCE
    ++$(modules): %.ko: %.o %.mod.o $(KBUILD_LDS_MODULE) $(module-ctfs-modular-prereq) FORCE
     +	$(call cmd_touch_ctf)
      	+$(call if_changed,ld_ko_o)
      
    - targets += $(modules)
    + targets += $(modules) $(modules:.ko=.mod.o)
     
      ## scripts/dwarf2ctf/.gitignore (new) ##
     @@
 2:  480915301c7b !  2:  5c8029aab88e kallsyms: introduce new /proc/kallmodsyms including builtin modules too
    @@ Commit message
     
      ## Makefile ##
     @@ Makefile: modules: $(if $(KBUILD_BUILTIN),vmlinux) modules.order modules.builtin
    - modules.order: $(vmlinux-dirs)
    - 	$(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(vmlinux-dirs)) > $@
    + modules.order: descend
    + 	$(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(build-dirs)) > $@
      
     -ifneq (CONFIG_CTF@,'@')
     +ifneq (CONFIG_CTF at CONFIG_KALLMODSYMS,'@')
    @@ scripts/link-vmlinux.sh: vmlinux_link()
      			${KBUILD_VMLINUX_LIBS}			\
      			--end-group				\
     +			-Map=.tmp_vmlinux.map			\
    - 			${1}"
    + 			${@}"
      
    - 		${LD} ${KBUILD_LDFLAGS} ${LDFLAGS_vmlinux} -o ${2}	\
    + 		${LD} ${KBUILD_LDFLAGS} ${LDFLAGS_vmlinux}	\
     @@ scripts/link-vmlinux.sh: vmlinux_link()
      			-Wl,--start-group			\
      			${KBUILD_VMLINUX_LIBS}			\
      			-Wl,--end-group				\
     +			-Wl,-Map=.tmp_vmlinux.map		\
    - 			${1}"
    + 			${@}"
      
    - 		${CC} ${CFLAGS_vmlinux} -o ${2}			\
    + 		${CC} ${CFLAGS_vmlinux}				\
     @@ scripts/link-vmlinux.sh: kallsyms()
      	info KSYM ${2}
      	local kallsymopt;
 3:  194c2a432db1 =  3:  77afb7fc52ee waitfd: new syscall implementing waitpid() over fds
 4:  d71aa40107b9 !  4:  5c54dfdcc6bc dtrace: core and x86
    @@ Makefile: core-y		+= kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
     -			$(drivers-) $(net-) $(libs-) $(virt-))))
     +			$(drivers-) $(net-) $(libs-) $(virt-) $(dtrace-))))
      
    + build-dirs	:= $(vmlinux-dirs)
    + clean-dirs	:= $(vmlinux-alldirs)
    +@@ Makefile: clean-dirs	:= $(vmlinux-alldirs)
      init-y		:= $(patsubst %/, %/built-in.a, $(init-y))
      core-y		:= $(patsubst %/, %/built-in.a, $(core-y))
      drivers-y	:= $(patsubst %/, %/built-in.a, $(drivers-y))
    @@ fs/exec.c: static int __do_execve_file(int fd, struct filename *filename,
     +
      	current->fs->in_exec = 0;
      	current->in_execve = 0;
    - 	membarrier_execve(current);
    + 	rseq_execve(current);
     
      ## include/asm-generic/qrwlock.h ##
     @@
    @@ include/linux/mutex.h
      struct ww_acquire_ctx;
      
      /*
    -@@ include/linux/mutex.h: mutex_trylock_recursive(struct mutex *lock)
    - 	return mutex_trylock(lock);
    - }
    +@@ include/linux/mutex.h: enum mutex_trylock_recursive_enum {
    + extern /* __deprecated */ __must_check enum mutex_trylock_recursive_enum
    + mutex_trylock_recursive(struct mutex *lock);
      
     +#if defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_SMP)
     +static inline int mutex_owned(struct mutex *lock)
    @@ include/linux/rwlock.h: do {								\
     
      ## include/linux/sched.h ##
     @@
    - #include <linux/mm_types_task.h>
      #include <linux/task_io_accounting.h>
    + #include <linux/posix-timers.h>
      #include <linux/rseq.h>
     +#include <linux/dtrace_task.h>
      
 5:  17f55ec16266 =  5:  04784da15034 dtrace: modular components and x86 support
 6:  4a906609d775 !  6:  e705e1f9dda9 dtrace: systrace provider core components
    @@ arch/x86/entry/syscall_32.c: extern asmlinkage long sys_ni_syscall(unsigned long
     
      ## arch/x86/entry/syscall_64.c ##
     @@ arch/x86/entry/syscall_64.c: extern asmlinkage long sys_ni_syscall(const struct pt_regs *);
    - 
      #define __SYSCALL_64(nr, sym, qual) [nr] = sym,
    + #define __SYSCALL_X32(nr, sym, qual)
      
     +#if IS_ENABLED(CONFIG_DT_SYSTRACE)
     +asmlinkage sys_call_ptr_t sys_call_table[__NR_syscall_max+1] = {
    @@ arch/x86/include/asm/syscall.h: extern const sys_call_ptr_t sys_call_table[];
      #endif
     +#endif
      
    - /*
    -  * Only the low 32 bits of orig_ax are meaningful, so we return int.
    + #ifdef CONFIG_X86_X32_ABI
    + extern const sys_call_ptr_t x32_sys_call_table[];
     
      ## arch/x86/kernel/dtrace_syscall.c (new) ##
     @@
 7:  7f73e1372689 =  7:  6841186044df dtrace: systrace provider
 8:  f5e5efcb9826 !  8:  fbed2054cca5 dtrace: sdt provider core components
    @@ Makefile
     @@ Makefile: clean: $(clean-dirs)
      		-o -name '*.dtb' -o -name '*.dtb.S' -o -name '*.dt.yaml' \
      		-o -name '*.dwo' -o -name '*.lst' \
    - 		-o -name '*.su' -o -name '*.mod' \
    + 		-o -name '*.su' -o -name '*.mod' -o -name '*.ns_deps' \
    ++		-o -name '*.su' -o -name '*.mod' \
     +		-o -name '*.sdtinfo.c' -o -name '*.sdtstub.S' \
      		-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
      		-o -name '*.lex.c' -o -name '*.tab.[ch]' \
    @@ include/linux/module.h
      
     +#include <linux/sdt.h>
     +
    - /* In stripped ARM and x86-64 modules, ~ is surprisingly rare. */
    - #define MODULE_SIG_STRING "~Module signature appended~\n"
    + /* Not Yet Implemented */
    + #define MODULE_SUPPORTED_DEVICE(name)
      
     @@ include/linux/module.h: struct module {
      #endif
    @@ scripts/Makefile
      HOST_EXTRACFLAGS += -I$(srctree)/tools/include
      
     @@ scripts/Makefile: hostprogs-$(CONFIG_ASN1)	 += asn1_compiler
    - hostprogs-$(CONFIG_MODULE_SIG)	 += sign-file
    + hostprogs-$(CONFIG_MODULE_SIG_FORMAT) += sign-file
      hostprogs-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += extract-cert
      hostprogs-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert
     +hostprogs-$(CONFIG_DTRACE)	 += kmodsdt
    @@ scripts/Makefile: HOSTCFLAGS_eu_simple.o := -I$(srctree)/scripts
      hostprogs-y += unifdef
      
     
    - ## scripts/Makefile.modpost ##
    + ## scripts/Makefile.modfinal ##
     @@
    - # 2) modpost is then used to
    - # 3)  create one <module>.mod.c file pr. module
    - # 4)  create one Module.symvers file with CRC for all exported symbols
    --# 5) compile all <module>.mod.c files
    -+# 5) compute SDT offsets, generate SDT stubs, and compile all .mod.c files
    - # 6) for external modules, generate CTF for the module (there is an extra,
    + # ===========================================================================
    + # Module final link and CTF generation
    + # ===========================================================================
    +-# 1) compile all <module>.mod.c files
    ++# 1) compute SDT offsets, generate SDT stubs, and compile all .mod.c files
    + # 2) for external modules, generate CTF for the module (there is an extra,
      #    externally-invoked target that does this for the entire kernel but does
      #    not invoke the rst of the module-building process)
    -@@ scripts/Makefile.modpost: modules-modpost:
    - # Declare generated files as targets for modpost
    - $(modules:.ko=.mod.c): modules-modpost
    +@@ scripts/Makefile.modfinal: modname = $(notdir $(@:.mod.o=))
    + part-of-module = y
      
    --# Step 5), compile all *.mod.c files
    -+# Step 5), compile all *.mod.c files (includes the generation of SDT data
    -+# and SDT stubs)
    - 
    - # modname is set to make c_flags define KBUILD_MODNAME
    - modname = $(notdir $(@:.mod.o=))
    - 
    - quiet_cmd_cc_o_c = CC      $@
    -       cmd_cc_o_c = $(CC) $(c_flags) $(KBUILD_CFLAGS_MODULE) $(CFLAGS_MODULE) \
    --		   -c -o $@ $<
    -+		   -I$(dir $@) -c -o $@ $<
    + quiet_cmd_cc_o_c = CC [M]  $@
    +-      cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
    ++      cmd_cc_o_c = $(CC) $(c_flags) -I$(dir $@) -c -o $@ $<
     +
     +quiet_cmd_as_o_S = AS      $@
     +      cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<
    @@ scripts/Makefile.modpost: modules-modpost:
     +$(modules:.ko=.sdtstub.S) : %.sdtstub.S: %.o %.sdtinfo.c
     +	$(call cmd,sdtstub)
     +
    -+$(modules:.ko=.mod.o): %.mod.o: %.mod.c %.sdtinfo.c FORCE
    ++%.mod.o: %.mod.c %.sdtinfo.c FORCE
     +	$(call if_changed_dep,cc_o_c)
     +
     +$(modules:.ko=.sdtstub.o): %.sdtstub.o: %.sdtstub.S
    @@ scripts/Makefile.modpost: modules-modpost:
     +
     +else
      
    - $(modules:.ko=.mod.o): %.mod.o: %.mod.c FORCE
    + %.mod.o: %.mod.c FORCE
      	$(call if_changed_dep,cc_o_c)
      
     +module-sdt-modular-prereq =
    @@ scripts/Makefile.modpost: modules-modpost:
     +
     +endif
     +
    - targets += $(modules:.ko=.mod.o)
    + # Generate CTF for the entire kernel, or for the module alone if this is a
    + # build of an external module.
      
    - # Step 6), generate CTF for the entire kernel (in a separate $(CTF_FILENAME)),
    -@@ scripts/Makefile.modpost: $(all-module-ctfs): $(ctf-stamp)
    - 
    - endif
    +@@ scripts/Makefile.modfinal: $(1) $(wordlist 1,1024,$(2))
    + $(if $(word 1025,$(2)),$(call xargs,$(1),$(wordlist 1025,$(words $(2)),$(2))))
    + endef
      
    --$(ctf-filelist): $(ctf-builtins-prereq) $(ctf-modules)
    -+$(ctf-filelist): $(ctf-builtins-prereq) $(ctf-modules) | $(sdtinfo-prereq)
    - 	@rm -f $(ctf-filelist);
    +-$(ctf-filelist-raw): $(ctf-builtins-prereq) $(ctf-modules)
    ++$(ctf-filelist-raw): $(ctf-builtins-prereq) $(ctf-modules) | $(sdtinfo-prereq)
    + 	@rm -f $(ctf-filelist-raw);
      	@if [[ -n "$(ctf-dir-mk)" ]]; then \
      		mkdir -p "$(ctf-dir-mk)"; \
    -@@ scripts/Makefile.modpost: $(CTF_FILENAME): $(ctf-filelist)
    +@@ scripts/Makefile.modfinal: vmlinux.ctfa: $(ctf-filelist)
      else
      
      # The CTF depends on the output CTF file list, and that depends
    @@ scripts/Makefile.modpost: $(CTF_FILENAME): $(ctf-filelist)
      $(ctf-stamp): $(ctf-filelist)
      	$(call if_changed,ctf)
      	@shopt -s nullglob; \
    -@@ scripts/Makefile.modpost: quiet_cmd_ld_ko_o = LD [M]  $@
    +@@ scripts/Makefile.modfinal: quiet_cmd_ld_ko_o = LD [M]  $@
              $(OBJCOPY) $(module-ctf-flags) $@.tmp $@ && rm -f $@.tmp ;	\
      	$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
      
    --$(modules): %.ko : %.o %.mod.o $(module-ctfs-modular-prereq) FORCE
    -+$(modules): %.ko : %.o %.mod.o $(module-sdt-modular-prereq) $(module-ctfs-modular-prereq) FORCE
    +-$(modules): %.ko: %.o %.mod.o $(KBUILD_LDS_MODULE) $(module-ctfs-modular-prereq) FORCE
    ++$(modules): %.ko: %.o %.mod.o $(KBUILD_LDS_MODULE) $(module-sdt-modular-prereq) $(module-ctfs-modular-prereq) FORCE
      	$(call cmd_touch_ctf)
      	+$(call if_changed,ld_ko_o)
      
    @@ scripts/link-vmlinux.sh: info()
      # ${1} output file
      modpost_link()
     @@ scripts/link-vmlinux.sh: modpost_link()
    + 
      # Link of vmlinux
    - # ${1} - optional extra .o files
    - # ${2} - output file
    -+# ${3} - optional extra ld flag(s)
    + # ${1} - output file
    +-# ${2}, ${3}, ... - optional extra .o files
    ++# ${2} - optional extra ld flag(s)
    ++# ${3}, ${4}, ... - optional extra .o files
      vmlinux_link()
      {
      	local lds="${objtree}/${KBUILD_LDS}"
    + 	local output=${1}
    ++	local flags="${2}"
    + 	local objects
    + 
    + 	info LD ${output}
    + 
    +-	# skip output file argument
    ++	# skip output file and flags arguments
    ++	shift
    + 	shift
    + 
    + 	if [ "${SRCARCH}" != "um" ]; then
     @@ scripts/link-vmlinux.sh: vmlinux_link()
    - 			-Map=.tmp_vmlinux.map			\
    - 			${1}"
    + 			${@}"
      
    --		${LD} ${KBUILD_LDFLAGS} ${LDFLAGS_vmlinux} -o ${2}	\
    -+		${LD} ${KBUILD_LDFLAGS} ${LDFLAGS_vmlinux} ${3} -o ${2}	\
    + 		${LD} ${KBUILD_LDFLAGS} ${LDFLAGS_vmlinux}	\
    +-			-o ${output}				\
    ++			${flags} -o ${output}			\
      			-T ${lds} ${objects}
      	else
      		objects="-Wl,--whole-archive			\
     @@ scripts/link-vmlinux.sh: vmlinux_link()
    - 			-Wl,-Map=.tmp_vmlinux.map		\
    - 			${1}"
    + 			${@}"
      
    --		${CC} ${CFLAGS_vmlinux} -o ${2}			\
    -+		${CC} ${CFLAGS_vmlinux} ${3} -o ${2}			\
    + 		${CC} ${CFLAGS_vmlinux}				\
    +-			-o ${output}				\
    ++			${flags} -o ${output}			\
      			-Wl,-T,${lds}				\
      			${objects}				\
      			-lutil -lrt -lpthread
    +@@ scripts/link-vmlinux.sh: kallsyms_step()
    + 	kallsymso=.tmp_kallsyms${1}.o
    + 	kallsyms_vmlinux=.tmp_vmlinux${1}
    + 
    +-	vmlinux_link ${kallsyms_vmlinux} "${kallsymso_prev}" ${btf_vmlinux_bin_o}
    ++	vmlinux_link ${kallsyms_vmlinux} "${2:-}" "${kallsymso_prev}" ${btf_vmlinux_bin_o} ${sdtstubo} ${sdtinfoo}
    + 	kallsyms ${kallsyms_vmlinux} ${kallsymso}
    + }
    + 
     @@ scripts/link-vmlinux.sh: cleanup()
    - {
    + 	rm -f .btf.*
      	rm -f .tmp_System.map
      	rm -f .tmp_kallsyms*
     +	rm -f .tmp_sdtstub.*
    @@ scripts/link-vmlinux.sh: fi;
      info LD vmlinux.o
      modpost_link vmlinux.o
     @@ scripts/link-vmlinux.sh: if [ -n "${CONFIG_KALLSYMS}" ]; then
    - 	kallsymso=.tmp_kallsyms2.o
    - 	kallsyms_vmlinux=.tmp_vmlinux2
    + 	# a)  Verify that the System.map from vmlinux matches the map from
    + 	#     ${kallsymso}.
      
    ++	# step 1
     +	if [ -n "${CONFIG_DTRACE}" ]; then
     +		sdtinfo vmlinux.o ${sdtinfoo}
     +	fi
     +
    - 	# step 1
    --	vmlinux_link "" .tmp_vmlinux1
    -+	vmlinux_link "${sdtstubo} ${sdtinfoo}" .tmp_vmlinux1
    - 	kallsyms .tmp_vmlinux1 .tmp_kallsyms1.o
    - 
    + 	kallsyms_step 1
    ++
     +	if [ -n "${CONFIG_DTRACE}" ]; then
     +		if [ -n "${CONFIG_ARM64}" ]; then
    -+			vmlinux_link "${sdtstubo} ${sdtinfoo}" .tmp_vmlinux1
    ++			kallsyms_step 1
     +		else
    -+			vmlinux_link "${sdtstubo} ${sdtinfoo}" .tmp_vmlinux1 "-r"
    ++			kallsyms_step 1 -r
     +		fi
    -+		sdtinfo .tmp_vmlinux1 ${sdtinfoo}
    ++		sdtinfo ${kallsyms_vmlinux} ${sdtinfoo}
     +	fi
     +
    - 	# step 2
    --	vmlinux_link .tmp_kallsyms1.o .tmp_vmlinux2
    -+	vmlinux_link "${sdtstubo} .tmp_kallsyms1.o ${sdtinfoo}" .tmp_vmlinux2
    - 	kallsyms .tmp_vmlinux2 .tmp_kallsyms2.o
    ++	# step 2
    + 	kallsyms_step 2
      
      	# step 3
     @@ scripts/link-vmlinux.sh: if [ -n "${CONFIG_KALLSYMS}" ]; then
    - 		kallsymso=.tmp_kallsyms3.o
    - 		kallsyms_vmlinux=.tmp_vmlinux3
    - 
    --		vmlinux_link .tmp_kallsyms2.o .tmp_vmlinux3
    -+		vmlinux_link "${sdtstubo} .tmp_kallsyms2.o ${sdtinfoo}" .tmp_vmlinux3
    - 
    - 		kallsyms .tmp_vmlinux3 .tmp_kallsyms3.o
      	fi
      fi
      
    - info LD vmlinux
    --vmlinux_link "${kallsymso}" vmlinux
    -+vmlinux_link "${sdtstubo} ${kallsymso} ${sdtinfoo}" vmlinux
    +-vmlinux_link vmlinux "${kallsymso}" ${btf_vmlinux_bin_o}
    ++vmlinux_link vmlinux "" "${kallsymso}" ${btf_vmlinux_bin_o}
      
    - if [ -n "${CONFIG_DEBUG_INFO_BTF}" ]; then
    - 	gen_btf vmlinux
    + if [ -n "${CONFIG_BUILDTIME_EXTABLE_SORT}" ]; then
    + 	info SORTEX vmlinux
     
      ## scripts/mod/modpost.c ##
     @@ scripts/mod/modpost.c: static int check_exports(struct module *mod)
 9:  0b159660d67f =  9:  b697089b3658 dtrace: sdt provider for x86
10:  5755df33bc40 = 10:  60a50db03e1a dtrace: profile provider and test probe core components
11:  3ffd3a8060a9 = 11:  82090b29b3b7 dtrace: profile and tick providers built on cyclics
12:  9ae71be3a801 = 12:  59c9af8db346 dtrace: USDT and pid provider core and x86 components
13:  847e53456af7 = 13:  44997711616f dtrace: USDT and pid providers
14:  a643a355967a ! 14:  a367c4a749ba dtrace: function boundary tracing (FBT) core and x86 components
    @@ arch/x86/kernel/nmi.c: static bool notrace is_debug_stack(unsigned long addr)
     +dotraplinkage notrace int
      do_nmi(struct pt_regs *regs, long error_code)
      {
    + 	if (IS_ENABLED(CONFIG_SMP) && cpu_is_offline(smp_processor_id()))
    +@@ arch/x86/kernel/nmi.c: do_nmi(struct pt_regs *regs, long error_code)
    + 
      	if (this_cpu_read(nmi_state) != NMI_NOT_RUNNING) {
      		this_cpu_write(nmi_state, NMI_LATCHED);
     -		return;
15:  016694267d84 = 15:  9875695bdf8f dtrace: fbt provider, modular components
16:  5c4b4c33d778 ! 16:  6e55d402cba3 dtrace, arm: arm64 port
    @@ scripts/link-vmlinux.sh: sdtinfo()
      	local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL}               \
      		      ${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS}"
     @@ scripts/link-vmlinux.sh: if [ -n "${CONFIG_KALLSYMS}" ]; then
    - 	kallsyms_vmlinux=.tmp_vmlinux2
      
    + 	# step 1
      	if [ -n "${CONFIG_DTRACE}" ]; then
     -		sdtinfo vmlinux.o ${sdtinfoo}
     +		sdtinfo vmlinux.o ${sdtinfoo} vmlinux.o
      	fi
      
    - 	# step 1
    -@@ scripts/link-vmlinux.sh: if [ -n "${CONFIG_KALLSYMS}" ]; then
    - 	kallsyms .tmp_vmlinux1 .tmp_kallsyms1.o
    + 	kallsyms_step 1
      
      	if [ -n "${CONFIG_DTRACE}" ]; then
     -		if [ -n "${CONFIG_ARM64}" ]; then
    --			vmlinux_link "${sdtstubo} ${sdtinfoo}" .tmp_vmlinux1
    +-			kallsyms_step 1
     -		else
    --			vmlinux_link "${sdtstubo} ${sdtinfoo}" .tmp_vmlinux1 "-r"
    +-			kallsyms_step 1 -r
     +		if [ -n "${CONFIG_X86_64}" ]; then
    -+			vmlinux_link "${sdtstubo} ${sdtinfoo}" .tmp_vmlinux1 \
    -+				     "--emit-relocs"
    ++			kallsyms_step 1 --emit-relocs
      		fi
    --		sdtinfo .tmp_vmlinux1 ${sdtinfoo}
    -+		sdtinfo .tmp_vmlinux1 ${sdtinfoo} vmlinux.o
    + 		sdtinfo ${kallsyms_vmlinux} ${sdtinfoo}
      	fi
    - 
    - 	# step 2
17:  a021b6b1e953 ! 17:  cc3b02f5a7af dtrace: add SDT probes
    @@ net/ipv4/tcp_input.c: static int tcp_rcv_synsent_state_process(struct sock *sk,
      			goto discard;
      		}
     @@ net/ipv4/tcp_input.c: int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
    - 			tp->copied_seq = tp->rcv_nxt;
    + 			WRITE_ONCE(tp->copied_seq, tp->rcv_nxt);
      		}
      		smp_mb();
     +
    @@ net/ipv4/tcp_ipv4.c: void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb
       *	This routine will send an RST to the other tcp.
       *
     @@ net/ipv4/tcp_ipv4.c: static void tcp_v4_send_reset(const struct sock *sk, struct sk_buff *skb)
    - 				   inet_twsk(sk)->tw_mark : sk->sk_mark;
    + 				   inet_twsk(sk)->tw_priority : sk->sk_priority;
      		transmit_time = tcp_transmit_time(sk);
      	}
     +
    @@ net/ipv4/tcp_ipv4.c: static void tcp_v4_send_reset(const struct sock *sk, struct
      			      skb, &TCP_SKB_CB(skb)->header.h4.opt,
      			      ip_hdr(skb)->saddr, ip_hdr(skb)->daddr,
     @@ net/ipv4/tcp_ipv4.c: static void tcp_v4_send_ack(const struct sock *sk,
    - 	ctl_sk->sk_mark = (sk->sk_state == TCP_TIME_WAIT) ?
    - 			   inet_twsk(sk)->tw_mark : sk->sk_mark;
    + 	ctl_sk->sk_priority = (sk->sk_state == TCP_TIME_WAIT) ?
    + 			   inet_twsk(sk)->tw_priority : sk->sk_priority;
      	transmit_time = tcp_transmit_time(sk);
     +
     +	if (DTRACE_TCP_ENABLED(send)) {
    @@ net/ipv6/tcp_ipv6.c: static int tcp_v6_send_synack(const struct sock *sk, struct
     +					   int, DTRACE_NET_PROBE_OUTBOUND);
     +		}
     +
    - 		err = ip6_xmit(sk, skb, fl6, sk->sk_mark, opt, np->tclass);
    + 		err = ip6_xmit(sk, skb, fl6, sk->sk_mark, opt, np->tclass,
    + 			       sk->sk_priority);
      		rcu_read_unlock();
    - 		err = net_xmit_eval(err);
     @@ net/ipv6/tcp_ipv6.c: static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32
      	dst = ip6_dst_lookup_flow(ctl_sk, &fl6, NULL);
      	if (!IS_ERR(dst)) {
    @@ net/ipv6/tcp_ipv6.c: static void tcp_v6_send_response(const struct sock *sk, str
     +						   DTRACE_NET_PROBE_OUTBOUND);
     +		}
     +
    - 		ip6_xmit(ctl_sk, buff, &fl6, fl6.flowi6_mark, NULL, tclass);
    + 		ip6_xmit(ctl_sk, buff, &fl6, fl6.flowi6_mark, NULL, tclass,
    + 			 priority);
      		TCP_INC_STATS(net, TCP_MIB_OUTSEGS);
    - 		if (rst)
     @@ net/ipv6/tcp_ipv6.c: INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff *skb)
      	const struct tcphdr *th;
      	const struct ipv6hdr *hdr;
18:  d90b31be2e1f = 18:  7b857175d21c dtrace: add rcu_irq_exit and rcu_nmi_exit_common to FBT blacklist
19:  bfd2f506f83a = 19:  f7343dcac6b0 dtrace: add sample script for building DTrace on Fedora
20:  f5b6475d15c1 <  -:  ------------ ctf: avoid command line length limits
 -:  ------------ > 20:  bb0c675b71b9 locking: publicize mutex_owner and mutex_owned again
 -:  ------------ > 21:  660199c1d276 fixup! dtrace: function boundary tracing (FBT) core and x86 components
 -:  ------------ > 22:  a10d7e80145d fixup! dtrace: sdt provider core components
 -:  ------------ > 23:  c4590b9a8fbe fixup! dtrace: modular components and x86 support
 -:  ------------ > 24:  caf7c2d41ac1 fixup! dtrace: add SDT probes



More information about the DTrace-devel mailing list