From owner-svn-src-stable-11@freebsd.org Tue Nov 21 02:10:02 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F31C8DBFC55; Tue, 21 Nov 2017 02:10:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 849CE78571; Tue, 21 Nov 2017 02:10:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAL2A0hS093223; Tue, 21 Nov 2017 02:10:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAL29xaV093186; Tue, 21 Nov 2017 02:09:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201711210209.vAL29xaV093186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 21 Nov 2017 02:09:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r326044 - in stable/11: lib/libsysdecode usr.bin/kdump usr.bin/truss X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/11: lib/libsysdecode usr.bin/kdump usr.bin/truss X-SVN-Commit-Revision: 326044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 02:10:02 -0000 Author: jhb Date: Tue Nov 21 02:09:59 2017 New Revision: 326044 URL: https://svnweb.freebsd.org/changeset/base/326044 Log: MFC 319493,319509,319520,319595,319677,319679-319681,319688,319689, 319761-319768,320010,322899,322959,323020,323021,323151: Sync libsysdecode, kdump, and truss with head (aside from changes such as ino64 that are not applicable to 11). 319493: Decode the arguments passed to __cap_rights_get() and cap_rights_limit(). 319509: Decode the argument passed to cap_getmode(). The returned integer value is output. 319520: Decode the 'who' argument passed to getrusage(). Add a new sysdecode_getrusage_who() which decodes the RUSAGE_* constant passed as the first argument to getrusage(). Use this function in both kdump and truss to decode the first argument to getrusage(). 319595: Decode arguments to dup, dup2, getdirentries, pread, and pwrite. - dup and dup2 print fd arguments in decimal. - pread and pwrite are similar to read and write with the addition of the file offset. - getdirentries displays the output entries as a string for now and also prints the value returned in *basep. Eventually the buffer for getdirentries should perhaps be decoded as an array of dirent structures. 319677: Decode arguments to ACL related system calls. This only decodes the raw arguments but not the contents of the struct acl objects. 319679: Decode arguments passed to extended attribute related system calls. The cmd argument passed to extattrctl() is not decoded as a string constant but is just printed in hex. The value is filesystem-specific but in practice is only used with UFS1 filesystems. 319680: Decode arguments to minherit(). 319681: Decode arguments to mlock(), mlockall(), and munlock(). 319688: Decode flags passed to mount(), nmount(), and unmount(). 319689: Decode arguments passed to msync(). 319761: Fix decoding of setpriority() arguments. The PRIO_* 'which' value is stored in the first argument to setpriority(2), not the last. While here, decode the arguments to getpriority(2). 319762: Decode arguments to getpriority() and setpriority(). 319763: Decode the arguments to ptrace(). This does not decode structures returned by ptrace(). 319764: Decode the arguments to quotactl(). 319765: Improve decoding of RB_AUTOBOOT in the 'howto' argument to reboot(). The reboot() system call accepts a mode (RB_AUTOBOOT, RB_HALT, RB_POWEROFF, or RB_REROOT) as well as zero or more optional flags in 'howto'. However, RB_AUTOBOOT was only displayed if 'howto' was exactly 0. Combinations like 'RB_AUTOBOOT | RB_DUMP' were decoded as 'RB_DUMP'. Instead, imply that RB_AUTOBOOT was specified if none of the other "mode" flags were specified. 319766: Decode the 'howto' argument to reboot(). 319767: Decode arguments to rtprio_thread() (same as rtprio()). 319768: Decode arguments to rtprio() and rtprio_thread(). 320010: Decode arguments to sched_* family of system calls. This includes decoding both scheduler policy constants and the sched_param structure for sched_get_priority_max(), sched_get_priority_min(), sched_getparam(), sched_getscheduler(), sched_rr_get_interval(), sched_setparam(), and sched_setscheduler(). 322899: Decode arguments passed to thr_set_name(). 322959: Decode extra signal information for caught signals. Decode fields from the siginfo_t stored in the PT_LWPINFO structure when a signal is caught by a traced process. This includes the signal code (si_code) as well as additional members such as si_addr, si_pid, etc. 323020: Trim stale prototype for ioctlname(). 323021: Decode signal information returned by system calls. Specifically, decode the siginfo structure returned by sigtimedwait(), sigwaitinfo(), and wait6(). While here, also decode the signal number returned in the second argument to sigwait(). 323151: Decode pathconf() names, *at() flags, and sysarch() numbers in libsysdecode. Move tables that were previously in truss over to libsysdecode. truss output is unchanged, but kdump has been updated to decode these fields. In addition, sysdecode_sysarch_number() should support all platforms whereas the old table in truss only supported x86. PR: 214885, 215448 Modified: stable/11/lib/libsysdecode/Makefile stable/11/lib/libsysdecode/flags.c stable/11/lib/libsysdecode/mktables stable/11/lib/libsysdecode/sysdecode.h stable/11/lib/libsysdecode/sysdecode_enum.3 stable/11/lib/libsysdecode/sysdecode_mask.3 stable/11/usr.bin/kdump/kdump.c stable/11/usr.bin/truss/extern.h stable/11/usr.bin/truss/setup.c stable/11/usr.bin/truss/syscall.h stable/11/usr.bin/truss/syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libsysdecode/Makefile ============================================================================== --- stable/11/lib/libsysdecode/Makefile Tue Nov 21 01:54:48 2017 (r326043) +++ stable/11/lib/libsysdecode/Makefile Tue Nov 21 02:09:59 2017 (r326044) @@ -32,6 +32,7 @@ MLINKS+=sysdecode_enum.3 sysdecode_acltype.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_getrusage_who.3 \ sysdecode_enum.3 sysdecode_idtype.3 \ sysdecode_enum.3 sysdecode_ipproto.3 \ sysdecode_enum.3 sysdecode_kldsym_cmd.3 \ @@ -41,6 +42,7 @@ MLINKS+=sysdecode_enum.3 sysdecode_acltype.3 \ sysdecode_enum.3 sysdecode_minherit_flags.3 \ sysdecode_enum.3 sysdecode_msgctl_cmd.3 \ sysdecode_enum.3 sysdecode_nfssvc_flags.3 \ + sysdecode_enum.3 sysdecode_pathconf_name.3 \ sysdecode_enum.3 sysdecode_prio_which.3 \ sysdecode_enum.3 sysdecode_procctl_cmd.3 \ sysdecode_enum.3 sysdecode_ptrace_request.3 \ @@ -62,11 +64,13 @@ MLINKS+=sysdecode_enum.3 sysdecode_acltype.3 \ sysdecode_enum.3 sysdecode_socketdomain.3 \ sysdecode_enum.3 sysdecode_sockettype.3 \ sysdecode_enum.3 sysdecode_sockopt_level.3 \ + sysdecode_enum.3 sysdecode_sysarch_number.3 \ sysdecode_enum.3 sysdecode_umtx_op.3 \ sysdecode_enum.3 sysdecode_vmresult.3 \ sysdecode_enum.3 sysdecode_whence.3 MLINKS+=sysdecode_fcntl_arg.3 sysdecode_fcntl_arg_p.3 MLINKS+=sysdecode_mask.3 sysdecode_accessmode.3 \ + sysdecode_mask.3 sysdecode_atflags.3 \ sysdecode_mask.3 sysdecode_capfcntlrights.3 \ sysdecode_mask.3 sysdecode_fcntl_fileflags.3 \ sysdecode_mask.3 sysdecode_fileflags.3 \ Modified: stable/11/lib/libsysdecode/flags.c ============================================================================== --- stable/11/lib/libsysdecode/flags.c Tue Nov 21 01:54:48 2017 (r326043) +++ stable/11/lib/libsysdecode/flags.c Tue Nov 21 02:09:59 2017 (r326044) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -250,6 +251,13 @@ sysdecode_atfd(int fd) return (NULL); } +bool +sysdecode_atflags(FILE *fp, int flag, int *rem) +{ + + return (print_mask_int(fp, atflags, flag, rem)); +} + static struct name_table semctlops[] = { X(GETNCNT) X(GETPID) X(GETVAL) X(GETALL) X(GETZCNT) X(SETVAL) X(SETALL) X(IPC_RMID) X(IPC_SET) X(IPC_STAT) XEND @@ -487,6 +495,13 @@ sysdecode_getfsstat_mode(int mode) } const char * +sysdecode_getrusage_who(int who) +{ + + return (lookup_value(rusage, who)); +} + +const char * sysdecode_kldsym_cmd(int cmd) { @@ -627,8 +642,19 @@ sysdecode_quotactl_cmd(FILE *fp, int cmd) bool sysdecode_reboot_howto(FILE *fp, int howto, int *rem) { + bool printed; - return (print_mask_int(fp, rebootopt, howto, rem)); + /* + * RB_AUTOBOOT is special in that its value is zero, but it is + * also an implied argument if a different operation is not + * requested via RB_HALT, RB_POWEROFF, or RB_REROOT. + */ + if (howto != 0 && (howto & (RB_HALT | RB_POWEROFF | RB_REROOT)) == 0) { + fputs("RB_AUTOBOOT|", fp); + printed = true; + } else + printed = false; + return (print_mask_int(fp, rebootopt, howto, rem) || printed); } bool @@ -930,6 +956,13 @@ sysdecode_mmap_flags(FILE *fp, int flags, int *rem) } const char * +sysdecode_pathconf_name(int name) +{ + + return (lookup_value(pathconfname, name)); +} + +const char * sysdecode_rtprio_function(int function) { @@ -968,6 +1001,13 @@ sysdecode_sigcode(int sig, int si_code) default: return (NULL); } +} + +const char * +sysdecode_sysarch_number(int number) +{ + + return (lookup_value(sysarchnum, number)); } bool Modified: stable/11/lib/libsysdecode/mktables ============================================================================== --- stable/11/lib/libsysdecode/mktables Tue Nov 21 01:54:48 2017 (r326043) +++ stable/11/lib/libsysdecode/mktables Tue Nov 21 02:09:59 2017 (r326044) @@ -91,6 +91,7 @@ _EOF_ gen_table "accessmode" "[A-Z]_OK[[:space:]]+0?x?[0-9A-Fa-f]+" "sys/unistd.h" gen_table "acltype" "ACL_TYPE_[A-Z4_]+[[:space:]]+0x[0-9]+" "sys/acl.h" +gen_table "atflags" "AT_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/fcntl.h" gen_table "capfcntl" "CAP_FCNTL_[A-Z]+[[:space:]]+\(1" "sys/capsicum.h" gen_table "extattrns" "EXTATTR_NAMESPACE_[A-Z]+[[:space:]]+0x[0-9]+" "sys/extattr.h" gen_table "fadvisebehav" "POSIX_FADV_[A-Z]+[[:space:]]+[0-9]+" "sys/fcntl.h" @@ -109,6 +110,7 @@ gen_table "filemode" "S_[A-Z]+[[:space:]]+[0-6] gen_table "mountflags" "MNT_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mount.h" gen_table "msyncflags" "MS_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h" gen_table "nfssvcflags" "NFSSVC_[A-Z0-9]+[[:space:]]+0x[0-9]+" "nfs/nfssvc.h" +gen_table "pathconfname" "_PC_[A-Z4_]+[[:space:]]+[0-9]+" "sys/unistd.h" gen_table "prio" "PRIO_[A-Z]+[[:space:]]+[0-9]" "sys/resource.h" gen_table "procctlcmd" "PROC_[A-Z_]+[[:space:]]+[0-9]" "sys/procctl.h" "PROC_TRACE_CTL_" gen_table "ptraceop" "PT_[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/ptrace.h" @@ -116,6 +118,7 @@ gen_table "quotactlcmds" "Q_[A-Z]+[[:space:]]+0x[0- gen_table "rebootopt" "RB_[A-Z]+[[:space:]]+0x[0-9]+" "sys/reboot.h" gen_table "rforkflags" "RF[A-Z]+[[:space:]]+\([0-9]+<<[0-9]+\)" "sys/unistd.h" gen_table "rlimit" "RLIMIT_[A-Z]+[[:space:]]+[0-9]+" "sys/resource.h" +gen_table "rusage" "RUSAGE_[A-Z]+[[:space:]]+[-0-9]+" "sys/resource.h" gen_table "schedpolicy" "SCHED_[A-Z]+[[:space:]]+[0-9]+" "sched.h" gen_table "sendfileflags" "SF_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h" gen_table "shmatflags" "SHM_[A-Z]+[[:space:]]+[0-9]{6}+" "sys/shm.h" @@ -152,6 +155,11 @@ gen_table "sigcode" "SI_[A-Z]+[[:space:]]+0(x[ gen_table "umtxcvwaitflags" "CVWAIT_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/umtx.h" gen_table "umtxrwlockflags" "URWLOCK_PREFER_READER[[:space:]]+0x[0-9]+" "sys/umtx.h" gen_table "caprights" "CAP_[A-Z_]+[[:space:]]+CAPRIGHT\([0-9],[[:space:]]+0x[0-9]{16}ULL\)" "sys/capsicum.h" +if [ -e "${include_dir}/x86/sysarch.h" ]; then + gen_table "sysarchnum" "(AMD64|I386)_[A-Z86_]+[[:space:]]+[0-9]+" "x86/sysarch.h" +else + gen_table "sysarchnum" "[A-Z_]+[[:space:]]+[0-9]+" "machine/sysarch.h" +fi # Generate a .depend file for our output file if [ -n "$output_file" ]; then Modified: stable/11/lib/libsysdecode/sysdecode.h ============================================================================== --- stable/11/lib/libsysdecode/sysdecode.h Tue Nov 21 01:54:48 2017 (r326043) +++ stable/11/lib/libsysdecode/sysdecode.h Tue Nov 21 02:09:59 2017 (r326044) @@ -42,6 +42,7 @@ int sysdecode_abi_to_freebsd_errno(enum sysdecode_abi bool sysdecode_access_mode(FILE *_fp, int _mode, int *_rem); const char *sysdecode_acltype(int _type); const char *sysdecode_atfd(int _fd); +bool sysdecode_atflags(FILE *_fp, int _flags, int *_rem); bool sysdecode_cap_fcntlrights(FILE *_fp, uint32_t _rights, uint32_t *_rem); void sysdecode_cap_rights(FILE *_fp, cap_rights_t *_rightsp); const char *sysdecode_extattrnamespace(int _namespace); @@ -55,6 +56,7 @@ bool sysdecode_filemode(FILE *_fp, int _mode, int *_re bool sysdecode_flock_operation(FILE *_fp, int _operation, int *_rem); int sysdecode_freebsd_to_abi_errno(enum sysdecode_abi _abi, int _error); const char *sysdecode_getfsstat_mode(int _mode); +const char *sysdecode_getrusage_who(int _who); const char *sysdecode_idtype(int _idtype); const char *sysdecode_ioctlname(unsigned long _val); const char *sysdecode_ipproto(int _protocol); @@ -72,6 +74,7 @@ bool sysdecode_msg_flags(FILE *_fp, int _flags, int *_ bool sysdecode_msync_flags(FILE *_fp, int _flags, int *_rem); const char *sysdecode_nfssvc_flags(int _flags); bool sysdecode_open_flags(FILE *_fp, int _flags, int *_rem); +const char *sysdecode_pathconf_name(int _name); bool sysdecode_pipe2_flags(FILE *_fp, int _flags, int *_rem); const char *sysdecode_prio_which(int _which); const char *sysdecode_procctl_cmd(int _cmd); @@ -104,6 +107,7 @@ bool sysdecode_socket_type(FILE *_fp, int _type, int * const char *sysdecode_sockopt_level(int _level); const char *sysdecode_sockopt_name(int _level, int _optname); const char *sysdecode_syscallname(enum sysdecode_abi _abi, unsigned int _code); +const char *sysdecode_sysarch_number(int _number); bool sysdecode_thr_create_flags(FILE *_fp, int _flags, int *_rem); bool sysdecode_umtx_cvwait_flags(FILE *_fp, u_long _flags, u_long *_rem); const char *sysdecode_umtx_op(int _op); Modified: stable/11/lib/libsysdecode/sysdecode_enum.3 ============================================================================== --- stable/11/lib/libsysdecode/sysdecode_enum.3 Tue Nov 21 01:54:48 2017 (r326043) +++ stable/11/lib/libsysdecode/sysdecode_enum.3 Tue Nov 21 02:09:59 2017 (r326044) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 2, 2017 +.Dd September 3, 2017 .Dt sysdecode_enum 3 .Os .Sh NAME @@ -36,6 +36,7 @@ .Nm sysdecode_fadvice , .Nm sysdecode_fcntl_cmd , .Nm sysdecode_getfsstat_mode , +.Nm sysdecode_getrusage_who , .Nm sysdecode_idtype , .Nm sysdecode_ipproto , .Nm sysdecode_kldsym_cmd , @@ -45,6 +46,7 @@ .Nm sysdecode_minherit_flags , .Nm sysdecode_msgctl_cmd , .Nm sysdecode_nfssvc_flags , +.Nm sysdecode_pathconf_name , .Nm sysdecode_prio_which , .Nm sysdecode_procctl_cmd , .Nm sysdecode_ptrace_request , @@ -66,6 +68,7 @@ .Nm sysdecode_socketdomain , .Nm sysdecode_sockettype , .Nm sysdecode_sockopt_level , +.Nm sysdecode_sysarch_number , .Nm sysdecode_umtx_op , .Nm sysdecode_vmresult , .Nm sysdecode_whence @@ -89,6 +92,8 @@ .Ft const char * .Fn sysdecode_getfsstat_mode "int mode" .Ft const char * +.Fn sysdecode_getrusage_who "int who" +.Ft const char * .Fn sysdecode_idtype "int idtype" .Ft const char * .Fn sysdecode_ipproto "int protocol" @@ -107,6 +112,8 @@ .Ft const char * .Fn sysdecode_nfssvc_flags "int flags" .Ft const char * +.Fn sysdecode_pathconf_name "int name" +.Ft const char * .Fn sysdecode_prio_which "int which" .Ft const char * .Fn sysdecode_procctl_cmd "int cmd" @@ -149,6 +156,8 @@ .Ft const char * .Fn sysdecode_sockopt_level "int level" .Ft const char * +.Fn sysdecode_sysarch_number "int number" +.Ft const char * .Fn sysdecode_umtx_op "int op" .Ft const char * .Fn sysdecode_vmresult "int result" @@ -183,17 +192,20 @@ Most of these functions decode an argument passed to a .It Fn sysdecode_minherit_inherit Ta Xr minherit 2 Ta Fa inherit .It Fn sysdecode_msgctl_cmd Ta Xr msgctl 2 Ta Fa cmd .It Fn sysdecode_nfssvc_flags Ta Xr nfssvc 2 Ta Fa flags +.It Fn sysdecode_pathconf_name Ta Xr pathconf 2 Ta Fa name .It Fn sysdecode_prio_which Ta Xr getpriority 2 Ta Fa which .It Fn sysdecode_procctl_cmd Ta Xr procctl 2 Ta Fa cmd .It Fn sysdecode_ptrace_request Ta Xr ptrace 2 Ta Fa request .It Fn sysdecode_rlimit Ta Xr getrlimit 2 Ta Fa resource .It Fn sysdecode_rtprio_function Ta Xr rtprio 2 Ta Fa function +.It Fn sysdecode_getrusage_who Ta Xr getrusage 2 Ta Fa who .It Fn sysdecode_scheduler_policy Ta Xr sched_setscheduler 2 Ta Fa policy .It Fn sysdecode_semctl_cmd Ta Xr semctl 2 Ta Fa cmd .It Fn sysdecode_shmctl_cmd Ta Xr shmctl 2 Ta Fa cmd .It Fn sysdecode_shutdown_how Ta Xr shutdown 2 Ta Fa how .It Fn sysdecode_sigprocmask_how Ta Xr sigprocmask 2 Ta Fa how .It Fn sysdecode_sockopt_level Ta Xr getsockopt 2 Ta Fa level +.It Fn sysdecode_sysarch_number Ta Xr sysarch 2 Ta Fa number .It Fn sysdecode_umtx_op Ta Xr _umtx_op 2 Ta Fa op .It Fn sysdecode_whence Ta Xr lseek 2 Ta Fa whence .El Modified: stable/11/lib/libsysdecode/sysdecode_mask.3 ============================================================================== --- stable/11/lib/libsysdecode/sysdecode_mask.3 Tue Nov 21 01:54:48 2017 (r326043) +++ stable/11/lib/libsysdecode/sysdecode_mask.3 Tue Nov 21 02:09:59 2017 (r326044) @@ -25,12 +25,13 @@ .\" .\" $FreeBSD$ .\" -.Dd January 2, 2017 +.Dd September 3, 2017 .Dt sysdecode_mask 3 .Os .Sh NAME .Nm sysdecode_mask , .Nm sysdecode_accessmode , +.Nm sysdecode_atflags , .Nm sysdecode_capfcntlrights , .Nm sysdecode_fcntl_fileflags , .Nm sysdecode_fileflags , @@ -66,6 +67,8 @@ .Ft bool .Fn sysdecode_access_mode "FILE *fp" "int mode" "int *rem" .Ft bool +.Fn sysdecode_atflags "FILE *fp" "int flags" "int *rem" +.Ft bool .Fn sysdecode_cap_fcntlrights "FILE *fp" "uint32_t rights" "uint32_t *rem" .Ft bool .Fn sysdecode_fcntl_fileflags "FILE *fp" "int flags" "int *rem" @@ -148,6 +151,7 @@ Most of these functions decode an argument passed to a .Bl -column "Fn sysdecode_flock_operation" "Xr cap_fcntls_limit 2" .It Sy Function Ta Sy System Call Ta Sy Argument .It Fn sysdecode_access_mode Ta Xr access 2 Ta Fa mode +.It Fn sysdecode_atflags Ta Xr chflagsat 2 , Xr fstatat 2 Ta Fa atflag , Fa flag .It Fn sysdecode_cap_fcntlrights Ta Xr cap_fcntls_limit 2 Ta Fa fcntlrights .It Fn sysdecode_fileflags Ta Xr chflags 2 Ta Fa flags .It Fn sysdecode_filemode Ta Xr chmod 2 , Xr open 2 Ta mode Modified: stable/11/usr.bin/kdump/kdump.c ============================================================================== --- stable/11/usr.bin/kdump/kdump.c Tue Nov 21 01:54:48 2017 (r326043) +++ stable/11/usr.bin/kdump/kdump.c Tue Nov 21 02:09:59 2017 (r326044) @@ -1097,11 +1097,20 @@ ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags) ip++; narg--; break; - case SYS_setpriority: + case SYS_pathconf: + case SYS_lpathconf: + case SYS_fpathconf: print_number(ip, narg, c); - print_number(ip, narg, c); putchar(','); + print_integer_arg(sysdecode_pathconf_name, *ip); + ip++; + narg--; + break; + case SYS_getpriority: + case SYS_setpriority: + putchar('('); print_integer_arg(sysdecode_prio_which, *ip); + c = ','; ip++; narg--; break; @@ -1227,6 +1236,13 @@ ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags) narg--; c = ','; break; + case SYS_getrusage: + putchar('('); + print_integer_arg(sysdecode_getrusage_who, *ip); + ip++; + narg--; + c = ','; + break; case SYS_quotactl: print_number(ip, narg, c); putchar(','); @@ -1249,6 +1265,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags) c = ','; break; case SYS_rtprio: + case SYS_rtprio_thread: putchar('('); print_integer_arg(sysdecode_rtprio_function, *ip); @@ -1448,6 +1465,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags) print_integer_arg_valid(sysdecode_atfd, *ip); ip++; narg--; + print_number(ip, narg, c); break; case SYS_cap_fcntls_limit: print_number(ip, narg, c); @@ -1505,6 +1523,41 @@ ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags) case SYS_truncate: print_number(ip, narg, c); print_number64(first, ip, narg, c); + break; + case SYS_fchownat: + print_number(ip, narg, c); + print_number(ip, narg, c); + print_number(ip, narg, c); + break; + case SYS_fstatat: + case SYS_utimensat: + print_number(ip, narg, c); + print_number(ip, narg, c); + break; + case SYS_unlinkat: + print_number(ip, narg, c); + break; + case SYS_sysarch: + putchar('('); + print_integer_arg(sysdecode_sysarch_number, *ip); + ip++; + narg--; + c = ','; + break; + } + switch (ktr->ktr_code) { + case SYS_chflagsat: + case SYS_fchownat: + case SYS_faccessat: + case SYS_fchmodat: + case SYS_fstatat: + case SYS_linkat: + case SYS_unlinkat: + case SYS_utimensat: + putchar(','); + print_mask_arg0(sysdecode_atflags, *ip); + ip++; + narg--; break; } } Modified: stable/11/usr.bin/truss/extern.h ============================================================================== --- stable/11/usr.bin/truss/extern.h Tue Nov 21 01:54:48 2017 (r326043) +++ stable/11/usr.bin/truss/extern.h Tue Nov 21 02:09:59 2017 (r326044) @@ -35,5 +35,5 @@ extern int print_line_prefix(struct trussinfo *); extern void setup_and_wait(struct trussinfo *, char **); extern void start_tracing(struct trussinfo *, pid_t); extern void restore_proc(int); +extern void decode_siginfo(FILE *, siginfo_t *); extern void eventloop(struct trussinfo *); -extern const char *ioctlname(unsigned long val); Modified: stable/11/usr.bin/truss/setup.c ============================================================================== --- stable/11/usr.bin/truss/setup.c Tue Nov 21 01:54:48 2017 (r326043) +++ stable/11/usr.bin/truss/setup.c Tue Nov 21 02:09:59 2017 (r326044) @@ -584,8 +584,62 @@ report_new_child(struct trussinfo *info) fprintf(info->outfile, "\n"); } +void +decode_siginfo(FILE *fp, siginfo_t *si) +{ + const char *str; + + fprintf(fp, " code="); + str = sysdecode_sigcode(si->si_signo, si->si_code); + if (str == NULL) + fprintf(fp, "%d", si->si_code); + else + fprintf(fp, "%s", str); + switch (si->si_code) { + case SI_NOINFO: + break; + case SI_QUEUE: + fprintf(fp, " value=%p", si->si_value.sival_ptr); + /* FALLTHROUGH */ + case SI_USER: + case SI_LWP: + fprintf(fp, " pid=%jd uid=%jd", (intmax_t)si->si_pid, + (intmax_t)si->si_uid); + break; + case SI_TIMER: + fprintf(fp, " value=%p", si->si_value.sival_ptr); + fprintf(fp, " timerid=%d", si->si_timerid); + fprintf(fp, " overrun=%d", si->si_overrun); + if (si->si_errno != 0) + fprintf(fp, " errno=%d", si->si_errno); + break; + case SI_ASYNCIO: + fprintf(fp, " value=%p", si->si_value.sival_ptr); + break; + case SI_MESGQ: + fprintf(fp, " value=%p", si->si_value.sival_ptr); + fprintf(fp, " mqd=%d", si->si_mqd); + break; + default: + switch (si->si_signo) { + case SIGILL: + case SIGFPE: + case SIGSEGV: + case SIGBUS: + fprintf(fp, " trapno=%d", si->si_trapno); + fprintf(fp, " addr=%p", si->si_addr); + break; + case SIGCHLD: + fprintf(fp, " pid=%jd uid=%jd", (intmax_t)si->si_pid, + (intmax_t)si->si_uid); + fprintf(fp, " status=%d", si->si_status); + break; + } + } +} + static void -report_signal(struct trussinfo *info, siginfo_t *si) +report_signal(struct trussinfo *info, siginfo_t *si, struct ptrace_lwpinfo *pl) { struct threadinfo *t; const char *signame; @@ -596,7 +650,11 @@ report_signal(struct trussinfo *info, siginfo_t *si) signame = sysdecode_signal(si->si_status); if (signame == NULL) signame = "?"; - fprintf(info->outfile, "SIGNAL %u (%s)\n", si->si_status, signame); + fprintf(info->outfile, "SIGNAL %u (%s)", si->si_status, signame); + if (pl->pl_event == PL_EVENT_SIGNAL && pl->pl_flags & PL_FLAG_SI) + decode_siginfo(info->outfile, &pl->pl_siginfo); + fprintf(info->outfile, "\n"); + } /* @@ -673,7 +731,7 @@ eventloop(struct trussinfo *info) pending_signal = 0; } else { if ((info->flags & NOSIGS) == 0) - report_signal(info, &si); + report_signal(info, &si, &pl); pending_signal = si.si_status; } ptrace(PT_SYSCALL, si.si_pid, (caddr_t)1, Modified: stable/11/usr.bin/truss/syscall.h ============================================================================== --- stable/11/usr.bin/truss/syscall.h Tue Nov 21 01:54:48 2017 (r326043) +++ stable/11/usr.bin/truss/syscall.h Tue Nov 21 02:09:59 2017 (r326044) @@ -28,6 +28,7 @@ * Kevent -- a pointer to an array of struct kevents. Prints all elements. * Pathconf -- the 2nd argument of pathconf(). * Utrace -- utrace(2) buffer. + * CapRights -- a pointer to a cap_rights_t. Prints all set capabilities. * * In addition, the pointer types (String, Ptr) may have OUT masked in -- * this means that the data is set on *return* from the system call -- or @@ -41,13 +42,16 @@ enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHe Quad, Signal, Sockaddr, StringArray, Timespec, Timeval, Itimerval, Pollfd, Fd_set, Sigaction, Fcntl, Mprot, Mmapflags, Whence, Readlinkres, Sigset, Sigprocmask, StatFs, Kevent, Sockdomain, Socktype, Open, - Fcntlflag, Rusage, BinString, Shutdown, Resource, Rlimit, Timeval2, - Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl, + Fcntlflag, Rusage, RusageWho, BinString, Shutdown, Resource, Rlimit, + Timeval2, Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl, LinuxSockArgs, Umtxop, Atfd, Atflags, Timespec2, Accessmode, Long, Sysarch, ExecArgs, ExecEnv, PipeFds, QuadHex, Utrace, IntArray, Pipe2, CapFcntlRights, Fadvice, FileFlags, Flockop, Getfsstatmode, Kldsymcmd, Kldunloadflags, Sizet, Madvice, Socklent, Sockprotocol, Sockoptlevel, - Sockoptname, Msgflags, + Sockoptname, Msgflags, CapRights, PUInt, PQuadHex, Acltype, + Extattrnamespace, Minherit, Mlockall, Mountflags, Msync, Priowhich, + Ptraceop, Quotactlcmd, Reboothowto, Rtpriofunc, Schedpolicy, Schedparam, + PSig, Siginfo, CloudABIAdvice, CloudABIClockID, ClouduABIFDSFlags, CloudABIFDStat, CloudABIFileStat, CloudABIFileType, Modified: stable/11/usr.bin/truss/syscalls.c ============================================================================== --- stable/11/usr.bin/truss/syscalls.c Tue Nov 21 01:54:48 2017 (r326043) +++ stable/11/usr.bin/truss/syscalls.c Tue Nov 21 02:09:59 2017 (r326044) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); * arguments. */ +#include #include #include #include @@ -47,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -76,6 +77,32 @@ __FBSDID("$FreeBSD$"); */ static struct syscall decoded_syscalls[] = { /* Native ABI */ + { .name = "__acl_aclcheck_fd", .ret_type = 1, .nargs = 3, + .args = { { Int, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, + { .name = "__acl_aclcheck_file", .ret_type = 1, .nargs = 3, + .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, + { .name = "__acl_aclcheck_link", .ret_type = 1, .nargs = 3, + .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, + { .name = "__acl_delete_fd", .ret_type = 1, .nargs = 2, + .args = { { Int, 0 }, { Acltype, 1 } } }, + { .name = "__acl_delete_file", .ret_type = 1, .nargs = 2, + .args = { { Name, 0 }, { Acltype, 1 } } }, + { .name = "__acl_delete_link", .ret_type = 1, .nargs = 2, + .args = { { Name, 0 }, { Acltype, 1 } } }, + { .name = "__acl_get_fd", .ret_type = 1, .nargs = 3, + .args = { { Int, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, + { .name = "__acl_get_file", .ret_type = 1, .nargs = 3, + .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, + { .name = "__acl_get_link", .ret_type = 1, .nargs = 3, + .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, + { .name = "__acl_set_fd", .ret_type = 1, .nargs = 3, + .args = { { Int, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, + { .name = "__acl_set_file", .ret_type = 1, .nargs = 3, + .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, + { .name = "__acl_set_link", .ret_type = 1, .nargs = 3, + .args = { { Name, 0 }, { Acltype, 1 }, { Ptr, 2 } } }, + { .name = "__cap_rights_get", .ret_type = 1, .nargs = 3, + .args = { { Int, 0 }, { Int, 1 }, { CapRights | OUT, 2 } } }, { .name = "__getcwd", .ret_type = 1, .nargs = 2, .args = { { Name | OUT, 0 }, { Int, 1 } } }, { .name = "_umtx_op", .ret_type = 1, .nargs = 5, @@ -96,6 +123,10 @@ static struct syscall decoded_syscalls[] = { .args = { { Int, 0 }, { CapFcntlRights | OUT, 1 } } }, { .name = "cap_fcntls_limit", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { CapFcntlRights, 1 } } }, + { .name = "cap_getmode", .ret_type = 1, .nargs = 1, + .args = { { PUInt | OUT, 0 } } }, + { .name = "cap_rights_limit", .ret_type = 1, .nargs = 2, + .args = { { Int, 0 }, { CapRights, 1 } } }, { .name = "chdir", .ret_type = 1, .nargs = 1, .args = { { Name, 0 } } }, { .name = "chflags", .ret_type = 1, .nargs = 2, @@ -118,6 +149,10 @@ static struct syscall decoded_syscalls[] = { { .name = "connectat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Int, 1 }, { Sockaddr | IN, 2 }, { Int, 3 } } }, + { .name = "dup", .ret_type = 1, .nargs = 1, + .args = { { Int, 0 } } }, + { .name = "dup2", .ret_type = 1, .nargs = 2, + .args = { { Int, 0 }, { Int, 1 } } }, { .name = "eaccess", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Accessmode, 1 } } }, { .name = "execve", .ret_type = 1, .nargs = 3, @@ -125,6 +160,42 @@ static struct syscall decoded_syscalls[] = { { ExecEnv | IN, 2 } } }, { .name = "exit", .ret_type = 0, .nargs = 1, .args = { { Hex, 0 } } }, + { .name = "extattr_delete_fd", .ret_type = 1, .nargs = 3, + .args = { { Int, 0 }, { Extattrnamespace, 1 }, { Name, 2 } } }, + { .name = "extattr_delete_file", .ret_type = 1, .nargs = 3, + .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 } } }, + { .name = "extattr_delete_link", .ret_type = 1, .nargs = 3, + .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 } } }, + { .name = "extattr_get_fd", .ret_type = 1, .nargs = 5, + .args = { { Int, 0 }, { Extattrnamespace, 1 }, { Name, 2 }, + { BinString | OUT, 3 }, { Sizet, 4 } } }, + { .name = "extattr_get_file", .ret_type = 1, .nargs = 5, + .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 }, + { BinString | OUT, 3 }, { Sizet, 4 } } }, + { .name = "extattr_get_link", .ret_type = 1, .nargs = 5, + .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 }, + { BinString | OUT, 3 }, { Sizet, 4 } } }, + { .name = "extattr_list_fd", .ret_type = 1, .nargs = 4, + .args = { { Int, 0 }, { Extattrnamespace, 1 }, { BinString | OUT, 2 }, + { Sizet, 3 } } }, + { .name = "extattr_list_file", .ret_type = 1, .nargs = 4, + .args = { { Name, 0 }, { Extattrnamespace, 1 }, { BinString | OUT, 2 }, + { Sizet, 3 } } }, + { .name = "extattr_list_link", .ret_type = 1, .nargs = 4, + .args = { { Name, 0 }, { Extattrnamespace, 1 }, { BinString | OUT, 2 }, + { Sizet, 3 } } }, + { .name = "extattr_set_fd", .ret_type = 1, .nargs = 5, + .args = { { Int, 0 }, { Extattrnamespace, 1 }, { Name, 2 }, + { BinString | IN, 3 }, { Sizet, 4 } } }, + { .name = "extattr_set_file", .ret_type = 1, .nargs = 5, + .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 }, + { BinString | IN, 3 }, { Sizet, 4 } } }, + { .name = "extattr_set_link", .ret_type = 1, .nargs = 5, + .args = { { Name, 0 }, { Extattrnamespace, 1 }, { Name, 2 }, + { BinString | IN, 3 }, { Sizet, 4 } } }, + { .name = "extattrctl", .ret_type = 1, .nargs = 5, + .args = { { Name, 0 }, { Hex, 1 }, { Name, 2 }, + { Extattrnamespace, 3 }, { Name, 4 } } }, { .name = "faccessat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name | IN, 1 }, { Accessmode, 2 }, { Atflags, 3 } } }, @@ -158,6 +229,9 @@ static struct syscall decoded_syscalls[] = { .args = { { Int, 0 }, { Timeval2 | IN, 1 } } }, { .name = "futimesat", .ret_type = 1, .nargs = 3, .args = { { Atfd, 0 }, { Name | IN, 1 }, { Timeval2 | IN, 2 } } }, + { .name = "getdirentries", .ret_type = 1, .nargs = 4, + .args = { { Int, 0 }, { BinString | OUT, 1 }, { Int, 2 }, + { PQuadHex | OUT, 3 } } }, { .name = "getfsstat", .ret_type = 1, .nargs = 3, .args = { { Ptr, 0 }, { Long, 1 }, { Getfsstatmode, 2 } } }, { .name = "getitimer", .ret_type = 1, .nargs = 2, @@ -166,10 +240,12 @@ static struct syscall decoded_syscalls[] = { .args = { { Int, 0 }, { Sockaddr | OUT, 1 }, { Ptr | OUT, 2 } } }, { .name = "getpgid", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, + { .name = "getpriority", .ret_type = 1, .nargs = 2, + .args = { { Priowhich, 0 }, { Int, 1 } } }, { .name = "getrlimit", .ret_type = 1, .nargs = 2, .args = { { Resource, 0 }, { Rlimit | OUT, 1 } } }, { .name = "getrusage", .ret_type = 1, .nargs = 2, - .args = { { Int, 0 }, { Rusage | OUT, 1 } } }, + .args = { { RusageWho, 0 }, { Rusage | OUT, 1 } } }, { .name = "getsid", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, { .name = "getsockname", .ret_type = 1, .nargs = 3, @@ -225,6 +301,8 @@ static struct syscall decoded_syscalls[] = { .args = { { Name | IN, 0 }, { Timeval2 | IN, 1 } } }, { .name = "madvise", .ret_type = 1, .nargs = 3, .args = { { Ptr, 0 }, { Sizet, 1 }, { Madvice, 2 } } }, + { .name = "minherit", .ret_type = 1, .nargs = 3, + .args = { { Ptr, 0 }, { Sizet, 1 }, { Minherit, 2 } } }, { .name = "mkdir", .ret_type = 1, .nargs = 2, .args = { { Name, 0 }, { Octal, 1 } } }, { .name = "mkdirat", .ret_type = 1, .nargs = 3, @@ -237,19 +315,29 @@ static struct syscall decoded_syscalls[] = { .args = { { Name, 0 }, { Octal, 1 }, { Int, 2 } } }, { .name = "mknodat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name, 1 }, { Octal, 2 }, { Int, 3 } } }, + { .name = "mlock", .ret_type = 1, .nargs = 2, + .args = { { Ptr, 0 }, { Sizet, 1 } } }, + { .name = "mlockall", .ret_type = 1, .nargs = 1, + .args = { { Mlockall, 0 } } }, { .name = "mmap", .ret_type = 1, .nargs = 6, .args = { { Ptr, 0 }, { Sizet, 1 }, { Mprot, 2 }, { Mmapflags, 3 }, { Int, 4 }, { QuadHex, 5 } } }, { .name = "modfind", .ret_type = 1, .nargs = 1, .args = { { Name | IN, 0 } } }, { .name = "mount", .ret_type = 1, .nargs = 4, - .args = { { Name, 0 }, { Name, 1 }, { Int, 2 }, { Ptr, 3 } } }, + .args = { { Name, 0 }, { Name, 1 }, { Mountflags, 2 }, { Ptr, 3 } } }, { .name = "mprotect", .ret_type = 1, .nargs = 3, .args = { { Ptr, 0 }, { Sizet, 1 }, { Mprot, 2 } } }, + { .name = "msync", .ret_type = 1, .nargs = 3, + .args = { { Ptr, 0 }, { Sizet, 1 }, { Msync, 2 } } }, + { .name = "munlock", .ret_type = 1, .nargs = 2, + .args = { { Ptr, 0 }, { Sizet, 1 } } }, { .name = "munmap", .ret_type = 1, .nargs = 2, .args = { { Ptr, 0 }, { Sizet, 1 } } }, { .name = "nanosleep", .ret_type = 1, .nargs = 1, .args = { { Timespec, 0 } } }, + { .name = "nmount", .ret_type = 1, .nargs = 3, + .args = { { Ptr, 0 }, { UInt, 1 }, { Mountflags, 2 } } }, { .name = "open", .ret_type = 1, .nargs = 3, .args = { { Name | IN, 0 }, { Open, 1 }, { Octal, 2 } } }, { .name = "openat", .ret_type = 1, .nargs = 4, @@ -268,8 +356,18 @@ static struct syscall decoded_syscalls[] = { { Fadvice, 3 } } }, { .name = "posix_openpt", .ret_type = 1, .nargs = 1, .args = { { Open, 0 } } }, + { .name = "pread", .ret_type = 1, .nargs = 4, + .args = { { Int, 0 }, { BinString | OUT, 1 }, { Sizet, 2 }, + { QuadHex, 3 } } }, { .name = "procctl", .ret_type = 1, .nargs = 4, .args = { { Idtype, 0 }, { Quad, 1 }, { Procctl, 2 }, { Ptr, 3 } } }, + { .name = "ptrace", .ret_type = 1, .nargs = 4, + .args = { { Ptraceop, 0 }, { Int, 1 }, { Ptr, 2 }, { Int, 3 } } }, + { .name = "pwrite", .ret_type = 1, .nargs = 4, + .args = { { Int, 0 }, { BinString | IN, 1 }, { Sizet, 2 }, + { QuadHex, 3 } } }, + { .name = "quotactl", .ret_type = 1, .nargs = 4, + .args = { { Name, 0 }, { Quotactlcmd, 1 }, { Int, 2 }, { Ptr, 3 } } }, { .name = "read", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { BinString | OUT, 1 }, { Sizet, 2 } } }, { .name = "readlink", .ret_type = 1, .nargs = 3, @@ -277,6 +375,8 @@ static struct syscall decoded_syscalls[] = { { .name = "readlinkat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name, 1 }, { Readlinkres | OUT, 2 }, { Sizet, 3 } } }, + { .name = "reboot", .ret_type = 1, .nargs = 1, + .args = { { Reboothowto, 0 } } }, { .name = "recvfrom", .ret_type = 1, .nargs = 6, .args = { { Int, 0 }, { BinString | OUT, 1 }, { Sizet, 2 }, { Msgflags, 3 }, { Sockaddr | OUT, 4 }, @@ -291,6 +391,24 @@ static struct syscall decoded_syscalls[] = { .args = { { Rforkflags, 0 } } }, { .name = "rmdir", .ret_type = 1, .nargs = 1, .args = { { Name, 0 } } }, + { .name = "rtprio", .ret_type = 1, .nargs = 3, + .args = { { Rtpriofunc, 0 }, { Int, 1 }, { Ptr, 2 } } }, + { .name = "rtprio_thread", .ret_type = 1, .nargs = 3, + .args = { { Rtpriofunc, 0 }, { Int, 1 }, { Ptr, 2 } } }, + { .name = "sched_get_priority_max", .ret_type = 1, .nargs = 1, + .args = { { Schedpolicy, 0 } } }, + { .name = "sched_get_priority_min", .ret_type = 1, .nargs = 1, + .args = { { Schedpolicy, 0 } } }, + { .name = "sched_getparam", .ret_type = 1, .nargs = 2, + .args = { { Int, 0 }, { Schedparam | OUT, 1 } } }, + { .name = "sched_getscheduler", .ret_type = 1, .nargs = 1, + .args = { { Int, 0 } } }, + { .name = "sched_rr_get_interval", .ret_type = 1, .nargs = 2, + .args = { { Int, 0 }, { Timespec | OUT, 1 } } }, + { .name = "sched_setparam", .ret_type = 1, .nargs = 2, + .args = { { Int, 0 }, { Schedparam, 1 } } }, + { .name = "sched_setscheduler", .ret_type = 1, .nargs = 3, + .args = { { Int, 0 }, { Schedpolicy, 1 }, { Schedparam, 2 } } }, { .name = "sctp_generic_recvmsg", .ret_type = 1, .nargs = 7, .args = { { Int, 0 }, { Ptr | IN, 1 }, { Int, 2 }, { Sockaddr | OUT, 3 }, { Ptr | OUT, 4 }, { Ptr | OUT, 5 }, @@ -310,6 +428,8 @@ static struct syscall decoded_syscalls[] = { { Socklent | IN, 5 } } }, { .name = "setitimer", .ret_type = 1, .nargs = 3, .args = { { Int, 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, .args = { { Resource, 0 }, { Rlimit | IN, 1 } } }, { .name = "setsockopt", .ret_type = 1, .nargs = 5, @@ -331,11 +451,12 @@ static struct syscall decoded_syscalls[] = { { .name = "sigsuspend", .ret_type = 1, .nargs = 1, .args = { { Sigset | IN, 0 } } }, { .name = "sigtimedwait", .ret_type = 1, .nargs = 3, - .args = { { Sigset | IN, 0 }, { Ptr, 1 }, { Timespec | IN, 2 } } }, + .args = { { Sigset | IN, 0 }, { Siginfo | OUT, 1 }, + { Timespec | IN, 2 } } }, { .name = "sigwait", .ret_type = 1, .nargs = 2, - .args = { { Sigset | IN, 0 }, { Ptr, 1 } } }, + .args = { { Sigset | IN, 0 }, { PSig | OUT, 1 } } }, { .name = "sigwaitinfo", .ret_type = 1, .nargs = 2, - .args = { { Sigset | IN, 0 }, { Ptr, 1 } } }, + .args = { { Sigset | IN, 0 }, { Siginfo | OUT, 1 } } }, { .name = "socket", .ret_type = 1, .nargs = 3, .args = { { Sockdomain, 0 }, { Socktype, 1 }, { Sockprotocol, 2 } } }, { .name = "stat", .ret_type = 1, .nargs = 2, @@ -352,6 +473,8 @@ static struct syscall decoded_syscalls[] = { .args = { { Long, 0 }, { Signal, 1 } } }, { .name = "thr_self", .ret_type = 1, .nargs = 1, .args = { { Ptr, 0 } } }, + { .name = "thr_set_name", .ret_type = 1, .nargs = 2, + .args = { { Long, 0 }, { Name, 1 } } }, { .name = "truncate", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { QuadHex | IN, 1 } } }, #if 0 @@ -364,7 +487,7 @@ static struct syscall decoded_syscalls[] = { { .name = "unlinkat", .ret_type = 1, .nargs = 3, .args = { { Atfd, 0 }, { Name, 1 }, { Atflags, 2 } } }, { .name = "unmount", .ret_type = 1, .nargs = 2, - .args = { { Name, 0 }, { Int, 1 } } }, + .args = { { Name, 0 }, { Mountflags, 1 } } }, { .name = "utimensat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name | IN, 1 }, { Timespec2 | IN, 2 }, { Atflags, 3 } } }, @@ -377,7 +500,8 @@ static struct syscall decoded_syscalls[] = { { Rusage | OUT, 3 } } }, { .name = "wait6", .ret_type = 1, .nargs = 6, .args = { { Idtype, 0 }, { Quad, 1 }, { ExitStatus | OUT, 2 }, - { Waitoptions, 3 }, { Rusage | OUT, 4 }, { Ptr, 5 } } }, + { Waitoptions, 3 }, { Rusage | OUT, 4 }, + { Siginfo | OUT, 5 } } }, { .name = "write", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { BinString | IN, 1 }, { Sizet, 2 } } }, @@ -562,35 +686,6 @@ static struct xlat sigaction_flags[] = { X(SA_NODEFER) X(SA_NOCLDWAIT) X(SA_SIGINFO) XEND }; -static struct xlat pathconf_arg[] = { - X(_PC_LINK_MAX) X(_PC_MAX_CANON) X(_PC_MAX_INPUT) - X(_PC_NAME_MAX) X(_PC_PATH_MAX) X(_PC_PIPE_BUF) - X(_PC_CHOWN_RESTRICTED) X(_PC_NO_TRUNC) X(_PC_VDISABLE) - X(_PC_ASYNC_IO) X(_PC_PRIO_IO) X(_PC_SYNC_IO) - X(_PC_ALLOC_SIZE_MIN) X(_PC_FILESIZEBITS) - X(_PC_REC_INCR_XFER_SIZE) X(_PC_REC_MAX_XFER_SIZE) - X(_PC_REC_MIN_XFER_SIZE) X(_PC_REC_XFER_ALIGN) - X(_PC_SYMLINK_MAX) X(_PC_ACL_EXTENDED) X(_PC_ACL_PATH_MAX) - X(_PC_CAP_PRESENT) X(_PC_INF_PRESENT) X(_PC_MAC_PRESENT) - X(_PC_ACL_NFS4) X(_PC_MIN_HOLE_SIZE) XEND -}; - -static struct xlat at_flags[] = { - X(AT_EACCESS) X(AT_SYMLINK_NOFOLLOW) X(AT_SYMLINK_FOLLOW) - X(AT_REMOVEDIR) XEND -}; - -static struct xlat sysarch_ops[] = { -#if defined(__i386__) || defined(__amd64__) - X(I386_GET_LDT) X(I386_SET_LDT) X(I386_GET_IOPERM) X(I386_SET_IOPERM) - X(I386_VM86) X(I386_GET_FSBASE) X(I386_SET_FSBASE) X(I386_GET_GSBASE) - X(I386_SET_GSBASE) X(I386_GET_XFPUSTATE) X(AMD64_GET_FSBASE) - X(AMD64_SET_FSBASE) X(AMD64_GET_GSBASE) X(AMD64_SET_GSBASE) - X(AMD64_GET_XFPUSTATE) -#endif - XEND -}; - static struct xlat linux_socketcall_ops[] = { X(LINUX_SOCKET) X(LINUX_BIND) X(LINUX_CONNECT) X(LINUX_LISTEN) X(LINUX_ACCEPT) X(LINUX_GETSOCKNAME) X(LINUX_GETPEERNAME) @@ -1135,6 +1230,16 @@ print_arg(struct syscall_args *sc, unsigned long *args case UInt: fprintf(fp, "%u", (unsigned int)args[sc->offset]); break; + case PUInt: { + unsigned int val; + + if (get_struct(pid, (void *)args[sc->offset], &val, + sizeof(val)) == 0) + fprintf(fp, "{ %u }", val); + else + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } case LongHex: fprintf(fp, "0x%lx", args[sc->offset]); break; @@ -1287,6 +1392,16 @@ print_arg(struct syscall_args *sc, unsigned long *args break; } #endif + case PQuadHex: { + uint64_t val; + + if (get_struct(pid, (void *)args[sc->offset], &val, + sizeof(val)) == 0) + fprintf(fp, "{ 0x%jx }", (uintmax_t)val); + else + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } case Ptr: fprintf(fp, "0x%lx", args[sc->offset]); break; @@ -1529,8 +1644,11 @@ print_arg(struct syscall_args *sc, unsigned long *args case Resource: print_integer_arg(sysdecode_rlimit, fp, args[sc->offset]); break; + case RusageWho: + print_integer_arg(sysdecode_getrusage_who, fp, args[sc->offset]); + break; case Pathconf: - fputs(xlookup(pathconf_arg, args[sc->offset]), fp); + print_integer_arg(sysdecode_pathconf_name, fp, args[sc->offset]); break; case Rforkflags: print_mask_arg(sysdecode_rfork_flags, fp, args[sc->offset]); @@ -1779,13 +1897,14 @@ print_arg(struct syscall_args *sc, unsigned long *args print_integer_arg(sysdecode_atfd, fp, args[sc->offset]); break; case Atflags: - fputs(xlookup_bits(at_flags, args[sc->offset]), fp); + print_mask_arg(sysdecode_atflags, fp, args[sc->offset]); break; case Accessmode: print_mask_arg(sysdecode_access_mode, fp, args[sc->offset]); break; case Sysarch: - fputs(xlookup(sysarch_ops, args[sc->offset]), fp); + print_integer_arg(sysdecode_sysarch_number, fp, + args[sc->offset]); break; case PipeFds: /* @@ -1926,6 +2045,92 @@ print_arg(struct syscall_args *sc, unsigned long *args case Msgflags: print_mask_arg(sysdecode_msg_flags, fp, args[sc->offset]); break; + case CapRights: { + cap_rights_t rights; + + if (get_struct(pid, (void *)args[sc->offset], &rights, + sizeof(rights)) != -1) { + fputs("{ ", fp); + sysdecode_cap_rights(fp, &rights); + fputs(" }", fp); + } else + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } + case Acltype: + print_integer_arg(sysdecode_acltype, fp, args[sc->offset]); + break; + case Extattrnamespace: + print_integer_arg(sysdecode_extattrnamespace, fp, + args[sc->offset]); + break; + case Minherit: + print_integer_arg(sysdecode_minherit_inherit, fp, + args[sc->offset]); + break; + case Mlockall: + print_mask_arg(sysdecode_mlockall_flags, fp, args[sc->offset]); + break; + case Mountflags: + print_mask_arg(sysdecode_mount_flags, fp, args[sc->offset]); + break; + case Msync: + print_mask_arg(sysdecode_msync_flags, fp, args[sc->offset]); + break; + case Priowhich: + print_integer_arg(sysdecode_prio_which, fp, args[sc->offset]); + break; + case Ptraceop: + print_integer_arg(sysdecode_ptrace_request, fp, + args[sc->offset]); + break; + case Quotactlcmd: + if (!sysdecode_quotactl_cmd(fp, args[sc->offset])) + fprintf(fp, "%#x", (int)args[sc->offset]); + break; + case Reboothowto: + print_mask_arg(sysdecode_reboot_howto, fp, args[sc->offset]); + break; + case Rtpriofunc: + print_integer_arg(sysdecode_rtprio_function, fp, + args[sc->offset]); + break; + case Schedpolicy: + print_integer_arg(sysdecode_scheduler_policy, fp, + args[sc->offset]); + break; + case Schedparam: { + struct sched_param sp; + + if (get_struct(pid, (void *)args[sc->offset], &sp, + sizeof(sp)) != -1) + fprintf(fp, "{ %d }", sp.sched_priority); + else + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } + case PSig: { + int sig; + + if (get_struct(pid, (void *)args[sc->offset], &sig, + sizeof(sig)) == 0) + fprintf(fp, "{ %s }", strsig2(sig)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***