Change in vdsm[master]: daemon: tracemalloc: LD_PRELOAD support

fromani at redhat.com fromani at redhat.com
Thu Oct 22 07:40:39 UTC 2015


Francesco Romani has uploaded a new change for review.

Change subject: daemon: tracemalloc: LD_PRELOAD support
......................................................................

daemon: tracemalloc: LD_PRELOAD support

In order to integrate tracemalloc, we may need a special-purpose
libpython. This change makes it easy to use it into VDSM.

Change-Id: I3b26a4d156394631345b0a60f212effdaef48503
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M .gitignore
M debian/vdsm.install
M init/Makefile.am
M init/systemd/vdsmd.service.in
A init/vdsmd.in
M vdsm.spec.in
6 files changed, 18 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/23/47623/1

diff --git a/.gitignore b/.gitignore
index 3c6c9e8..8c4afda 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,6 +29,7 @@
 init/systemd/vdsm-network.service
 init/systemd/mom-vdsm.service
 init/vdsmd_init_common.sh
+init/vdsmd
 lib/vdsm/config.py
 lib/vdsm/constants.py
 lib/vdsm/tool/validate_ovirt_certs.py
diff --git a/debian/vdsm.install b/debian/vdsm.install
index c9666f5..117b867 100644
--- a/debian/vdsm.install
+++ b/debian/vdsm.install
@@ -31,6 +31,7 @@
 ./usr/libexec/vdsm/unpersist-vdsm-hook
 ./usr/libexec/vdsm/vdsm-gencerts.sh
 ./usr/libexec/vdsm/vdsmd_init_common.sh
+./usr/bin/vdsmd
 ./usr/share/man/man8/vdsmd.8
 ./usr/share/vdsm/API.py
 ./usr/share/vdsm/alignmentScan.py
diff --git a/init/Makefile.am b/init/Makefile.am
index 62a226b..69e2e2a 100644
--- a/init/Makefile.am
+++ b/init/Makefile.am
@@ -22,6 +22,10 @@
 
 include $(top_srcdir)/build-aux/Makefile.subs
 
+bin_SCRIPTS = \
+	vdsmd \
+	$(NULL)
+
 nodist_vdsmexec_SCRIPTS = \
 	vdsmd_init_common.sh \
 	$(NULL)
@@ -36,6 +40,7 @@
 	$(NULL)
 
 EXTRA_DIST = \
+	vdsmd.in \
 	vdsmd_init_common.sh.in \
 	$(NULL)
 
diff --git a/init/systemd/vdsmd.service.in b/init/systemd/vdsmd.service.in
index d7d025f..1627af6 100644
--- a/init/systemd/vdsmd.service.in
+++ b/init/systemd/vdsmd.service.in
@@ -13,7 +13,7 @@
 LimitCORE=infinity
 EnvironmentFile=-/etc/sysconfig/vdsm
 ExecStartPre=@LIBEXECDIR@/vdsmd_init_common.sh --pre-start
-ExecStart=@VDSMDIR@/daemonAdapter -0 /dev/null -1 /dev/null -2 /dev/null "@VDSMDIR@/vdsm"
+ExecStart=@BINDIR@/vdsmd
 ExecStopPost=@LIBEXECDIR@/vdsmd_init_common.sh --post-stop
 Restart=always
 Nice=-20
diff --git a/init/vdsmd.in b/init/vdsmd.in
new file mode 100644
index 0000000..075fb79
--- /dev/null
+++ b/init/vdsmd.in
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+. /etc/sysconfig/vdsm
+
+if [ "$TRACEMALLOC" == "yes" ]; then
+	export LD_PRELOAD=@LIBDIR@/libpython2.7_tm.so
+fi
+
+exec @VDSMDIR@/daemonAdapter -0 /dev/null -1 /dev/null -2 /dev/null "@VDSMDIR@/vdsm"
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 32a1e38..d4b4d0f 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -862,6 +862,7 @@
 %{_libexecdir}/%{vdsm_name}/ovirt_functions.sh
 %{_libexecdir}/%{vdsm_name}/vdsm-gencerts.sh
 %{_libexecdir}/%{vdsm_name}/vdsmd_init_common.sh
+%{_bindir}/vdsmd
 %{_datadir}/%{vdsm_name}/network/__init__.py*
 %{_datadir}/%{vdsm_name}/network/api.py*
 %{_datadir}/%{vdsm_name}/network/configurators/__init__.py*


-- 
To view, visit https://gerrit.ovirt.org/47623
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3b26a4d156394631345b0a60f212effdaef48503
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>


More information about the vdsm-patches mailing list