Source-Changes-HG archive

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

[src/pgoyette-localcount]: src/external/cddl/osnet Add the d_localcount membe...



details:   https://anonhg.NetBSD.org/src/rev/6bb287fa7956
branches:  pgoyette-localcount
changeset: 852803:6bb287fa7956
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sun Jul 17 05:18:11 2016 +0000

description:
Add the d_localcount member to the various {b,c}devsw structures.

No need for these to be conditional on _MODULE as dtrace is always
a module.

diffstat:

 external/cddl/osnet/dev/fbt/fbt.c                   |  21 +++++++++++++++---
 external/cddl/osnet/dev/sdt/sdt.c                   |  23 ++++++++++++++++----
 external/cddl/osnet/dist/uts/common/dtrace/dtrace.c |  20 +++++++++++++++--
 3 files changed, 52 insertions(+), 12 deletions(-)

diffs (131 lines):

diff -r ff8c47150d29 -r 6bb287fa7956 external/cddl/osnet/dev/fbt/fbt.c
--- a/external/cddl/osnet/dev/fbt/fbt.c Sun Jul 17 05:05:10 2016 +0000
+++ b/external/cddl/osnet/dev/fbt/fbt.c Sun Jul 17 05:18:11 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fbt.c,v 1.18.2.1 2016/07/16 11:27:12 pgoyette Exp $    */
+/*     $NetBSD: fbt.c,v 1.18.2.2 2016/07/17 05:18:11 pgoyette Exp $    */
 
 /*
  * CDDL HEADER START
@@ -56,6 +56,7 @@
 #include <sys/syscall.h>
 #include <sys/uio.h>
 #include <sys/unistd.h>
+#include <sys/localcount.h>
 
 #include <machine/cpu.h>
 #if defined(__i386__) || defined(__amd64__)
@@ -151,10 +152,22 @@
 #define        FBT_ADDR2NDX(addr)      ((((uintptr_t)(addr)) >> 4) & fbt_probetab_mask)
 #define        FBT_PROBETAB_SIZE       0x8000          /* 32k entries -- 128K total */
 
+struct localcount fbt_localcount;
+
 static const struct cdevsw fbt_cdevsw = {
-       fbt_open, noclose, noread, nowrite, noioctl,
-       nostop, notty, nopoll, nommap, nokqfilter, nodiscard,
-       D_OTHER, NULL
+       .d_open         = fbt_open,
+       .d_close        = noclose,
+       .d_read         = noread,
+       .d_write        = nowrite,
+       .d_ioctl        = noioctl,
+       .d_stop         = nostop,
+       .d_tty          = notty,
+       .d_poll         = nopoll,
+       .d_mmap         = nommap,
+       .d_kqfilter     = nokqfilter,
+       .d_discard      = nodiscard,
+       .d_localcount   = fbt_localcount,
+       .d_flag         = D_OTHER
 };
 
 static dtrace_pattr_t fbt_attr = {
diff -r ff8c47150d29 -r 6bb287fa7956 external/cddl/osnet/dev/sdt/sdt.c
--- a/external/cddl/osnet/dev/sdt/sdt.c Sun Jul 17 05:05:10 2016 +0000
+++ b/external/cddl/osnet/dev/sdt/sdt.c Sun Jul 17 05:18:11 2016 +0000
@@ -39,7 +39,7 @@
  * unloaded; in particular, probes may not span multiple kernel modules.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdt.c,v 1.16.2.1 2016/07/16 11:27:12 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdt.c,v 1.16.2.2 2016/07/17 05:18:11 pgoyette Exp $");
 
 #include <sys/cdefs.h>
 #include <sys/param.h>
@@ -64,6 +64,7 @@
 #include <sys/module.h>
 #include <sys/mutex.h>
 #include <sys/queue.h>
+#include <sys/localcount.h>
 #define KDTRACE_HOOKS
 #include <sys/sdt.h>
 
@@ -118,13 +119,25 @@
        return (0);
 }
 
+struct localcount sdt_localcount;
+
 static const struct cdevsw sdt_cdevsw = {
-       sdt_open, noclose, noread, nowrite, noioctl,
-       nostop, notty, nopoll, nommap, nokqfilter, nodiscard,
-       D_OTHER, NULL
+       .d_open         = sdt_open,
+       .d_close        = noclose,
+       .d_read         = noread,
+       .d_write        = nowrite,
+       .d_ioctl        = noioctl,
+       .d_stop         = nostop,
+       .d_tty          = notty,
+       .d_poll         = nopoll,
+       .d_mmap         = nommap,
+       .d_kqfilter     = nokqfilter,
+       .d_discard      = nodiscard,
+       .d_localcount   = sdt_localcount,
+       .d_flag         = D_OTHER
 };
 #endif
-
+ 
 static TAILQ_HEAD(, sdt_provider) sdt_prov_list;
 
 #ifdef __FreeBSD__
diff -r ff8c47150d29 -r 6bb287fa7956 external/cddl/osnet/dist/uts/common/dtrace/dtrace.c
--- a/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c       Sun Jul 17 05:05:10 2016 +0000
+++ b/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c       Sun Jul 17 05:18:11 2016 +0000
@@ -134,6 +134,7 @@
 #include <sys/vmem.h>
 #include <sys/module.h>
 #include <sys/cpu.h>
+#include <sys/localcount.h>
 #include <netinet/in.h>
 #include "dtrace_cddl.h"
 #include "dtrace_debug.c"
@@ -15337,10 +15338,23 @@
 
 /* Pseudo Device Entry points */
 /* Just opens, clones to the fileops below */
+
+struct localcount dtrace_localcount;
+
 const struct cdevsw dtrace_cdevsw = {
-       dtrace_open, noclose, noread, nowrite, noioctl,
-       nostop, notty, nopoll, nommap, nokqfilter, nodiscard,
-       D_OTHER | D_MPSAFE, NULL
+       .d_open         = dtrace_open,
+       .d_close        = noclose,
+       .d_read         = noread,
+       .d_write        = nowrite,
+       .d_ioctl        = noioctl,
+       .d_stop         = nostop,
+       .d_tty          = notty,
+       .d_poll         = nopoll,
+       .d_mmap         = nommap,
+       .d_kqfilter     = nokqfilter,
+       .d_discard      = nodiscard,
+       .d_localcount   = dtrace_localcount,
+       .d_flag         = D_OTHER | D_MPSAFE
 };
 
 static int dtrace_ioctl(struct file *fp, u_long cmd, void *data);



Home | Main Index | Thread Index | Old Index