1 Star 0 Fork 49

happy_orange/systemd

forked from src-anolis-os/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0335-test-support-MPOL_LOCAL-matching-in-unpatched-strace.patch 2.37 KB
一键复制 编辑 原始数据 按行查看 历史
张彬琛 提交于 2021-04-20 15:17 . update to systemd-239-31.el8_2.2
From d6d43b81df76d571d57f83ceb050c8b4ac4701b8 Mon Sep 17 00:00:00 2001
From: Frantisek Sumsal <frantisek@sumsal.cz>
Date: Mon, 1 Jul 2019 13:08:26 +0200
Subject: [PATCH] test: support MPOL_LOCAL matching in unpatched strace
versions
The MPOL_LOCAL constant is not recognized in current strace versions.
Let's match at least the numerical value of this constant until the
strace patch is approved & merged.
(cherry picked from commit ac14396d027023e1be910327989cb422cb2f6724)
Related: #1808940
---
test/TEST-36-NUMAPOLICY/testsuite.sh | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/test/TEST-36-NUMAPOLICY/testsuite.sh b/test/TEST-36-NUMAPOLICY/testsuite.sh
index 306a96b517..a4134bdeca 100755
--- a/test/TEST-36-NUMAPOLICY/testsuite.sh
+++ b/test/TEST-36-NUMAPOLICY/testsuite.sh
@@ -173,12 +173,16 @@ echo "PID1 NUMAPolicy support - Local policy w/o mask"
writePID1NUMAPolicy "local"
pid1ReloadWithStrace
# Kernel requires that nodemask argument is set to NULL when setting default policy
-grep "set_mempolicy(MPOL_LOCAL, NULL" $straceLog
+# The unpatched versions of strace don't recognize the MPOL_LOCAL constant and
+# return a numerical constant instead (with a comment):
+# set_mempolicy(0x4 /* MPOL_??? */, NULL, 0) = 0
+# Let's cover this scenario as well
+grep -E "set_mempolicy\((MPOL_LOCAL|0x4 [^,]*), NULL" $straceLog
echo "PID1 NUMAPolicy support - Local policy w/ mask"
writePID1NUMAPolicy "local" "0"
pid1ReloadWithStrace
-grep "set_mempolicy(MPOL_LOCAL, NULL" $straceLog
+grep -E "set_mempolicy\((MPOL_LOCAL|0x4 [^,]*), NULL" $straceLog
echo "Unit file NUMAPolicy support - Default policy w/o mask"
writeTestUnitNUMAPolicy "default"
@@ -240,7 +244,7 @@ writeTestUnitNUMAPolicy "local"
pid1StartUnitWithStrace $testUnit
systemctlCheckNUMAProperties $testUnit "local"
pid1StopUnit $testUnit
-grep "set_mempolicy(MPOL_LOCAL, NULL" $straceLog
+grep -E "set_mempolicy\((MPOL_LOCAL|0x4 [^,]*), NULL" $straceLog
echo "Unit file NUMAPolicy support - Local policy w/ mask"
writeTestUnitNUMAPolicy "local" "0"
@@ -248,7 +252,7 @@ pid1StartUnitWithStrace $testUnit
systemctlCheckNUMAProperties $testUnit "local" "0"
pid1StopUnit $testUnit
# Maks must be ignored
-grep "set_mempolicy(MPOL_LOCAL, NULL" $straceLog
+grep -E "set_mempolicy\((MPOL_LOCAL|0x4 [^,]*), NULL" $straceLog
echo "systemd-run NUMAPolicy support"
runUnit='numa-systemd-run-test.service'
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/happy_orange/systemd.git
git@gitee.com:happy_orange/systemd.git
happy_orange
systemd
systemd
a8

搜索帮助

0d507c66 1850385 C8b1a773 1850385