From 70ac47f0dffdaec060c3a31fd8ea15e7d490b0e3 Mon Sep 17 00:00:00 2001 From: jhb Date: Mon, 19 Mar 2012 21:33:35 +0000 Subject: [PATCH] MFC 232072: Pretty-print the advice constants passed to posix_fadvise(2). git-svn-id: svn://svn.freebsd.org/base/stable/8@233206 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- usr.bin/kdump/kdump.c | 8 ++++++++ usr.bin/kdump/kdump_subr.h | 1 + usr.bin/kdump/mksubr | 1 + 3 files changed, 10 insertions(+) diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index 04a6249d6..8a078aef8 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -939,6 +939,14 @@ ktrsyscall(struct ktr_syscall *ktr, u_int flags) kldunloadfflagsname ((int)*ip); ip++; narg--; + } else if (ktr->ktr_code == SYS_posix_fadvise) { + print_number(ip,narg,c); + print_number(ip,narg,c); + print_number(ip,narg,c); + (void)putchar(','); + fadvisebehavname((int)*ip); + ip++; + narg--; } } while (narg > 0) { diff --git a/usr.bin/kdump/kdump_subr.h b/usr.bin/kdump/kdump_subr.h index 50cf9ee4c..1c020a8ac 100644 --- a/usr.bin/kdump/kdump_subr.h +++ b/usr.bin/kdump/kdump_subr.h @@ -32,6 +32,7 @@ void whencename (int); void rlimitname (int); void shutdownhowname (int); void prioname (int); +void fadvisebehavname (int); void madvisebehavname (int); void msyncflagsname (int); void schedpolicyname (int); diff --git a/usr.bin/kdump/mksubr b/usr.bin/kdump/mksubr index a7b1d7cb1..01448692d 100644 --- a/usr.bin/kdump/mksubr +++ b/usr.bin/kdump/mksubr @@ -349,6 +349,7 @@ auto_switch_type "whencename" "SEEK_[A-Z]+[[:space:]]+[0-9]+" "sys/unistd.h" auto_switch_type "rlimitname" "RLIMIT_[A-Z]+[[:space:]]+[0-9]+" "sys/resource.h" auto_switch_type "shutdownhowname" "SHUT_[A-Z]+[[:space:]]+0x[0-9]+" "sys/socket.h" auto_switch_type "prioname" "PRIO_[A-Z]+[[:space:]]+[0-9]" "sys/resource.h" +auto_switch_type "fadvisebehavname" "POSIX_FADV_[A-Z]+[[:space:]]+[0-9]+" "sys/fcntl.h" auto_switch_type "madvisebehavname" "_?MADV_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h" auto_switch_type "msyncflagsname" "MS_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h" auto_switch_type "schedpolicyname" "SCHED_[A-Z]+[[:space:]]+[0-9]+" "sched.h" -- 2.45.0