Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Put the mbuf type in the ktrace record so that we know h...



details:   https://anonhg.NetBSD.org/src/rev/05aaba98fc0d
branches:  trunk
changeset: 769752:05aaba98fc0d
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Sep 21 18:10:25 2011 +0000

description:
Put the mbuf type in the ktrace record so that we know how to decode it
in userland.

diffstat:

 sys/kern/uipc_syscalls.c |   7 ++++---
 sys/sys/mbuf.h           |  15 ++++++++++++++-
 2 files changed, 18 insertions(+), 4 deletions(-)

diffs (64 lines):

diff -r a2d33f4aa89e -r 05aaba98fc0d sys/kern/uipc_syscalls.c
--- a/sys/kern/uipc_syscalls.c  Wed Sep 21 17:48:51 2011 +0000
+++ b/sys/kern/uipc_syscalls.c  Wed Sep 21 18:10:25 2011 +0000
@@ -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 @@
 #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 @@
                (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 *);
diff -r a2d33f4aa89e -r 05aaba98fc0d sys/sys/mbuf.h
--- a/sys/sys/mbuf.h    Wed Sep 21 17:48:51 2011 +0000
+++ b/sys/sys/mbuf.h    Wed Sep 21 18:10:25 2011 +0000
@@ -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 @@
 #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



Home | Main Index | Thread Index | Old Index