mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-22 12:14:01 +08:00
8abfc6e7a4
* 'for-2.6.37/drivers' of git://git.kernel.dk/linux-2.6-block: (95 commits) cciss: fix PCI IDs for new Smart Array controllers drbd: add race-breaker to drbd_go_diskless drbd: use dynamic_dev_dbg to optionally log uuid changes dynamic_debug.h: Fix dynamic_dev_dbg() macro if CONFIG_DYNAMIC_DEBUG not set drbd: cleanup: change "<= 0" to "== 0" drbd: relax the grace period of the md_sync timer again drbd: add some more explicit drbd_md_sync drbd: drop wrong debug asserts, fix recently introduced race drbd: cleanup useless leftover warn/error printk's drbd: add explicit drbd_md_sync to drbd_resync_finished drbd: Do not log an ASSERT for P_OV_REQUEST packets while C_CONNECTED drbd: fix for possible deadlock on IO error during resync drbd: fix unlikely access after free and list corruption drbd: fix for spurious fullsync (uuids rotated too fast) drbd: allow for explicit resync-finished notifications drbd: preparation commit, using full state in receive_state() drbd: drbd_send_ack_dp must not rely on header information drbd: Fix regression in recv_bm_rle_bits (compressed bitmap) drbd: Fixed a stupid copy and paste error drbd: Allow larger values for c-fill-target. ... Fix up trivial conflict in drivers/block/ataflop.c due to BKL removal
91 lines
2.6 KiB
C
91 lines
2.6 KiB
C
#ifndef _DYNAMIC_DEBUG_H
|
|
#define _DYNAMIC_DEBUG_H
|
|
|
|
#include <linux/jump_label.h>
|
|
|
|
/* dynamic_printk_enabled, and dynamic_printk_enabled2 are bitmasks in which
|
|
* bit n is set to 1 if any modname hashes into the bucket n, 0 otherwise. They
|
|
* use independent hash functions, to reduce the chance of false positives.
|
|
*/
|
|
extern long long dynamic_debug_enabled;
|
|
extern long long dynamic_debug_enabled2;
|
|
|
|
/*
|
|
* An instance of this structure is created in a special
|
|
* ELF section at every dynamic debug callsite. At runtime,
|
|
* the special section is treated as an array of these.
|
|
*/
|
|
struct _ddebug {
|
|
/*
|
|
* These fields are used to drive the user interface
|
|
* for selecting and displaying debug callsites.
|
|
*/
|
|
const char *modname;
|
|
const char *function;
|
|
const char *filename;
|
|
const char *format;
|
|
unsigned int lineno:24;
|
|
/*
|
|
* The flags field controls the behaviour at the callsite.
|
|
* The bits here are changed dynamically when the user
|
|
* writes commands to <debugfs>/dynamic_debug/control
|
|
*/
|
|
#define _DPRINTK_FLAGS_PRINT (1<<0) /* printk() a message using the format */
|
|
#define _DPRINTK_FLAGS_DEFAULT 0
|
|
unsigned int flags:8;
|
|
char enabled;
|
|
} __attribute__((aligned(8)));
|
|
|
|
|
|
int ddebug_add_module(struct _ddebug *tab, unsigned int n,
|
|
const char *modname);
|
|
|
|
#if defined(CONFIG_DYNAMIC_DEBUG)
|
|
extern int ddebug_remove_module(const char *mod_name);
|
|
|
|
#define dynamic_pr_debug(fmt, ...) do { \
|
|
__label__ do_printk; \
|
|
__label__ out; \
|
|
static struct _ddebug descriptor \
|
|
__used \
|
|
__attribute__((section("__verbose"), aligned(8))) = \
|
|
{ KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \
|
|
_DPRINTK_FLAGS_DEFAULT }; \
|
|
JUMP_LABEL(&descriptor.enabled, do_printk); \
|
|
goto out; \
|
|
do_printk: \
|
|
printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \
|
|
out: ; \
|
|
} while (0)
|
|
|
|
|
|
#define dynamic_dev_dbg(dev, fmt, ...) do { \
|
|
__label__ do_printk; \
|
|
__label__ out; \
|
|
static struct _ddebug descriptor \
|
|
__used \
|
|
__attribute__((section("__verbose"), aligned(8))) = \
|
|
{ KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \
|
|
_DPRINTK_FLAGS_DEFAULT }; \
|
|
JUMP_LABEL(&descriptor.enabled, do_printk); \
|
|
goto out; \
|
|
do_printk: \
|
|
dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); \
|
|
out: ; \
|
|
} while (0)
|
|
|
|
#else
|
|
|
|
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)
|
|
#endif
|
|
|
|
#endif
|