]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Re-enable DTrace ioctl()-size debugging.
authorNick Alcock <nick.alcock@oracle.com>
Wed, 31 Jul 2013 15:17:30 +0000 (16:17 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Wed, 31 Jul 2013 15:17:30 +0000 (16:17 +0100)
We move the shared user/kernel ioctl-debugging function to a new
<linux/dtrace/ioctl_debug.h> header, to avoid problems with other
<linux/dtrace/ioctl.h> users.

Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
dtrace/dtrace_dev.c
dtrace/include/uapi/linux/dtrace/ioctl_debug.h [new file with mode: 0644]

index 2f5c24aed7a2ccef32bdca0738e04fbc6da11c59..a00049f7dacf521e2cdd39c7c609f74caee62637 100644 (file)
@@ -38,6 +38,7 @@
 #include "ctf_api.h"
 #include "dtrace.h"
 #include "dtrace_dev.h"
+#include <linux/dtrace/ioctl_debug.h>
 
 uint32_t                       dtrace_helptrace_next = 0;
 uint32_t                       dtrace_helptrace_nlocals;
@@ -103,6 +104,9 @@ static int dtrace_open(struct inode *inode, struct file *file)
        if (priv == DTRACE_PRIV_NONE)
                return -EACCES;
 
+#ifdef CONFIG_DT_DEBUG
+       dtrace_ioctl_sizes();
+#endif
        mutex_lock(&dtrace_provider_lock);
        dtrace_probe_provide(NULL, NULL);
        mutex_unlock(&dtrace_provider_lock);
diff --git a/dtrace/include/uapi/linux/dtrace/ioctl_debug.h b/dtrace/include/uapi/linux/dtrace/ioctl_debug.h
new file mode 100644 (file)
index 0000000..90c326b
--- /dev/null
@@ -0,0 +1,50 @@
+/* Copyright (C) 2013 Oracle, Inc. */
+
+#ifndef _LINUX_DTRACE_IOCTL_DEBUG_H_
+#define _LINUX_DTRACE_IOCTL_DEBUG_H_
+
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ *
+ * Copyright 2013 Oracle, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <linux/dtrace/ioctl.h>
+
+void dtrace_size_dbg_print(const char *type, size_t size);
+
+static void dtrace_ioctl_sizes(void) {
+#define DBG_PRINT(x) dtrace_size_dbg_print(#x, sizeof(x))
+       DBG_PRINT(dtrace_providerdesc_t);
+       DBG_PRINT(dtrace_probedesc_t);
+       DBG_PRINT(dtrace_bufdesc_t);
+       DBG_PRINT(dtrace_eprobedesc_t);
+       DBG_PRINT(dtrace_argdesc_t);
+       DBG_PRINT(dtrace_conf_t);
+       DBG_PRINT(dtrace_status_t);
+       DBG_PRINT(processorid_t);
+       DBG_PRINT(dtrace_aggdesc_t);
+       DBG_PRINT(dtrace_fmtdesc_t);
+       DBG_PRINT(dof_hdr_t);
+#undef DBG_PRINT
+}
+
+#endif /* _LINUX_DTRACE_IOCTL_DEBUG_H */