[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 134/150] meson: convert systemtap files
From: |
Paolo Bonzini |
Subject: |
[PATCH 134/150] meson: convert systemtap files |
Date: |
Mon, 17 Aug 2020 16:40:37 +0200 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile.target | 85 ++---------------------------------------------
meson.build | 26 +++++++++++++++
rules.mak | 3 --
trace/meson.build | 14 ++++----
4 files changed, 35 insertions(+), 93 deletions(-)
diff --git a/Makefile.target b/Makefile.target
index 8ee4c78b3f..a07149c0a6 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -6,88 +6,7 @@ include ../config-host.mak
include config-target.mak
include $(SRC_PATH)/rules.mak
-$(call set-vpath, $(SRC_PATH):$(BUILD_DIR))
-
-ifdef CONFIG_USER_ONLY
-# user emulator name
-QEMU_PROG=qemu-$(TARGET_NAME)
-else
-# system emulator name
-QEMU_PROG=qemu-system-$(TARGET_NAME)$(EXESUF)
-endif
-
-STPFILES=
-
-ifdef CONFIG_TRACE_SYSTEMTAP
-stap: $(QEMU_PROG).stp-installed $(QEMU_PROG).stp $(QEMU_PROG)-simpletrace.stp
$(QEMU_PROG)-log.stp
-
-ifdef CONFIG_USER_ONLY
-TARGET_TYPE=user
-else
-TARGET_TYPE=system
-endif
-
-tracetool-y = $(SRC_PATH)/scripts/tracetool.py
-tracetool-y += $(shell find $(SRC_PATH)/scripts/tracetool -name "*.py")
-
-$(QEMU_PROG).stp-installed: $(BUILD_DIR)/trace/trace-events-all $(tracetool-y)
- $(call quiet-command,$(TRACETOOL) \
- --group=all \
- --format=stap \
- --backends=$(TRACE_BACKENDS) \
- --binary=$(bindir)/$(QEMU_PROG) \
- --target-name=$(TARGET_NAME) \
- --target-type=$(TARGET_TYPE) \
- $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG).stp-installed")
-
-$(QEMU_PROG).stp: $(BUILD_DIR)/trace/trace-events-all $(tracetool-y)
- $(call quiet-command,$(TRACETOOL) \
- --group=all \
- --format=stap \
- --backends=$(TRACE_BACKENDS) \
- --binary=$(realpath .)/$(QEMU_PROG) \
- --target-name=$(TARGET_NAME) \
- --target-type=$(TARGET_TYPE) \
- $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG).stp")
-
-$(QEMU_PROG)-simpletrace.stp: $(BUILD_DIR)/trace/trace-events-all
$(tracetool-y)
- $(call quiet-command,$(TRACETOOL) \
- --group=all \
- --format=simpletrace-stap \
- --backends=$(TRACE_BACKENDS) \
- --probe-prefix=qemu.$(TARGET_TYPE).$(TARGET_NAME) \
- $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG)-simpletrace.stp")
-
-$(QEMU_PROG)-log.stp: $(BUILD_DIR)/trace/trace-events-all $(tracetool-y)
- $(call quiet-command,$(TRACETOOL) \
- --group=all \
- --format=log-stap \
- --backends=$(TRACE_BACKENDS) \
- --probe-prefix=qemu.$(TARGET_TYPE).$(TARGET_NAME) \
- $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG)-log.stp")
-
-else
-stap:
-endif
-.PHONY: stap
-
-all: stap
-
-clean:
- rm -f *.a *~
- rm -f $(shell find . -name '*.[od]')
- rm -f hmp-commands.h gdbstub-xml.c
- rm -f trace/generated-helpers.c trace/generated-helpers.c-timestamp
-ifdef CONFIG_TRACE_SYSTEMTAP
- rm -f *.stp
-endif
-
+all:
install: all
-ifdef CONFIG_TRACE_SYSTEMTAP
- $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
- $(INSTALL_DATA) $(QEMU_PROG).stp-installed
"$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG).stp"
- $(INSTALL_DATA) $(QEMU_PROG)-simpletrace.stp
"$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG)-simpletrace.stp"
- $(INSTALL_DATA) $(QEMU_PROG)-log.stp
"$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG)-log.stp"
-endif
-
+
.PHONY: all clean install
diff --git a/meson.build b/meson.build
index 6de00f8bb4..8ff7aada2c 100644
--- a/meson.build
+++ b/meson.build
@@ -819,6 +819,7 @@ common_all = static_library('common',
name_suffix: 'fa')
feature_to_c = find_program('scripts/feature_to_c.sh')
+tracetool = find_program('scripts/tracetool.py')
emulators = []
foreach target : target_dirs
@@ -954,6 +955,31 @@ foreach target : target_dirs
link_depends: [block_syms, qemu_syms] + exe.get('link_depends',
[]),
link_args: link_args,
gui_app: exe['gui'])
+
+ if 'CONFIG_TRACE_SYSTEMTAP' in config_host
+ foreach stp: [
+ {'ext': '.stp-build', 'fmt': 'stap', 'bin': meson.current_build_dir()
/ exe_name, 'install': false},
+ {'ext': '.stp', 'fmt': 'stap', 'bin': get_option('prefix') /
get_option('bindir') / exe_name, 'install': true},
+ {'ext': '-simpletrace.stp', 'fmt': 'simpletrace-stap', 'bin': '',
'install': true},
+ {'ext': '-log.stp', 'fmt': 'log-stap', 'bin': '', 'install': true},
+ ]
+ custom_target(exe_name + stp['ext'],
+ input: trace_events_all,
+ output: exe_name + stp['ext'],
+ capture: true,
+ install: stp['install'],
+ install_dir: config_host['qemu_datadir'] /
'../systemtap/tapset',
+ command: [
+ tracetool, '--group=all', '--format=' + stp['fmt'],
+ '--backends=' + config_host['TRACE_BACKENDS'],
+ '--binary=' + stp['bin'],
+ '--target-name=' + target_name,
+ '--target-type=' + target_type,
+ '--probe-prefix=qemu.' + target_type + '.' +
target_name,
+ '@INPUT@',
+ ])
+ endforeach
+ endif
endforeach
endforeach
diff --git a/rules.mak b/rules.mak
index 6488dc3dc6..b983c7f83f 100644
--- a/rules.mak
+++ b/rules.mak
@@ -199,9 +199,6 @@ ne = $(if $(subst $2,,$1)$(subst $1,,$2),y,n)
isempty = $(if $1,n,y)
notempty = $(if $1,y,n)
-# Generate files with tracetool
-TRACETOOL=$(PYTHON) $(SRC_PATH)/scripts/tracetool.py
-
.PHONY: clean-timestamp
clean-timestamp:
rm -f *.timestamp
diff --git a/trace/meson.build b/trace/meson.build
index 9c3c128164..56e870848e 100644
--- a/trace/meson.build
+++ b/trace/meson.build
@@ -49,13 +49,13 @@ foreach dir : [ '.' ] + trace_events_subdirs
endif
endforeach
-custom_target('trace-events-all',
- output: 'trace-events-all',
- input: trace_events_files,
- command: [ 'cat', '@INPUT@' ],
- capture: true,
- install: true,
- install_dir: config_host['qemu_datadir'])
+trace_events_all = custom_target('trace-events-all',
+ output: 'trace-events-all',
+ input: trace_events_files,
+ command: [ 'cat', '@INPUT@' ],
+ capture: true,
+ install: true,
+ install_dir: config_host['qemu_datadir'])
foreach d : [
['generated-tcg-tracers.h', 'tcg-h'],
--
2.26.2
- [PATCH 125/150] meson: convert hw/9pfs, cleanup, (continued)
- [PATCH 125/150] meson: convert hw/9pfs, cleanup, Paolo Bonzini, 2020/08/17
- [PATCH 126/150] meson: convert hw/arch*, Paolo Bonzini, 2020/08/17
- [PATCH 127/150] meson: target, Paolo Bonzini, 2020/08/17
- [PATCH 128/150] meson: accel, Paolo Bonzini, 2020/08/17
- [PATCH 129/150] meson: linux-user, Paolo Bonzini, 2020/08/17
- [PATCH 130/150] meson: bsd-user, Paolo Bonzini, 2020/08/17
- [PATCH 132/150] meson: plugins, Paolo Bonzini, 2020/08/17
- [PATCH 131/150] meson: cpu-emu, Paolo Bonzini, 2020/08/17
- [PATCH 135/150] rules.mak: remove version.o, Paolo Bonzini, 2020/08/17
- [PATCH 133/150] meson: link emulators without Makefile.target, Paolo Bonzini, 2020/08/17
- [PATCH 134/150] meson: convert systemtap files,
Paolo Bonzini <=
- [PATCH 136/150] remove Makefile.target, Paolo Bonzini, 2020/08/17
- [PATCH 138/150] docs: automatically track manual dependencies, Paolo Bonzini, 2020/08/17
- [PATCH 137/150] meson: sphinx-build, Paolo Bonzini, 2020/08/17
- [PATCH 139/150] meson: build texi doc, Paolo Bonzini, 2020/08/17
- [PATCH 140/150] meson: convert check-block, Paolo Bonzini, 2020/08/17
- [PATCH 142/150] meson: replace create-config with meson configure_file, Paolo Bonzini, 2020/08/17
- [PATCH 143/150] meson: convert sample plugins, Paolo Bonzini, 2020/08/17
- [PATCH 144/150] meson: move SDL and SDL-image detection to meson, Paolo Bonzini, 2020/08/17
- [PATCH 145/150] meson: convert VNC and dependent libraries to meson, Paolo Bonzini, 2020/08/17
- [PATCH 147/150] meson: avoid unstable module warning with Meson 0.56.0 or newer, Paolo Bonzini, 2020/08/17