From 2368eb939d99bfdcf96883da421b3cc1d3d68bd7 Mon Sep 17 00:00:00 2001 From: ChenZanYu Date: Fri, 2 Jun 2023 01:22:24 +0000 Subject: [PATCH] Print the expected return value string based on the value returned, similarly to the way it is done in tests/prctl-sme.c:print_sme_vl_arg(). Signed-off-by: ChenZanYu --- ...sts-prctl-sve-fix-prctl-PR_SVE_GET_V.patch | 53 +++++++++++++++++++ strace.spec | 6 ++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 strace-5.14-Subject-PATCH-tests-prctl-sve-fix-prctl-PR_SVE_GET_V.patch diff --git a/strace-5.14-Subject-PATCH-tests-prctl-sve-fix-prctl-PR_SVE_GET_V.patch b/strace-5.14-Subject-PATCH-tests-prctl-sve-fix-prctl-PR_SVE_GET_V.patch new file mode 100644 index 0000000..a72b31b --- /dev/null +++ b/strace-5.14-Subject-PATCH-tests-prctl-sve-fix-prctl-PR_SVE_GET_V.patch @@ -0,0 +1,53 @@ +From da1d1b3347c275ba039a25f7f5aaf604043c602f Mon Sep 17 00:00:00 2001 +From: chenzanyu +Date: Fri, 2 Jun 2023 09:16:14 +0800 +Subject: [PATCH] Subject: [PATCH] tests/prctl-sve: fix prctl(PR_SVE_GET_VL) + return expected value printing + +reason: tests/prctl-sve.c: Print the expected return value string based + on the value returned, similarly to the way it is done + in tests/prctl-sme.c:print_sme_vl_arg(). +Signed-off-by: chenzanyu +--- + tests/prctl-sve.c | 24 ++++++++++++++++++++---- + 1 file changed, 20 insertions(+), 4 deletions(-) + +diff --git a/tests/prctl-sve.c b/tests/prctl-sve.c +index 4cef149..2783aaf 100644 +--- a/tests/prctl-sve.c ++++ b/tests/prctl-sve.c +@@ -43,12 +43,28 @@ main(void) + (unsigned long) 0xff, sprintrc(rc)); + + rc = syscall(__NR_prctl, PR_SVE_GET_VL); +- printf("prctl(PR_SVE_GET_VL) = %s", sprintrc(rc)); ++ printf("prctl(PR_SVE_GET_VL) = "); + if (rc >= 0) { +- printf(" (PR_SVE_SET_VL_ONEXEC|PR_SVE_VL_INHERIT|%#lx)", +- (unsigned long) 0xff); ++ printf("%#lx", rc); ++ if (rc > 0xffff) { ++ printf(" ("); ++ if (rc & PR_SVE_SET_VL_ONEXEC) ++ printf("PR_SVE_SET_VL_ONEXEC"); ++ if (rc & PR_SVE_VL_INHERIT) { ++ printf("%sPR_SVE_VL_INHERIT", ++ rc & PR_SVE_SET_VL_ONEXEC ? "|" : ""); ++ } ++ if (rc & ~0x6ffffU) { ++ printf("%s%#lx", ++ rc & 0x60000 ? "|" : "", rc & ~0x6ffffU); ++ } ++ printf("|%#lx)\n", rc & 0xffffU); ++ } else { ++ puts(""); ++ } ++ } else { ++ puts(sprintrc(rc)); + } +- puts(""); + + puts("+++ exited with 0 +++"); + return 0; +-- +2.12.3 diff --git a/strace.spec b/strace.spec index 6905680..60f09c9 100644 --- a/strace.spec +++ b/strace.spec @@ -3,7 +3,7 @@ Summary: Tracks and displays system calls associated with a running process Name: strace Version: 5.14 -Release: 4 +Release: 5 # The test suite is GPLv2+, all the rest is LGPLv2.1+. License: LGPL-2.1+ and GPL-2.0+ # Some distros require Group tag to be present, @@ -22,6 +22,7 @@ Patch1: strace-5.14-sw.patch %endif Patch2: strace-5.14-loongarch64.patch Patch3: strace-5.14-solve-ilp32-strace-build-error.patch +Patch4: strace-5.14-Subject-PATCH-tests-prctl-sve-fix-prctl-PR_SVE_GET_V.patch BuildRequires: gcc gzip # Install Bluetooth headers for AF_BLUETOOTH sockets decoding. @@ -106,6 +107,9 @@ wait %{_mandir}/man1/* %changelog +* Thur June 1 2023 chenzanyu - 5.14-5 +- fix prctl(PR_SVE_GET_VL) return expected value printing + * Tue Apr 4 2023 chenzanyu - 5.14-4 - solve ilp32 strace build error -- Gitee