linux/fs/jfs/jfs_debug.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 *   Copyright (C) International Business Machines Corp., 2000-2002
 *   Portions Copyright (C) Christoph Hellwig, 2001-2002
 */
#ifndef _H_JFS_DEBUG
#define _H_JFS_DEBUG

/*
 *	jfs_debug.h
 *
 * global debug message, data structure/macro definitions
 * under control of CONFIG_JFS_DEBUG, CONFIG_JFS_STATISTICS;
 */

/*
 * Create /proc/fs/jfs if procfs is enabled andeither
 * CONFIG_JFS_DEBUG or CONFIG_JFS_STATISTICS is defined
 */
#if defined(CONFIG_PROC_FS) && (defined(CONFIG_JFS_DEBUG) || defined(CONFIG_JFS_STATISTICS))
#define PROC_FS_JFS
extern void jfs_proc_init(void);
extern void jfs_proc_clean(void);
#endif

/*
 *	assert with traditional printf/panic
 */
#define assert(p)

/*
 *	debug ON
 *	--------
 */
#ifdef CONFIG_JFS_DEBUG
#define ASSERT(p)

/* printk verbosity */
#define JFS_LOGLEVEL_ERR
#define JFS_LOGLEVEL_WARN
#define JFS_LOGLEVEL_DEBUG
#define JFS_LOGLEVEL_INFO

extern int jfsloglevel;

int jfs_txanchor_proc_show(struct seq_file *m, void *v);

/* information message: e.g., configuration, major event */
#define jfs_info(fmt, arg...)

/* debug message: ad hoc */
#define jfs_debug(fmt, arg...)

/* warn message: */
#define jfs_warn(fmt, arg...)

/* error event message: e.g., i/o error */
#define jfs_err(fmt, arg...)

/*
 *	debug OFF
 *	---------
 */
#else				/* CONFIG_JFS_DEBUG */
#define ASSERT
#define jfs_info
#define jfs_debug
#define jfs_warn
#define jfs_err
#endif				/* CONFIG_JFS_DEBUG */

/*
 *	statistics
 *	----------
 */
#ifdef	CONFIG_JFS_STATISTICS
int jfs_lmstats_proc_show(struct seq_file *m, void *v);
int jfs_txstats_proc_show(struct seq_file *m, void *v);
int jfs_mpstat_proc_show(struct seq_file *m, void *v);
int jfs_xtstat_proc_show(struct seq_file *m, void *v);

#define INCREMENT(x)
#define DECREMENT(x)
#define HIGHWATERMARK(x,y)
#else
#define INCREMENT
#define DECREMENT
#define HIGHWATERMARK
#endif				/* CONFIG_JFS_STATISTICS */

#endif				/* _H_JFS_DEBUG */