kdump(1): Add clockid_t name printing.
authorSascha Wildner <saw@online.de>
Sat, 5 Aug 2017 00:01:41 +0000 (02:01 +0200)
committerSascha Wildner <saw@online.de>
Sat, 5 Aug 2017 00:11:56 +0000 (02:11 +0200)
usr.bin/kdump/kdump.c
usr.bin/kdump/kdump_subr.h
usr.bin/kdump/mksubr

index c534456..4d58076 100644 (file)
@@ -674,6 +674,14 @@ ktrsyscall(struct ktr_syscall *ktr)
                                c = ',';
                                ip++;
                                narg--;
+                       } else if (ktr->ktr_code == SYS_clock_getres ||
+                                  ktr->ktr_code == SYS_clock_gettime ||
+                                  ktr->ktr_code == SYS_clock_settime) {
+                               putchar('(');
+                               clockidname((int)*ip);
+                               ip++;
+                               narg--;
+                               c = ',';
                        }
                }
                while (narg > 0) {
index 304e7d5..7fe4f76 100644 (file)
@@ -1,5 +1,4 @@
 /* $FreeBSD: src/usr.bin/kdump/kdump_subr.h,v 1.3 2007/04/09 22:04:27 emaste Exp $ */
-/* $DragonFly: src/usr.bin/kdump/kdump_subr.h,v 1.1 2008/01/01 14:09:02 matthias Exp $ */
 
 void signame (int);
 void semctlname (int);
@@ -47,3 +46,4 @@ void lio_listioname (int);
 void minheritname (int);
 void quotactlname (int);
 void ptraceopname (int);
+void clockidname (int);
index 16d8075..15d60c5 100644 (file)
@@ -147,6 +147,7 @@ cat <<_EOF_
 #define _KERNEL_STRUCTURES
 
 #include <stdio.h>
+#include <time.h>
 #include <sys/fcntl.h>
 #include <sys/stat.h>
 #include <sys/unistd.h>
@@ -347,6 +348,7 @@ auto_if_type "sockipprotoname" "IPPROTO_[[:alnum:]]+[[:space:]]+" "netinet/in.h"
 auto_switch_type "sockoptname" "SO_[A-Z]+[[:space:]]+0x[0-9]+" "sys/socket.h"
 auto_switch_type "socktypename" "SOCK_[A-Z]+[[:space:]]+[1-9]+[0-9]*" "sys/socket.h"
 auto_switch_type "ptraceopname" "PT_[[:alnum:]]+[[:space:]]+[0-9]+" "sys/ptrace.h"
+auto_switch_type "clockidname" "CLOCK_[[:alnum:]]+" "time.h" "noinvdef"
 
 cat <<_EOF_
 /*