XenevaOS
Loading...
Searching...
No Matches
dynamic_debug.h
Go to the documentation of this file.
1/*
2 * DCL dynamic_debug.h -- dynamic_pr_debug() and friends are dropped.
3 *
4 * drm_print.c/drm_crtc_helper.c enable the DYNAMIC_DEBUG label; DCL keeps
5 * dynamic_dev_dbg/pr_debug as statements that discard their arguments, same
6 * policy as mainline's CONFIG_DYNAMIC_DEBUG=n + !DEBUG builds.
7 */
8#ifndef _LINUX_DYNAMIC_DEBUG_H
9#define _LINUX_DYNAMIC_DEBUG_H
10
11#include <linux/printk.h>
12
13#define dynamic_pr_debug(desc, fmt, ...) do { (void)(desc); } while (0)
14#define dynamic_dev_dbg(dev, fmt, ...) do { (void)(dev); } while (0)
15#define dynamic_dev_warn(dev, fmt, ...) do { (void)(dev); } while (0)
16#define DEFINE_DYNAMIC_DEBUG_METADATA(id, fmt)
17#define DEFINE_DYNAMIC_DEBUG_METADATA_CLS(cls, id, fmt)
18#define DYNAMIC_DEBUG_BRANCH(descriptor) 0
19
20/*
21 * struct _ddebug_class_map and DECLARE_DYNDBG_CLASSMAP -- the one piece of
22 * the dyndbg surface that has to declare a real object instead of discarding
23 * its arguments.
24 *
25 * drm_crtc_helper.c:53 spells the macro *unguarded*, and only drm_print.c's
26 * copy sits inside `#if defined(CONFIG_DRM_USE_DYNAMIC_DEBUG)` (drm_print.c:
27 * 58-72). So the expansion has to put a name to something, or that line
28 * decays to a list of bare identifiers and clang reports "type specifier
29 * missing" at the first one.
30 *
31 * `static` is not an oversight: when CONFIG_DRM_USE_DYNAMIC_DEBUG *is*
32 * defined, drm_print.c:60 expands this same macro, and two extern definitions
33 * of one symbol would not link. It also keeps drm_crtc_helper.c's copy from
34 * being reported as unused in a build where the map is written but never read.
35 *
36 * The variadic tail -- the ten "DRM_UT_*" strings -- is dropped. They exist
37 * in mainline so the dyndbg control file can name a class as text, and there
38 * is no control file here; the class *values* are what the drm core
39 * compares against, and they come from enum drm_debug_category, not from
40 * these strings.
41 */
43 const char* modname;
45 const char* name;
46};
47
48#define DD_CLASS_TYPE_DISJOINT_BITS 0
49
50#define DECLARE_DYNDBG_CLASSMAP(mapname, type, _idx, ...) \
51 static const struct _ddebug_class_map mapname = { \
52 .modname = "drm", \
53 .class_id = (type), \
54 .name = #mapname, \
55 }
56
57#endif /* _LINUX_DYNAMIC_DEBUG_H */
Definition dynamic_debug.h:42
const char * modname
Definition dynamic_debug.h:43
int class_id
Definition dynamic_debug.h:44
const char * name
Definition dynamic_debug.h:45