From a3573f174189e3e1523956c06e393e815f0939c6 Mon Sep 17 00:00:00 2001 From: Chuck Anderson Date: Sat, 28 May 2016 05:27:01 -0700 Subject: [PATCH] Revert "dtrace: support SDT in single-file modules" This reverts commit daf016df43a40608ca00906c9c42bcbdb48712e3. Orabug: 23344927 Acked-by: Chuck Anderson --- scripts/Makefile.build | 29 +++++++++++++++++++++++++++++ scripts/Makefile.modpost | 22 ++-------------------- scripts/mod/modpost.c | 3 +-- 3 files changed, 32 insertions(+), 22 deletions(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 01df30af4d4a..63645acf5d7a 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -380,9 +380,38 @@ $($(subst $(obj)/,,$(@:.o=-y)))), $^) quiet_cmd_link_multi-y = LD $@ cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalysis) +ifdef CONFIG_DTRACE + +# We need secondary expansion for the %.sdtstub.S creation rule +.SECONDEXPANSION: + +sdtgen = $(srctree)/scripts/dtrace_sdt.sh + +quiet_cmd_sdtstub = SDTSTB $@ + cmd_sdtstub = $(sdtgen) sdtstub $@ \ + $(filter $(addprefix $(obj)/, \ + $($(subst $(obj)/,,$(@:.sdtstub.S=-objs))) \ + $($(subst $(obj)/,,$(@:.sdtstub.S=-y)))), \ + $(subst |,,$(multi-objs-m))) + +$(multi-used-m:.o=.sdtstub.S) : %.sdtstub.S: $(multi-objs-m) + $(call if_changed,sdtstub) + +$(multi-used-m:.o=.sdtstub.o) : %.sdtstub.o: %.sdtstub.S + $(call if_changed,as_o_S) + +$(multi-used-m) : %.o: %.sdtstub.o + +quiet_cmd_link_multi-m = LD [M] $@ +cmd_link_multi-m = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $*.sdtstub.o $(cmd_secanalysis) + +else + quiet_cmd_link_multi-m = LD [M] $@ cmd_link_multi-m = $(cmd_link_multi-y) +endif + $(multi-used-y): FORCE $(call if_changed,link_multi-y) $(call multi_depend, $(multi-used-y), .o, -objs -y) diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 2ad9dd919661..9039cd5fb4d0 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -105,8 +105,7 @@ vmlinux.o: FORCE $(symverfile): __modpost ; $(modules:.ko=.mod.c): __modpost ; -# Step 5), compile all *.mod.c files (includes the generation of SDT data -# and SDT stubs) +# Step 5), compile all *.mod.c files (includes the generation of SDT data) # modname is set to make c_flags define KBUILD_MODNAME modname = $(notdir $(@:.mod.o=)) @@ -115,9 +114,6 @@ quiet_cmd_cc_o_c = CC $@ cmd_cc_o_c = $(CC) $(c_flags) $(KBUILD_CFLAGS_MODULE) $(CFLAGS_MODULE) \ -I$(dir $@) -c -o $@ $< -quiet_cmd_as_o_S = AS $@ - cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< - ifdef CONFIG_DTRACE sdtgen = $(srctree)/scripts/dtrace_sdt.sh @@ -125,30 +121,16 @@ sdtgen = $(srctree)/scripts/dtrace_sdt.sh quiet_cmd_sdtinfo = SDTINF $@ cmd_sdtinfo = $(sdtgen) sdtinfo $@ $< kmod -quiet_cmd_sdtstub = SDTSTB $@ - cmd_sdtstub = $(sdtgen) sdtstub $@ $< - $(modules:.ko=.sdtinfo.c): %.sdtinfo.c: %.o $(call cmd,sdtinfo) -$(modules:.ko=.sdtstub.S) : %.sdtstub.S: %.o - $(call cmd,sdtstub) - $(modules:.ko=.mod.o): %.mod.o: %.mod.c %.sdtinfo.c FORCE $(call if_changed_dep,cc_o_c) - -$(modules:.ko=.sdtstub.o): %.sdtstub.o: %.sdtstub.S - $(call if_changed,as_o_S) - -module-sdt-modular-prereq = %.sdtstub.o - else $(modules:.ko=.mod.o): %.mod.o: %.mod.c FORCE $(call if_changed_dep,cc_o_c) -module-sdt-modular-prereq = - endif targets += $(modules:.ko=.mod.o) @@ -282,7 +264,7 @@ quiet_cmd_ld_ko_o = LD [M] $@ $(patsubst $(ctf-dir)/%,,$(filter-out FORCE,$^)) && \ $(OBJCOPY) $(module-ctf-flags) $@.tmp $@ && rm -f $@.tmp -$(modules): %.ko : %.o %.mod.o $(module-sdt-modular-prereq) $(module-ctfs-modular-prereq) FORCE +$(modules): %.ko : %.o %.mod.o $(module-ctfs-modular-prereq) FORCE $(call cmd_touch_ctf) $(call if_changed,ld_ko_o) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 8ac053304ad3..148af0d92eae 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -2158,8 +2158,7 @@ static int add_versions(struct buffer *b, struct module *mod) for (s = mod->unres; s; s = s->next) { exp = find_symbol(s->name); if (!exp || exp->module == mod) { - if (have_vmlinux && !s->weak && - !strstarts(s->name, "__dtrace_probe_")) { + if (have_vmlinux && !s->weak) { if (warn_unresolved) { warn("\"%s\" [%s.ko] undefined!\n", s->name, mod->name); -- 2.50.1