62 строки
1.5 KiB
C
62 строки
1.5 KiB
C
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||
|
/* Internal definitions for network filesystem support
|
||
|
*
|
||
|
* Copyright (C) 2021 Red Hat, Inc. All Rights Reserved.
|
||
|
* Written by David Howells (dhowells@redhat.com)
|
||
|
*/
|
||
|
|
||
|
#ifdef pr_fmt
|
||
|
#undef pr_fmt
|
||
|
#endif
|
||
|
|
||
|
#define pr_fmt(fmt) "netfs: " fmt
|
||
|
|
||
|
/*
|
||
|
* read_helper.c
|
||
|
*/
|
||
|
extern unsigned int netfs_debug;
|
||
|
|
||
|
#define netfs_stat(x) do {} while(0)
|
||
|
#define netfs_stat_d(x) do {} while(0)
|
||
|
|
||
|
/*****************************************************************************/
|
||
|
/*
|
||
|
* debug tracing
|
||
|
*/
|
||
|
#define dbgprintk(FMT, ...) \
|
||
|
printk("[%-6.6s] "FMT"\n", current->comm, ##__VA_ARGS__)
|
||
|
|
||
|
#define kenter(FMT, ...) dbgprintk("==> %s("FMT")", __func__, ##__VA_ARGS__)
|
||
|
#define kleave(FMT, ...) dbgprintk("<== %s()"FMT"", __func__, ##__VA_ARGS__)
|
||
|
#define kdebug(FMT, ...) dbgprintk(FMT, ##__VA_ARGS__)
|
||
|
|
||
|
#ifdef __KDEBUG
|
||
|
#define _enter(FMT, ...) kenter(FMT, ##__VA_ARGS__)
|
||
|
#define _leave(FMT, ...) kleave(FMT, ##__VA_ARGS__)
|
||
|
#define _debug(FMT, ...) kdebug(FMT, ##__VA_ARGS__)
|
||
|
|
||
|
#elif defined(CONFIG_NETFS_DEBUG)
|
||
|
#define _enter(FMT, ...) \
|
||
|
do { \
|
||
|
if (netfs_debug) \
|
||
|
kenter(FMT, ##__VA_ARGS__); \
|
||
|
} while (0)
|
||
|
|
||
|
#define _leave(FMT, ...) \
|
||
|
do { \
|
||
|
if (netfs_debug) \
|
||
|
kleave(FMT, ##__VA_ARGS__); \
|
||
|
} while (0)
|
||
|
|
||
|
#define _debug(FMT, ...) \
|
||
|
do { \
|
||
|
if (netfs_debug) \
|
||
|
kdebug(FMT, ##__VA_ARGS__); \
|
||
|
} while (0)
|
||
|
|
||
|
#else
|
||
|
#define _enter(FMT, ...) no_printk("==> %s("FMT")", __func__, ##__VA_ARGS__)
|
||
|
#define _leave(FMT, ...) no_printk("<== %s()"FMT"", __func__, ##__VA_ARGS__)
|
||
|
#define _debug(FMT, ...) no_printk(FMT, ##__VA_ARGS__)
|
||
|
#endif
|