git: 894f26c8f64a - stable/13 - kdump: Decode getitimer, setitimer which argument
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 06 Jul 2022 11:04:06 UTC
The branch stable/13 has been updated by dchagin:
URL: https://cgit.FreeBSD.org/src/commit/?id=894f26c8f64a749bb1bc22fb6eb1abb523081fc6
commit 894f26c8f64a749bb1bc22fb6eb1abb523081fc6
Author: Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2022-06-22 11:19:31 +0000
Commit: Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2022-07-06 11:02:14 +0000
kdump: Decode getitimer, setitimer which argument
Reviewed by: jhb (previous version, without truss)
Differential revision: https://reviews.freebsd.org/D35231
MFC after: 2 weeks
(cherry picked from commit b9b86b6742ad589e5ad1077c000bfdb2ce9ac198)
---
usr.bin/kdump/kdump.c | 8 ++++++++
usr.bin/kdump/linux.c | 16 ++++++++++++++++
usr.bin/truss/syscall.h | 1 +
usr.bin/truss/syscalls.c | 13 +++++++++++--
4 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index f3e6787edbe0..30747909d002 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -1534,6 +1534,14 @@ ktrsyscall_freebsd(struct ktr_syscall *ktr, register_t **resip,
narg--;
c = ',';
break;
+ case SYS_getitimer:
+ case SYS_setitimer:
+ putchar('(');
+ print_integer_arg(sysdecode_itimer, *ip);
+ ip++;
+ narg--;
+ c = ',';
+ break;
}
switch (ktr->ktr_code) {
case SYS_chflagsat:
diff --git a/usr.bin/kdump/linux.c b/usr.bin/kdump/linux.c
index ed057a6b8ef6..55b3df912898 100644
--- a/usr.bin/kdump/linux.c
+++ b/usr.bin/kdump/linux.c
@@ -117,6 +117,14 @@ ktrsyscall_linux(struct ktr_syscall *ktr, register_t **resip,
print_number(ip, narg, c);
print_number64(first, ip, narg, c);
break;
+ case LINUX_SYS_linux_getitimer:
+ case LINUX_SYS_linux_setitimer:
+ putchar('(');
+ print_integer_arg(sysdecode_itimer, *ip);
+ ip++;
+ narg--;
+ c = ',';
+ break;
}
*resc = c;
*resip = ip;
@@ -183,6 +191,14 @@ ktrsyscall_linux32(struct ktr_syscall *ktr, register_t **resip,
print_number(ip, narg, c);
print_number64(first, ip, narg, c);
break;
+ case LINUX32_SYS_linux_getitimer:
+ case LINUX32_SYS_linux_setitimer:
+ putchar('(');
+ print_integer_arg(sysdecode_itimer, *ip);
+ ip++;
+ narg--;
+ c = ',';
+ break;
}
*resc = c;
*resip = ip;
diff --git a/usr.bin/truss/syscall.h b/usr.bin/truss/syscall.h
index f25cbd81ede5..d27bbacfd126 100644
--- a/usr.bin/truss/syscall.h
+++ b/usr.bin/truss/syscall.h
@@ -101,6 +101,7 @@ enum Argtype {
Getfsstatmode,
Idtype,
Ioctl,
+ Itimerwhich,
Kldsymcmd,
Kldunloadflags,
LioMode,
diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c
index cf863d2bfaaa..11ca6269b153 100644
--- a/usr.bin/truss/syscalls.c
+++ b/usr.bin/truss/syscalls.c
@@ -297,7 +297,7 @@ static const struct syscall_decode decoded_syscalls[] = {
{ .name = "getfsstat", .ret_type = 1, .nargs = 3,
.args = { { Ptr, 0 }, { Long, 1 }, { Getfsstatmode, 2 } } },
{ .name = "getitimer", .ret_type = 1, .nargs = 2,
- .args = { { Int, 0 }, { Itimerval | OUT, 2 } } },
+ .args = { { Itimerwhich, 0 }, { Itimerval | OUT, 2 } } },
{ .name = "getpeername", .ret_type = 1, .nargs = 3,
.args = { { Int, 0 }, { Sockaddr | OUT, 1 }, { Ptr | OUT, 2 } } },
{ .name = "getpgid", .ret_type = 1, .nargs = 1,
@@ -507,7 +507,8 @@ static const struct syscall_decode decoded_syscalls[] = {
{ Msgflags, 3 }, { Sockaddr | IN, 4 },
{ Socklent | IN, 5 } } },
{ .name = "setitimer", .ret_type = 1, .nargs = 3,
- .args = { { Int, 0 }, { Itimerval, 1 }, { Itimerval | OUT, 2 } } },
+ .args = { { Itimerwhich, 0 }, { Itimerval, 1 },
+ { Itimerval | OUT, 2 } } },
{ .name = "setpriority", .ret_type = 1, .nargs = 3,
.args = { { Priowhich, 0 }, { Int, 1 }, { Int, 2 } } },
{ .name = "setrlimit", .ret_type = 1, .nargs = 2,
@@ -608,6 +609,8 @@ static const struct syscall_decode decoded_syscalls[] = {
{ .name = "linux_execve", .ret_type = 1, .nargs = 3,
.args = { { Name | IN, 0 }, { ExecArgs | IN, 1 },
{ ExecEnv | IN, 2 } } },
+ { .name = "linux_getitimer", .ret_type = 1, .nargs = 2,
+ .args = { { Itimerwhich, 0 }, { Itimerval | OUT, 2 } } },
{ .name = "linux_lseek", .ret_type = 2, .nargs = 3,
.args = { { Int, 0 }, { Int, 1 }, { Whence, 2 } } },
{ .name = "linux_mkdir", .ret_type = 1, .nargs = 2,
@@ -620,6 +623,9 @@ static const struct syscall_decode decoded_syscalls[] = {
.args = { { Name, 0 }, { Hex, 1 }, { Octal, 2 } } },
{ .name = "linux_readlink", .ret_type = 1, .nargs = 3,
.args = { { Name, 0 }, { Name | OUT, 1 }, { Sizet, 2 } } },
+ { .name = "linux_setitimer", .ret_type = 1, .nargs = 3,
+ .args = { { Itimerwhich, 0 }, { Itimerval, 1 },
+ { Itimerval | OUT, 2 } } },
{ .name = "linux_socketcall", .ret_type = 1, .nargs = 2,
.args = { { Int, 0 }, { LinuxSockArgs, 1 } } },
{ .name = "linux_stat64", .ret_type = 1, .nargs = 2,
@@ -2628,6 +2634,9 @@ print_arg(struct syscall_arg *sc, unsigned long *args, register_t *retval,
print_integer_arg(sysdecode_getfsstat_mode, fp,
args[sc->offset]);
break;
+ case Itimerwhich:
+ print_integer_arg(sysdecode_itimer, fp, args[sc->offset]);
+ break;
case Kldsymcmd:
print_integer_arg(sysdecode_kldsym_cmd, fp, args[sc->offset]);
break;