-/* $OpenBSD: kdump.c,v 1.87 2014/08/17 22:25:53 guenther Exp $ */
+/* $OpenBSD: kdump.c,v 1.88 2014/08/18 03:29:53 guenther Exp $ */
/*-
* Copyright (c) 1988, 1993
static void flagsandmodename(int, int);
static void clockname(int);
static void sockoptlevelname(int);
+static void ktraceopname(int);
int
main(int argc, char *argv[])
pn(mlockallname);
break;
case SYS_mmap:
+ case SYS_mquery:
pn(NULL);
pn(NULL);
pn(mmapprotname);
pn(NULL);
pn(mmapprotname);
break;
- case SYS_mquery:
- pn(NULL);
- pn(NULL);
- pn(mmapprotname);
- pn(mmapflagsname);
- pn(NULL);
- /* skip padding */
- ap++;
- narg--;
- plln();
- break;
case SYS_msync:
pn(NULL);
pn(NULL);
break;
case SYS_ktrace:
pn(NULL);
- pn(NULL);
+ pn(ktraceopname);
pn(ktracefacname);
pn(pgid);
break;
static struct ctlname kernmallocname[] = CTL_KERN_MALLOC_NAMES;
static struct ctlname forkstatname[] = CTL_KERN_FORKSTAT_NAMES;
static struct ctlname nchstatsname[] = CTL_KERN_NCHSTATS_NAMES;
-static struct ctlname kernprocname[] =
-{
+static struct ctlname kernprocname[] = {
{ NULL },
{ "all" },
{ "pid" },
}
static void
-shmctlname(int cmd) {
+shmctlname(int cmd)
+{
switch (cmd) {
case IPC_RMID:
(void)printf("IPC_RMID");
static void
-semgetname(int flag) {
+semgetname(int flag)
+{
int or = 0;
if_print_or(flag, IPC_CREAT, or);
if_print_or(flag, IPC_EXCL, or);
* mode argument is unused (and often bogus and misleading).
*/
static void
-flagsandmodename(int flags, int mode) {
+flagsandmodename(int flags, int mode)
+{
flagsname (flags);
if ((flags & O_CREAT) == O_CREAT) {
(void)putchar(',');
}
}
+static void
+ktraceopname(int ops)
+{
+ int invalid = 0;
+
+ printf("%#x<", ops);
+ switch (KTROP(ops)) {
+ case KTROP_SET:
+ printf("KTROP_SET");
+ break;
+ case KTROP_CLEAR:
+ printf("KTROP_CLEAR");
+ break;
+ case KTROP_CLEARFILE:
+ printf("KTROP_CLEARFILE");
+ break;
+ default:
+ printf("KTROP(%d)", KTROP(ops));
+ invalid = 1;
+ break;
+ }
+ if (ops & KTRFLAG_DESCEND) printf ("|%s", "KTRFLAG_DESCEND");
+ printf(">");
+ if (invalid || (ops & ~(KTROP((unsigned)-1) | KTRFLAG_DESCEND)))
+ (void)printf("<invalid>%ld", (long)ops);
+}