Put the mbuf type in the ktrace record so that we know how to decode it
in userland.
This commit is contained in:
parent
17c41f8e0c
commit
622dd6a7e2
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: uipc_syscalls.c,v 1.146 2011/07/27 14:35:34 uebayasi Exp $ */
|
||||
/* $NetBSD: uipc_syscalls.c,v 1.147 2011/09/21 18:10:25 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
|
||||
|
@ -61,7 +61,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.146 2011/07/27 14:35:34 uebayasi Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.147 2011/09/21 18:10:25 christos Exp $");
|
||||
|
||||
#include "opt_pipe.h"
|
||||
|
||||
|
@ -71,6 +71,7 @@ __KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.146 2011/07/27 14:35:34 uebayasi
|
|||
#include <sys/proc.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/buf.h>
|
||||
#define MBUFTYPES
|
||||
#include <sys/mbuf.h>
|
||||
#include <sys/protosw.h>
|
||||
#include <sys/socket.h>
|
||||
|
@ -1224,7 +1225,7 @@ sockargs(struct mbuf **mp, const void *bf, size_t buflen, int type)
|
|||
(void) m_free(m);
|
||||
return (error);
|
||||
}
|
||||
ktrkuser("sockargs", mtod(m, void *), buflen);
|
||||
ktrkuser(mbuftypes[type], mtod(m, void *), buflen);
|
||||
*mp = m;
|
||||
if (type == MT_SONAME) {
|
||||
sa = mtod(m, struct sockaddr *);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: mbuf.h,v 1.145 2011/08/08 19:10:33 dyoung Exp $ */
|
||||
/* $NetBSD: mbuf.h,v 1.146 2011/09/21 18:10:25 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
|
||||
|
@ -379,6 +379,19 @@ MBUF_DEFINE(mbuf, MHLEN, MLEN);
|
|||
#define MT_CONTROL 6 /* extra-data protocol message */
|
||||
#define MT_OOBDATA 7 /* expedited data */
|
||||
|
||||
#ifdef MBUFTYPES
|
||||
static const char *mbuftypes[] = {
|
||||
"mbfree",
|
||||
"mbdata",
|
||||
"mbheader",
|
||||
"mbsoname",
|
||||
"mbsopts",
|
||||
"mbftable",
|
||||
"mbcontrol",
|
||||
"mboobdata",
|
||||
};
|
||||
#endif
|
||||
|
||||
/* flags to m_get/MGET */
|
||||
#define M_DONTWAIT M_NOWAIT
|
||||
#define M_WAIT M_WAITOK
|
||||
|
|
Loading…
Reference in New Issue