diff mbox series

[Unstable] UBUNTU: [Debian] install kvm_stat systemd service

Message ID 20210531150455.51804-1-krzysztof.kozlowski@canonical.com
State New
Headers show
Series [Unstable] UBUNTU: [Debian] install kvm_stat systemd service | expand

Commit Message

Krzysztof Kozlowski May 31, 2021, 3:04 p.m. UTC
Install the kvm_stat systemd service in linux-host-tools package,
disabled by default.  The service logs KVM kernel module trace events to
/var/log/kvm_stat.csv.

This tool is useful for observing guest behavior from the host
perspective.  Often conclusions about performance or buggy behavior can
be drawn from the output.

BugLink: https://bugs.launchpad.net/bugs/1921870
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
---
 debian/rules.d/3-binary-indep.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Tim Gardner June 1, 2021, 12:05 p.m. UTC | #1
Acked-by: Tim Gardner <tim.gardner@canonical.com>

Just another tool that doesn't run until activated.

On 5/31/21 9:04 AM, Krzysztof Kozlowski wrote:
> Install the kvm_stat systemd service in linux-host-tools package,
> disabled by default.  The service logs KVM kernel module trace events to
> /var/log/kvm_stat.csv.
> 
> This tool is useful for observing guest behavior from the host
> perspective.  Often conclusions about performance or buggy behavior can
> be drawn from the output.
> 
> BugLink: https://bugs.launchpad.net/bugs/1921870
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> ---
>   debian/rules.d/3-binary-indep.mk | 10 ++++++++++
>   1 file changed, 10 insertions(+)
> 
> diff --git a/debian/rules.d/3-binary-indep.mk b/debian/rules.d/3-binary-indep.mk
> index 511a5eb39211..6a44129678b2 100644
> --- a/debian/rules.d/3-binary-indep.mk
> +++ b/debian/rules.d/3-binary-indep.mk
> @@ -88,6 +88,7 @@ install-tools: toolsbashcomp = $(CURDIR)/debian/$(toolspkg)/usr/share/bash-compl
>   install-tools: hosttoolspkg = $(hosttools_pkg_name)
>   install-tools: hosttoolsbin = $(CURDIR)/debian/$(hosttoolspkg)/usr/bin
>   install-tools: hosttoolsman = $(CURDIR)/debian/$(hosttoolspkg)/usr/share/man
> +install-tools: hosttoolssystemd = $(CURDIR)/debian/$(hosttoolspkg)/lib/systemd/system
>   install-tools: cloudpkg = $(cloud_common_pkg_name)
>   install-tools: cloudbin = $(CURDIR)/debian/$(cloudpkg)/usr/bin
>   install-tools: cloudsbin = $(CURDIR)/debian/$(cloudpkg)/usr/sbin
> @@ -159,8 +160,11 @@ endif
>   ifeq ($(do_tools_host),true)
>   	install -d $(hosttoolsbin)
>   	install -d $(hosttoolsman)/man1
> +	install -d $(hosttoolssystemd)
>   
>   	install -m 755 $(CURDIR)/tools/kvm/kvm_stat/kvm_stat $(hosttoolsbin)/
> +	install -m 644 $(CURDIR)/tools/kvm/kvm_stat/kvm_stat.service \
> +		$(hosttoolssystemd)/
>   
>   	cd $(builddir)/tools/tools/kvm/kvm_stat && make man
>   	install -m644 $(builddir)/tools/tools/kvm/kvm_stat/*.1 \
> @@ -188,6 +192,7 @@ binary-headers: prepare-indep install-headers
>   	dh_builddeb -p$(indep_hdrpkg)
>   
>   binary-indep: cloudpkg = $(cloud_common_pkg_name)
> +binary-indep: hosttoolspkg = $(hosttools_pkg_name)
>   binary-indep: install-indep
>   	@echo Debug: $@
>   	dh_installchangelogs -i
> @@ -213,6 +218,11 @@ endif
>   	# and dh_systemd_start are called:
>   	dh_installinit -p$(cloudpkg) --no-start --no-enable --name intel-sgx-load-module
>   endif
> +endif
> +ifeq ($(do_tools_host),true)
> +	# Keep kvm_stat.service disabled by default (after dh_systemd_enable
> +	# and dh_systemd_start:
> +	dh_installinit -p$(hosttoolspkg) --no-enable --no-start --name kvm_stat
>   endif
>   	dh_installdeb -i
>   	$(lockme) dh_gencontrol -i
>
Paolo Pisati June 4, 2021, 9:08 a.m. UTC | #2
On Mon, May 31, 2021 at 05:04:55PM +0200, Krzysztof Kozlowski wrote:
> Install the kvm_stat systemd service in linux-host-tools package,
> disabled by default.  The service logs KVM kernel module trace events to
> /var/log/kvm_stat.csv.
> 
> This tool is useful for observing guest behavior from the host
> perspective.  Often conclusions about performance or buggy behavior can
> be drawn from the output.
> 
> BugLink: https://bugs.launchpad.net/bugs/1921870
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
diff mbox series

Patch

diff --git a/debian/rules.d/3-binary-indep.mk b/debian/rules.d/3-binary-indep.mk
index 511a5eb39211..6a44129678b2 100644
--- a/debian/rules.d/3-binary-indep.mk
+++ b/debian/rules.d/3-binary-indep.mk
@@ -88,6 +88,7 @@  install-tools: toolsbashcomp = $(CURDIR)/debian/$(toolspkg)/usr/share/bash-compl
 install-tools: hosttoolspkg = $(hosttools_pkg_name)
 install-tools: hosttoolsbin = $(CURDIR)/debian/$(hosttoolspkg)/usr/bin
 install-tools: hosttoolsman = $(CURDIR)/debian/$(hosttoolspkg)/usr/share/man
+install-tools: hosttoolssystemd = $(CURDIR)/debian/$(hosttoolspkg)/lib/systemd/system
 install-tools: cloudpkg = $(cloud_common_pkg_name)
 install-tools: cloudbin = $(CURDIR)/debian/$(cloudpkg)/usr/bin
 install-tools: cloudsbin = $(CURDIR)/debian/$(cloudpkg)/usr/sbin
@@ -159,8 +160,11 @@  endif
 ifeq ($(do_tools_host),true)
 	install -d $(hosttoolsbin)
 	install -d $(hosttoolsman)/man1
+	install -d $(hosttoolssystemd)
 
 	install -m 755 $(CURDIR)/tools/kvm/kvm_stat/kvm_stat $(hosttoolsbin)/
+	install -m 644 $(CURDIR)/tools/kvm/kvm_stat/kvm_stat.service \
+		$(hosttoolssystemd)/
 
 	cd $(builddir)/tools/tools/kvm/kvm_stat && make man
 	install -m644 $(builddir)/tools/tools/kvm/kvm_stat/*.1 \
@@ -188,6 +192,7 @@  binary-headers: prepare-indep install-headers
 	dh_builddeb -p$(indep_hdrpkg)
 
 binary-indep: cloudpkg = $(cloud_common_pkg_name)
+binary-indep: hosttoolspkg = $(hosttools_pkg_name)
 binary-indep: install-indep
 	@echo Debug: $@
 	dh_installchangelogs -i
@@ -213,6 +218,11 @@  endif
 	# and dh_systemd_start are called:
 	dh_installinit -p$(cloudpkg) --no-start --no-enable --name intel-sgx-load-module
 endif
+endif
+ifeq ($(do_tools_host),true)
+	# Keep kvm_stat.service disabled by default (after dh_systemd_enable
+	# and dh_systemd_start:
+	dh_installinit -p$(hosttoolspkg) --no-enable --no-start --name kvm_stat
 endif
 	dh_installdeb -i
 	$(lockme) dh_gencontrol -i