Lines Matching +full:a +full:- +full:za +full:- +full:z0 +full:- +full:9

1 /* SPDX-License-Identifier: GPL-2.0-only */
6 * Copyright (C) 2005-2007 Intel Corporation
7 * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
13 * The main thing this framework provides is decission power to take a
14 * debug action (like printing a message) if the current debug level
17 * The decission power is at two levels: at compile-time (what does
18 * not make it is compiled out) and at run-time. The run-time
19 * selection is done per-submodule (as they are declared by the user
22 * A call to d_test(L) (L being the target debug level) returns true
26 * It follows that a call to d_test() that can be determined to be
32 * It is up to the caller to define how much a debugging level is.
46 * - a MODULENAME (single word, legal C identifier)
48 * - a debug-levels.h header file that declares the list of
52 * - some (optional) .c code to manipulate the runtime debug levels
55 * The debug-levels.h file would look like:
74 * D_MASTER is the maximum compile-time debug level; any debug actions
83 * In a .c file of the module (and only in one of them), define the
98 * To manipulate from user space the levels, create a debugfs dentry
103 * Where PREFIX_ is a name of your chosing. This will create debugfs
104 * file with a single numeric value that can be use to tweak it. To
108 * particular instance of a device, the settings are *global*.
113 * #define D_SUBMODULE submodule_x // matches one in debug-levels.h
114 * #include "debug-levels.h"
141 * Debug backend: generate a message header from a 'struct device'
145 * @dev: pointer to device used to generate a header from. If NULL,
169 * @f: printf-like format and arguments
171 * Note this is optimized out if it doesn't pass the compile-time
173 * sure the printf-like formats and variables are always checked and
176 #define _d_printf(l, tag, dev, f, a...) \ argument
182 printk(KERN_ERR "%s%s%s: " f, head, __func__, tag, ##a); \
188 * the arguments is a preprocessor #define.
196 * Store a submodule's runtime debug level and name
230 #error D_MODULENAME is not defined in your debug-levels.h file
232 * D_MODULE - Name of the current module
234 * #define in your module's debug-levels.h, making sure it is
235 * unique. This has to be a legal C identifier.
244 * D_MASTER - Compile time maximum debug level
246 * #define in your debug-levels.h file to the maximum debug level the
247 * runtime code will be allowed to have. This allows you to provide a
254 * Maximum one definition per module (at the debug-levels.h file).
262 * D_SUBMODULE - Name of the current submodule
264 * #define in your submodule .c file before #including debug-levels.h
267 * debug-levels.h) and D_SUBMODULE_DEFINE().
269 * This is used to provide runtime-control over the debug levels.
279 * D_SUBMODULE_DECLARE - Declare a submodule for runtime debug level control
281 * @_name: name of the submodule, restricted to the chars that make up a
282 * valid C identifier ([a-zA-Z0-9_]).
284 * Declare in the module's debug-levels.h header file as:
292 * Some corresponding .c file needs to have a matching
299 * D_SUBMODULE_DEFINE - Define a submodule for runtime debug level control
301 * @_name: name of the submodule, restricted to the chars that make up a
302 * valid C identifier ([a-zA-Z0-9_]).
314 * Matching D_SUBMODULE_DECLARE()s have to be present in a
315 * debug-levels.h header file.
329 * d_test - Returns true if debugging should be enabled
341 * D_MASTER evaluation compiles all out if it is compile-time false.
355 * d_fnstart - log message at function start if debugging enabled
359 * @f: printf-like format and arguments
361 #define d_fnstart(l, _dev, f, a...) _d_printf(l, " FNSTART", _dev, f, ## a) argument
365 * d_fnend - log message at function end if debugging enabled
369 * @f: printf-like format and arguments
371 #define d_fnend(l, _dev, f, a...) _d_printf(l, " FNEND", _dev, f, ## a) argument
375 * d_printf - log message if debugging enabled
379 * @f: printf-like format and arguments
381 #define d_printf(l, _dev, f, a...) _d_printf(l, "", _dev, f, ## a) argument
385 * d_dump - log buffer hex dump if debugging enabled
389 * @f: printf-like format and arguments
403 * Export a submodule's debug level over debugfs as PREFIXSUBMODULE
406 * @submodule: name of submodule (not a string, just the name)
424 int index = -1; in d_submodule_set()
428 if (itr->name == NULL) { in d_submodule_set()
429 printk(KERN_ERR "%s: itr->name NULL?? (%p, #%d)\n", in d_submodule_set()
433 if (!strcmp(itr->name, submodule)) { in d_submodule_set()
434 itr->level = level; in d_submodule_set()
443 * d_parse_params - Parse a string with debug parameters from the
449 * @_params: string with the parameters; this is a space (not tab!)
484 printk(KERN_ERR "%s: can't parse '%s' as a " in d_parse_params()