Update libsysdecode for getfsstat() 'flags' argument changing to 'mode'.

As a followup to r310638, update libsysdecode (and kdump) to decode the
'mode' argument to getfsstat().  sysdecode_getfsstat_flags() has been
renamed to sysdecode_getfsstat_mode() and now treats the argument as an
enumerated value rather than a mask of flags.
This commit is contained in:
John Baldwin 2017-01-03 01:39:05 +00:00
parent 91371de1fa
commit 48f7957436
8 changed files with 18 additions and 11 deletions

View File

@ -38,6 +38,8 @@
# xargs -n1 | sort | uniq -d;
# done
# 20170102: sysdecode_getfsstat_flags() renamed to sysdecode_getfsstat_mode()
OLD_FILES+=usr/share/man/man3/sysdecode_getfsstat_flags.3.gz
# 20161230: libarchive ACL pax test renamed to test_acl_pax_posix1e.tar.uu
OLD_FILES+=usr/tests/lib/libarchive/test_acl_pax.tar.uu
# 20161229: Three files from gnop tests consolidated into one

View File

@ -30,6 +30,7 @@ MLINKS+=sysdecode_enum.3 sysdecode_acltype.3 \
sysdecode_enum.3 sysdecode_extattrnamespace.3 \
sysdecode_enum.3 sysdecode_fadvice.3 \
sysdecode_enum.3 sysdecode_fcntl_cmd.3 \
sysdecode_enum.3 sysdecode_getfsstat_mode.3 \
sysdecode_enum.3 sysdecode_idtype.3 \
sysdecode_enum.3 sysdecode_ipproto.3 \
sysdecode_enum.3 sysdecode_kldsym_cmd.3 \
@ -70,7 +71,6 @@ MLINKS+=sysdecode_mask.3 sysdecode_accessmode.3 \
sysdecode_mask.3 sysdecode_fileflags.3 \
sysdecode_mask.3 sysdecode_filemode.3 \
sysdecode_mask.3 sysdecode_flock_operation.3 \
sysdecode_mask.3 sysdecode_getfsstat_flags.3 \
sysdecode_mask.3 sysdecode_mlockall_flags.3 \
sysdecode_mask.3 sysdecode_mmap_flags.3 \
sysdecode_mask.3 sysdecode_mmap_prot.3 \

View File

@ -472,11 +472,15 @@ sysdecode_flock_operation(FILE *fp, int operation, int *rem)
return (print_mask_int(fp, flockops, operation, rem));
}
bool
sysdecode_getfsstat_flags(FILE *fp, int flags, int *rem)
static struct name_table getfsstatmode[] = {
X(MNT_WAIT) X(MNT_NOWAIT) XEND
};
const char *
sysdecode_getfsstat_mode(int mode)
{
return (print_mask_int(fp, getfsstatflags, flags, rem));
return (lookup_value(getfsstatmode, mode));
}
const char *

View File

@ -94,7 +94,6 @@ gen_table "extattrns" "EXTATTR_NAMESPACE_[A-Z]+[[:space:]]+0x[0-9]+" "sys/
gen_table "fadvisebehav" "POSIX_FADV_[A-Z]+[[:space:]]+[0-9]+" "sys/fcntl.h"
gen_table "openflags" "O_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/fcntl.h" "O_RDONLY|O_RDWR|O_WRONLY"
gen_table "flockops" "LOCK_[A-Z]+[[:space:]]+0x[0-9]+" "sys/fcntl.h"
gen_table "getfsstatflags" "MNT_[A-Z]+[[:space:]]+[1-9][0-9]*" "sys/mount.h"
gen_table "kldsymcmd" "KLDSYM_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h"
gen_table "kldunloadfflags" "LINKER_UNLOAD_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h"
gen_table "lio_listiomodes" "LIO_(NO)?WAIT[[:space:]]+[0-9]+" "aio.h"

View File

@ -54,7 +54,7 @@ bool sysdecode_fileflags(FILE *_fp, fflags_t _flags, fflags_t *_rem);
bool sysdecode_filemode(FILE *_fp, int _mode, int *_rem);
bool sysdecode_flock_operation(FILE *_fp, int _operation, int *_rem);
int sysdecode_freebsd_to_abi_errno(enum sysdecode_abi _abi, int _error);
bool sysdecode_getfsstat_flags(FILE *_fp, int _flags, int *_rem);
const char *sysdecode_getfsstat_mode(int _mode);
const char *sysdecode_idtype(int _idtype);
const char *sysdecode_ioctlname(unsigned long _val);
const char *sysdecode_ipproto(int _protocol);

View File

@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd October 17, 2016
.Dd January 2, 2017
.Dt sysdecode_enum 3
.Os
.Sh NAME
@ -35,6 +35,7 @@
.Nm sysdecode_extattrnamespace ,
.Nm sysdecode_fadvice ,
.Nm sysdecode_fcntl_cmd ,
.Nm sysdecode_getfsstat_mode ,
.Nm sysdecode_idtype ,
.Nm sysdecode_ipproto ,
.Nm sysdecode_kldsym_cmd ,
@ -86,6 +87,8 @@
.Ft const char *
.Fn sysdecode_fcntl_cmd "int cmd"
.Ft const char *
.Fn sysdecode_getfsstat_mode "int mode"
.Ft const char *
.Fn sysdecode_idtype "int idtype"
.Ft const char *
.Fn sysdecode_ipproto "int protocol"
@ -168,6 +171,7 @@ Most of these functions decode an argument passed to a system call:
.It Fn sysdecode_extattrnamespace Ta Xr extattr_get_fd 2 Ta Fa attrnamespace
.It Fn sysdecode_fadvice Ta Xr posix_fadvise 2 Ta Fa advice
.It Fn sysdecode_fcntl_cmd Ta Xr fcntl 2 Ta Fa cmd
.It Fn sysdecode_getfsstat_mode Ta Xr getfsstat 2 Ta Fa mode
.It Fn sysdecode_idtype Ta
.Xr procctl 2 ,
.Xr waitid 2

View File

@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd October 17, 2016
.Dd January 2, 2017
.Dt sysdecode_mask 3
.Os
.Sh NAME
@ -36,7 +36,6 @@
.Nm sysdecode_fileflags ,
.Nm sysdecode_filemode ,
.Nm sysdecode_flock_operation ,
.Nm sysdecode_getfsstat_flags ,
.Nm sysdecode_mlockall_flags ,
.Nm sysdecode_mmap_flags ,
.Nm sysdecode_mmap_prot ,
@ -153,7 +152,6 @@ Most of these functions decode an argument passed to a system call:
.It Fn sysdecode_fileflags Ta Xr chflags 2 Ta Fa flags
.It Fn sysdecode_filemode Ta Xr chmod 2 , Xr open 2 Ta mode
.It Fn sysdecode_flock_operation Ta Xr flock 2 Ta Fa operation
.It Fn sysdecode_getfsstat_flags Ta Xr getfsstatflags 2 Ta Fa flags
.It Fn sysdecode_mlockall_flags Ta Xr mlockall 2 Ta Fa flags
.It Fn sysdecode_mmap_flags Ta Xr mmap 2 Ta Fa flags
.It Fn sysdecode_mmap_prot Ta Xr mmap 2 Ta Fa prot

View File

@ -943,7 +943,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags)
print_number(ip, narg, c);
print_number(ip, narg, c);
putchar(',');
print_mask_arg(sysdecode_getfsstat_flags, *ip);
print_integer_arg(sysdecode_getfsstat_mode, *ip);
ip++;
narg--;
break;