git: f587a2a765fb - main - kdump: Decode Linux sigprocmask how argument

From: Dmitry Chagin <dchagin_at_FreeBSD.org>
Date: Wed, 22 Jun 2022 11:41:06 UTC
The branch main has been updated by dchagin:

URL: https://cgit.FreeBSD.org/src/commit/?id=f587a2a765fb3bac352bedf6ef8b322eb3363339

commit f587a2a765fb3bac352bedf6ef8b322eb3363339
Author:     Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2022-06-22 11:20:39 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2022-06-22 11:20:39 +0000

    kdump: Decode Linux sigprocmask how argument
    
    MFC after:              2 weeks
---
 lib/libsysdecode/linux.c       |  7 +++++++
 lib/libsysdecode/mklinuxtables |  1 +
 lib/libsysdecode/sysdecode.h   |  1 +
 usr.bin/kdump/linux.c          | 18 ++++++++++++++++++
 4 files changed, 27 insertions(+)

diff --git a/lib/libsysdecode/linux.c b/lib/libsysdecode/linux.c
index 6a8d30207835..adaf6172618d 100644
--- a/lib/libsysdecode/linux.c
+++ b/lib/libsysdecode/linux.c
@@ -183,3 +183,10 @@ sysdecode_linux_signal(int sig)
 		return (linux_signames[sig]);
 	return (NULL);
 }
+
+const char *
+sysdecode_linux_sigprocmask_how(int how)
+{
+
+	return (lookup_value(sigprocmaskhow, how));
+}
diff --git a/lib/libsysdecode/mklinuxtables b/lib/libsysdecode/mklinuxtables
index 62f0d9329c94..efd579adff35 100644
--- a/lib/libsysdecode/mklinuxtables
+++ b/lib/libsysdecode/mklinuxtables
@@ -90,6 +90,7 @@ _EOF_
 
 gen_table "clockids"    "LINUX_CLOCK_[A-Z_]+[[:space:]]+[0-9]+"          "compat/linux/linux_timer.h"
 gen_table "clockcpuids" "LINUX_CPUCLOCK_[A-Z_]+[[:space:]]+[0-9]+"       "compat/linux/linux_timer.h"	"_MASK|_MAX"
+gen_table "sigprocmaskhow" "LINUX_SIG_[A-Z]+[[:space:]]+[0-9]+"          "compat/linux/linux.h"
 
 # Generate a .depend file for our output file
 if [ -n "$output_file" ]; then
diff --git a/lib/libsysdecode/sysdecode.h b/lib/libsysdecode/sysdecode.h
index 91b07e0b4768..4412f5d70078 100644
--- a/lib/libsysdecode/sysdecode.h
+++ b/lib/libsysdecode/sysdecode.h
@@ -141,6 +141,7 @@ bool	sysdecode_shmflags(FILE *_fp, int _flags, int *_rem);
 
 void	sysdecode_linux_clockid(FILE *_fp, clockid_t _which);
 const char *sysdecode_linux_signal(int _sig);
+const char *sysdecode_linux_sigprocmask_how(int _how);
 
 #endif /* __i386__ || __amd64__ || __aarch64__ */
 
diff --git a/usr.bin/kdump/linux.c b/usr.bin/kdump/linux.c
index 55b3df912898..f55d0b7da83d 100644
--- a/usr.bin/kdump/linux.c
+++ b/usr.bin/kdump/linux.c
@@ -125,6 +125,16 @@ ktrsyscall_linux(struct ktr_syscall *ktr, register_t **resip,
 		narg--;
 		c = ',';
 		break;
+	case LINUX_SYS_linux_rt_sigprocmask:
+#ifdef LINUX_SYS_linux_sigprocmask
+	case LINUX_SYS_linux_sigprocmask:
+#endif
+		putchar('(');
+		print_integer_arg(sysdecode_linux_sigprocmask_how, *ip);
+		ip++;
+		narg--;
+		c = ',';
+		break;
 	}
 	*resc = c;
 	*resip = ip;
@@ -199,6 +209,14 @@ ktrsyscall_linux32(struct ktr_syscall *ktr, register_t **resip,
 		narg--;
 		c = ',';
 		break;
+	case LINUX32_SYS_linux_rt_sigprocmask:
+	case LINUX32_SYS_linux_sigprocmask:
+		putchar('(');
+		print_integer_arg(sysdecode_linux_sigprocmask_how, *ip);
+		ip++;
+		narg--;
+		c = ',';
+		break;
 	}
 	*resc = c;
 	*resip = ip;