kdump now displays Mach services names itself, including a table of

id/names in sys/compat/mach/mach_services_names.c

Remove ports and flags displays, the information is already in the message.
This commit is contained in:
manu 2003-11-15 23:10:31 +00:00
parent d00d4c68df
commit a0399121cc
3 changed files with 51 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kdump.c,v 1.62 2003/09/20 22:24:00 matt Exp $ */
/* $NetBSD: kdump.c,v 1.63 2003/11/15 23:10:31 manu Exp $ */
/*-
* Copyright (c) 1988, 1993
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993\n\
#if 0
static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: kdump.c,v 1.62 2003/09/20 22:24:00 matt Exp $");
__RCSID("$NetBSD: kdump.c,v 1.63 2003/11/15 23:10:31 manu Exp $");
#endif
#endif /* not lint */
@ -808,9 +808,22 @@ ktrmmsg(mmsg, len)
struct ktr_mmsg *mmsg;
int len;
{
printf("id %d [0x%x -> 0x%x] flags 0x%x\n",
mmsg->ktr_id, mmsg->ktr_local_port,
mmsg->ktr_remote_port, mmsg->ktr_bits);
const char *service_name;
char *reply;
int id;
id = mmsg->ktr_id;
if ((id / 100) % 2) { /* Message reply */
reply = " reply";
id -= 100;
} else {
reply = "";
}
if ((service_name = mach_service_name(id)) != NULL)
printf("%s%s\n", service_name, reply);
else
printf("unknown service%s [%d]\n", reply, mmsg->ktr_id);
hexdump_buf(mmsg, len);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: setemul.c,v 1.16 2003/10/19 07:34:38 christos Exp $ */
/* $NetBSD: setemul.c,v 1.17 2003/11/15 23:10:31 manu Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -69,7 +69,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: setemul.c,v 1.16 2003/10/19 07:34:38 christos Exp $");
__RCSID("$NetBSD: setemul.c,v 1.17 2003/11/15 23:10:31 manu Exp $");
#endif /* not lint */
#include <sys/param.h>
@ -140,6 +140,11 @@ __RCSID("$NetBSD: setemul.c,v 1.16 2003/10/19 07:34:38 christos Exp $");
#include "../../sys/compat/osf1/osf1_signo.c"
#include "../../sys/compat/linux/common/linux_signo.c"
/* For Mach services names in MMSG traces */
#ifndef LETS_GET_SMALL
#include "../../sys/compat/mach/mach_services_names.c"
#endif
#define NELEM(a) (sizeof(a) / sizeof(a[0]))
/* static */
@ -392,6 +397,29 @@ mach_lookup_emul(void)
if (strcmp("mach ppccalls", emul_idx->name) == 0)
mach_ppccalls = emul_idx;
}
if (mach == NULL || mach_fasttraps == NULL || mach_ppccalls == NULL)
if (mach == NULL || mach_fasttraps == NULL || mach_ppccalls == NULL) {
errx(1, "Cannot load mach emulations");
exit(1);
}
return;
}
/*
* Find the name of the Mach service responsible to a given message Id
*/
const char *
mach_service_name(id)
int id;
{
const char *retval = NULL;
#ifndef LETS_GET_SMALL
struct mach_service_name *srv;
for (srv = mach_services_names; srv->srv_id; srv++)
if (srv->srv_id == id)
break;
retval = srv->srv_name;
#endif /* LETS_GET_SMALL */
return retval;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: setemul.h,v 1.9 2003/10/19 07:34:38 christos Exp $ */
/* $NetBSD: setemul.h,v 1.10 2003/11/15 23:10:31 manu Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -86,4 +86,5 @@ void setemul(const char *, pid_t, int);
void ectx_sanify(pid_t);
int mach_traps_dispatch(int *, const struct emulation **);
void mach_lookup_emul(void);
const char *mach_service_name(int);