diff --git a/src/Makefile.am b/src/Makefile.am index 8b679f610b..c71124cf19 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -405,27 +405,9 @@ libvirt_la_BUILT_LIBADD += libvirt_probes.lo libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o nodist_libvirt_la_SOURCES = libvirt_probes.h -BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp +BUILT_SOURCES += libvirt_functions.stp - -tapsetdir = $(datadir)/systemtap/tapset -tapset_DATA += libvirt_probes.stp libvirt_functions.stp - -%_probes.h: %_probes.d - $(AM_V_GEN)$(DTRACE) -o $@ -h -s $< - -.PRECIOUS: %_probes.o -%_probes.o: %_probes.d - $(AM_V_GEN)$(DTRACE) -o $@ -G -s $< - -%_probes.lo: %_probes.o - $(AM_V_GEN)printf %s\\n \ - '# $@ - a libtool object file' \ - '# Generated by libtool (GNU libtool) 2.4' \ - '# Actually generated by Makefile.am, in order to shut up libtool' \ - "pic_object='$<'" \ - "non_pic_object='$<'" \ - > $@ +tapset_DATA += libvirt_functions.stp # Keep this list synced with PROTOCOL_STRUCTS RPC_PROBE_FILES += $(srcdir)/rpc/virnetprotocol.x \ @@ -439,11 +421,6 @@ libvirt_functions.stp: $(RPC_PROBE_FILES) $(top_srcdir)/scripts/gensystemtap.py $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/gensystemtap.py \ $(RPC_PROBE_FILES) > $@ -%_probes.stp: %_probes.d $(top_srcdir)/scripts/dtrace2systemtap.py \ - $(top_builddir)/config.status - $(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/dtrace2systemtap.py \ - $(bindir) $(sbindir) $(libdir) $< > $@ - endif WITH_DTRACE_PROBES libvirt_qemu_la_SOURCES = libvirt-qemu.c diff --git a/src/meson.build b/src/meson.build index 83e22d5d43..bc90ea31a0 100644 --- a/src/meson.build +++ b/src/meson.build @@ -34,3 +34,45 @@ endif if conf.has('WITH_SECDRIVER_APPARMOR') secdriver_dep += apparmor_dep endif + + +# generate systemtap files + +systemtap_dir = datadir / 'systemtap' / 'tapset' + +dtrace_gen_headers = [] +dtrace_gen_objects = [] + +if conf.has('WITH_DTRACE_PROBES') + infile = 'libvirt_probes.d' + out_h = 'libvirt_probes.h' + out_o = 'libvirt_probes.o' + out_stp = 'libvirt_probes.stp' + + dtrace_gen_headers += custom_target( + out_h, + input: infile, + output: out_h, + command: [ dtrace_prog, '-o', '@OUTPUT@', '-h', '-s', '@INPUT@' ], + ) + + dtrace_gen_objects += custom_target( + out_o, + input: infile, + output: out_o, + command: [ dtrace_prog, '-o', '@OUTPUT@', '-G', '-s', '@INPUT@' ], + ) + + custom_target( + out_stp, + input: infile, + output: out_stp, + command: [ + meson_python_prog, python3_prog.path(), dtrace2systemtap_prog.path(), + bindir, sbindir, libdir, '@INPUT@' + ], + capture: true, + install: true, + install_dir: systemtap_dir, + ) +endif