Skip to contentSkip to conversation

dlm: debian patches and python

PATCH New Alexander Aring 1 participant 7 messages Dec 2, 2021

lore
Share & tools
lore
#0 lore raw

cover dlm: debian patches and python

Hi,

this patch contains patches from the debian dlm package which I want to sync to upstream. Also I resend the python bindings for libdlm again and add an example for make some histogram latency tracing between dlm_lock() and ast callback by using ebpf. You need the recent dlm tracepoint patches to use those examples.

- Alex

Alexander Aring (6):
init: Enable systemctl help dlm to show relevant man pages
dlm_controld: man: Fix typo: specfic => specific
stonith_helper: Fix gcc build warnings
stonith_helper: Don't link dlm_stonith against libxml2
python: add bindings and test example
python: add ebpf histogram example

 dlm_controld/dlm.conf.5         |   2 +-
 fence/Makefile                  |   2 -
 fence/stonith_helper.c          |   3 +-
 init/dlm.service                |   1 +
 python/README                   |   7 +
 python/bindings/__init__.py     |   0
 python/bindings/dlm.py          | 244 ++++++++++++++++++++++++++++++++
 python/ebpf/README              |   6 +
 python/ebpf/dlmhist.py          |  78 ++++++++++
 python/tests/dlm.py             |   1 +
 python/tests/recovery_interrupt |  60 ++++++++
 11 files changed, 399 insertions(+), 5 deletions(-)
 create mode 100644 python/README
 create mode 100644 python/bindings/__init__.py
 create mode 100644 python/bindings/dlm.py
 create mode 100644 python/ebpf/README
 create mode 100755 python/ebpf/dlmhist.py
 create mode 120000 python/tests/dlm.py
 create mode 100755 python/tests/recovery_interrupt
Signature · 1 line
2.27.0
#1 lore raw

PATCH 1/6 init: Enable systemctl help dlm to show relevant man pages

Took it from the debian patches. This patch adds entries to the systemd unit file to reference relevant man pages.

---
 init/dlm.service | 1 +
 1 file changed, 1 insertion(+)
init/dlm.service +1 -0
index 1db59251..6def985b 100644
@@ -2,6 +2,7 @@
 Description=dlm control daemon
 Requires=corosync.service sys-kernel-config.mount
 After=corosync.service sys-kernel-config.mount
+Documentation=man:dlm_controld man:dlm.conf man:dlm_stonith
 
 [Service]
 OOMScoreAdjust=-1000
Signature · 1 line
2.27.0
#2 lore raw

PATCH 2/6 dlm_controld: man: Fix typo: specfic => specific

In reply to Alexander Aring

Took it from the debian patches. This patch fixes a typo in the dlm.conf man page.

---
 dlm_controld/dlm.conf.5 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dlm_controld/dlm.conf.5 +1 -1
index 0eb22635..164b5b70 100644
@@ -413,7 +413,7 @@ pairs.
 .B mark
 The mark key can be used to set a specific mark value which is then used
 by the in-kernel DLM socket creation. This can be used to match for DLM
-specfic packets for e.g. routing.
+specific packets for e.g. routing.
 
 Example of setting a per socket value for nodeid 1 and a mark value
 of 42:
Signature · 1 line
2.27.0
#3 lore raw

PATCH 3/6 stonith_helper: Fix gcc build warnings

In reply to Alexander Aring

Took it from the debian patches. The return value of getopt() is int not char. This patch switches the return value which is stored in variable c to int.

---
 fence/stonith_helper.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fence/stonith_helper.c +1 -2
index b1db352a..92fe0e5d 100644
@@ -25,8 +25,7 @@ static int get_options(int argc, char *argv[])
 	char arg[MAX_ARG_LEN];
 	char key[MAX_ARG_LEN];
 	char val[MAX_ARG_LEN];
-	char c;
-	int rv;
+	int rv, c;
 
 	if (argc > 1) {
 		while ((c = getopt(argc, argv, "n:t:")) != -1) {
Signature · 1 line
2.27.0
#4 lore raw

PATCH 4/6 stonith_helper: Don't link dlm_stonith against libxml2

In reply to Alexander Aring

Took it from the debian patches. There is no need to link against libxml2 for the stonith_helper tool.

---
 fence/Makefile | 2 --
 1 file changed, 2 deletions(-)
fence/Makefile +0 -2
index 2b080468..547f7ba9 100644
@@ -18,12 +18,10 @@ CFLAGS += -D_GNU_SOURCE -O2 -ggdb \
 	-fstack-clash-protection -Wl,-z,now
 
 CFLAGS += -fPIE -DPIE
-CFLAGS += `xml2-config --cflags`
 CFLAGS += -I../include
 CFLAGS += $(shell pkg-config --cflags pacemaker-fencing)
 
 LDFLAGS += -Wl,-z,relro -Wl,-z,defs -pie
-LDFLAGS += `xml2-config --libs`
 LDFLAGS += -ldl
 
 all: $(BIN_TARGET)
Signature · 1 line
2.27.0
#5 lore raw

PATCH 5/6 python: add bindings and test example

In reply to Alexander Aring

This patch introduces a python directory with some python examples. This is still in some experimental state to provide some dlm testing framework by using libdlm.

---
 python/README                   |   7 +
 python/bindings/__init__.py     |   0
 python/bindings/dlm.py          | 244 ++++++++++++++++++++++++++++++++
 python/tests/dlm.py             |   1 +
 python/tests/recovery_interrupt |  60 ++++++++
 5 files changed, 312 insertions(+)
 create mode 100644 python/README
 create mode 100644 python/bindings/__init__.py
 create mode 100644 python/bindings/dlm.py
 create mode 120000 python/tests/dlm.py
 create mode 100755 python/tests/recovery_interrupt
python/README new file +7 -0
new file mode 100644
index 00000000..b598a53d
@@ -0,0 +1,7 @@
+This directory contains python bindings to libdlm and short written tests in python to test dlm functionality.
+NOTE: the bindings are still experimental and only used for testing now.
+
+Future work:
+	- look into pytest
+	- add ebpf examples
+	- look into MPI for barrier()
python/bindings/__init__.py new file +0 -0
new file mode 100644
index 00000000..e69de29b
python/bindings/dlm.py new file +244 -0

244 lines not on this page · raw message

python/tests/dlm.py new file +1 -0
new file mode 120000
index 00000000..057a99c5
@@ -0,0 +1 @@
+../bindings/dlm.py
\ No newline@end of file
python/tests/recovery_interrupt new file +60 -0

60 lines not on this page · raw message

Signature · 1 line
2.27.0
#6 lore raw

PATCH 6/6 python: add ebpf histogram example

In reply to Alexander Aring

This patch adds an example how a measurement between a kernel dlm_lock() and their ast callback can be captured to get at the end a histogram. This is hopefully a start of more useful dlm tracing collection with use of ebpf.

---
 python/ebpf/README     |  6 ++++
 python/ebpf/dlmhist.py | 78 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 84 insertions(+)
 create mode 100644 python/ebpf/README
 create mode 100755 python/ebpf/dlmhist.py
python/ebpf/README new file +6 -0
new file mode 100644
index 00000000..dec59ed0
@@ -0,0 +1,6 @@
+In this directory are some ebpf tracing examples. It requires bcc toolchain
+(usually known as bcc package name) and the python bcc module (usually known
+as python3-bcc package name).
+
+Also the current kernel headers need to be available or activate
+CONFIG_IKHEADERS in your kernel configuration.
python/ebpf/dlmhist.py new file +78 -0

78 lines not on this page · raw message

Signature · 1 line
2.27.0