]> Git Repo - linux.git/blobdiff - include/linux/dynamic_debug.h
arm64: avoid prototype warnings for syscalls
[linux.git] / include / linux / dynamic_debug.h
index 98dbf1d49984a946cb5843ad858cad0d69940869..061dd84d09f30625ae41d21720783e03f51bfaef 100644 (file)
@@ -114,20 +114,30 @@ struct ddebug_class_map {
 /* encapsulate linker provided built-in (or module) dyndbg data */
 struct _ddebug_info {
        struct _ddebug *descs;
+       struct ddebug_class_map *classes;
        unsigned int num_descs;
+       unsigned int num_classes;
 };
 
-#if defined(CONFIG_DYNAMIC_DEBUG_CORE)
+struct ddebug_class_param {
+       union {
+               unsigned long *bits;
+               unsigned int *lvl;
+       };
+       char flags[8];
+       const struct ddebug_class_map *map;
+};
 
-int ddebug_add_module(struct _ddebug_info *dyndbg, const char *modname);
+/*
+ * pr_debug() and friends are globally enabled or modules have selectively
+ * enabled them.
+ */
+#if defined(CONFIG_DYNAMIC_DEBUG) || \
+       (defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE))
 
-extern int ddebug_remove_module(const char *mod_name);
 extern __printf(2, 3)
 void __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...);
 
-extern int ddebug_dyndbg_module_param_cb(char *param, char *val,
-                                       const char *modname);
-
 struct device;
 
 extern __printf(3, 4)
@@ -283,21 +293,38 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor,
        dynamic_pr_debug_cls(cls, fmt, ##__VA_ARGS__);          \
        } while (0)
 
-#else /* !CONFIG_DYNAMIC_DEBUG_CORE */
+#else /* !(CONFIG_DYNAMIC_DEBUG || (CONFIG_DYNAMIC_DEBUG_CORE && DYNAMIC_DEBUG_MODULE)) */
 
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/printk.h>
 
-static inline int ddebug_add_module(struct _ddebug_info *dinfo, const char *modname)
-{
-       return 0;
-}
+#define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt)
+#define DYNAMIC_DEBUG_BRANCH(descriptor) false
 
-static inline int ddebug_remove_module(const char *mod)
-{
-       return 0;
-}
+#define dynamic_pr_debug(fmt, ...)                                     \
+       do { if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); } while (0)
+#define dynamic_dev_dbg(dev, fmt, ...)                                 \
+       do { if (0) dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); } while (0)
+#define dynamic_hex_dump(prefix_str, prefix_type, rowsize,             \
+                        groupsize, buf, len, ascii)                    \
+       do { if (0)                                                     \
+               print_hex_dump(KERN_DEBUG, prefix_str, prefix_type,     \
+                               rowsize, groupsize, buf, len, ascii);   \
+       } while (0)
+
+#endif /* CONFIG_DYNAMIC_DEBUG || (CONFIG_DYNAMIC_DEBUG_CORE && DYNAMIC_DEBUG_MODULE) */
+
+
+#ifdef CONFIG_DYNAMIC_DEBUG_CORE
+
+extern int ddebug_dyndbg_module_param_cb(char *param, char *val,
+                                       const char *modname);
+struct kernel_param;
+int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp);
+int param_get_dyndbg_classes(char *buffer, const struct kernel_param *kp);
+
+#else
 
 static inline int ddebug_dyndbg_module_param_cb(char *param, char *val,
                                                const char *modname)
@@ -311,17 +338,15 @@ static inline int ddebug_dyndbg_module_param_cb(char *param, char *val,
        return -EINVAL;
 }
 
-#define dynamic_pr_debug(fmt, ...)                                     \
-       do { if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); } while (0)
-#define dynamic_dev_dbg(dev, fmt, ...)                                 \
-       do { if (0) dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); } while (0)
-#define dynamic_hex_dump(prefix_str, prefix_type, rowsize,             \
-                        groupsize, buf, len, ascii)                    \
-       do { if (0)                                                     \
-               print_hex_dump(KERN_DEBUG, prefix_str, prefix_type,     \
-                               rowsize, groupsize, buf, len, ascii);   \
-       } while (0)
-
-#endif /* !CONFIG_DYNAMIC_DEBUG_CORE */
+struct kernel_param;
+static inline int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp)
+{ return 0; }
+static inline int param_get_dyndbg_classes(char *buffer, const struct kernel_param *kp)
+{ return 0; }
 
 #endif
+
+
+extern const struct kernel_param_ops param_ops_dyndbg_classes;
+
+#endif /* _DYNAMIC_DEBUG_H */
This page took 0.050161 seconds and 4 git commands to generate.