git: e104ac1c34b9 - stable/13 - libsysdecode: Decode setitimer, getitimer which argument
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 06 Jul 2022 11:04:05 UTC
The branch stable/13 has been updated by dchagin:
URL: https://cgit.FreeBSD.org/src/commit/?id=e104ac1c34b9670fccd79b4e3e1b288eb3d3f305
commit e104ac1c34b9670fccd79b4e3e1b288eb3d3f305
Author: Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2022-06-22 11:17:10 +0000
Commit: Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2022-07-06 11:02:13 +0000
libsysdecode: Decode setitimer, getitimer which argument
Reviewed by: jhb
Differential revision: https://reviews.freebsd.org/D35230
MFC after: 2 weeks
(cherry picked from commit 2fc3a51db14f2be7fd1f5515c6adfc60d4880207)
---
lib/libsysdecode/flags.c | 7 +++++++
lib/libsysdecode/mktables | 1 +
lib/libsysdecode/sysdecode.h | 1 +
lib/libsysdecode/sysdecode_enum.3 | 9 ++++++++-
4 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/lib/libsysdecode/flags.c b/lib/libsysdecode/flags.c
index c89c0ab75302..ac109cc454e0 100644
--- a/lib/libsysdecode/flags.c
+++ b/lib/libsysdecode/flags.c
@@ -1195,3 +1195,10 @@ sysdecode_shmflags(FILE *fp, int flags, int *rem)
return (print_mask_0(fp, shmflags, flags, rem));
}
+
+const char *
+sysdecode_itimer(int which)
+{
+
+ return (lookup_value(itimerwhich, which));
+}
diff --git a/lib/libsysdecode/mktables b/lib/libsysdecode/mktables
index 94e8e9faa697..4ad316c54f63 100644
--- a/lib/libsysdecode/mktables
+++ b/lib/libsysdecode/mktables
@@ -168,6 +168,7 @@ else
gen_table "sysarchnum" "[A-Z_]+[[:space:]]+[0-9]+" "machine/sysarch.h"
fi
gen_table "shmflags" "SHM_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/mman.h" "SHM_ANON"
+gen_table "itimerwhich" "ITIMER_[A-Z]+[[:space:]]+[0-9]+" "sys/time.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 6c1b0bd2d226..f588319fbf17 100644
--- a/lib/libsysdecode/sysdecode.h
+++ b/lib/libsysdecode/sysdecode.h
@@ -68,6 +68,7 @@ const char *sysdecode_ioctlname(unsigned long _val);
const char *sysdecode_ipproto(int _protocol);
void sysdecode_kevent_fflags(FILE *_fp, short _filter, int _fflags,
int _base);
+const char *sysdecode_itimer(int _which);
const char *sysdecode_kevent_filter(int _filter);
bool sysdecode_kevent_flags(FILE *_fp, int _flags, int *_rem);
const char *sysdecode_kldsym_cmd(int _cmd);
diff --git a/lib/libsysdecode/sysdecode_enum.3 b/lib/libsysdecode/sysdecode_enum.3
index 2ea021b9933c..04137cd6e841 100644
--- a/lib/libsysdecode/sysdecode_enum.3
+++ b/lib/libsysdecode/sysdecode_enum.3
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 14, 2018
+.Dd June 22, 2022
.Dt sysdecode_enum 3
.Os
.Sh NAME
@@ -38,6 +38,7 @@
.Nm sysdecode_getrusage_who ,
.Nm sysdecode_idtype ,
.Nm sysdecode_ipproto ,
+.Nm sysdecode_itimer ,
.Nm sysdecode_kldsym_cmd ,
.Nm sysdecode_kldunload_flags ,
.Nm sysdecode_lio_listio_mode ,
@@ -97,6 +98,8 @@
.Ft const char *
.Fn sysdecode_ipproto "int protocol"
.Ft const char *
+.Fn sysdecode_itimer "int which"
+.Ft const char *
.Fn sysdecode_kldsym_cmd "int cmd"
.Ft const char *
.Fn sysdecode_kldunload_flags "int flags"
@@ -186,6 +189,10 @@ Most of these functions decode an argument passed to a system call:
.Xr procctl 2 ,
.Xr waitid 2
.Ta Fa idtype
+.It Fn sysdecode_itimer Ta
+.Xr getitimer 2 ,
+.Xr setitimer 2
+.Ta Fa which
.It Fn sysdecode_kldsym_cmd Ta Xr kldsym 2 Ta Fa cmd
.It Fn sysdecode_kldunload_flags Ta Xr kldunloadf 2 Ta Fa flags
.It Fn sysdecode_lio_listio_mode Ta Xr lio_listio 2 Ta Fa mode