~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/jfs/jfs_debug.h

Version: ~ [ linux-5.10-rc1 ] ~ [ linux-5.9.1 ] ~ [ linux-5.8.16 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.72 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.152 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.202 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.240 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.240 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  *   Copyright (C) International Business Machines Corp., 2000-2002
  3  *   Portions Copyright (C) Christoph Hellwig, 2001-2002
  4  *
  5  *   This program is free software;  you can redistribute it and/or modify
  6  *   it under the terms of the GNU General Public License as published by
  7  *   the Free Software Foundation; either version 2 of the License, or
  8  *   (at your option) any later version.
  9  *
 10  *   This program is distributed in the hope that it will be useful,
 11  *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
 12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
 13  *   the GNU General Public License for more details.
 14  *
 15  *   You should have received a copy of the GNU General Public License
 16  *   along with this program;  if not, write to the Free Software
 17  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 18  */
 19 #ifndef _H_JFS_DEBUG
 20 #define _H_JFS_DEBUG
 21 
 22 /*
 23  *      jfs_debug.h
 24  *
 25  * global debug message, data structure/macro definitions
 26  * under control of CONFIG_JFS_DEBUG, CONFIG_JFS_STATISTICS;
 27  */
 28 
 29 /*
 30  * Create /proc/fs/jfs if procfs is enabled andeither
 31  * CONFIG_JFS_DEBUG or CONFIG_JFS_STATISTICS is defined
 32  */
 33 #if defined(CONFIG_PROC_FS) && (defined(CONFIG_JFS_DEBUG) || defined(CONFIG_JFS_STATISTICS))
 34 #define PROC_FS_JFS
 35 extern void jfs_proc_init(void);
 36 extern void jfs_proc_clean(void);
 37 #endif
 38 
 39 /*
 40  *      assert with traditional printf/panic
 41  */
 42 #define assert(p) do {  \
 43         if (!(p)) {     \
 44                 printk(KERN_CRIT "BUG at %s:%d assert(%s)\n",   \
 45                        __FILE__, __LINE__, #p);                 \
 46                 BUG();  \
 47         }               \
 48 } while (0)
 49 
 50 /*
 51  *      debug ON
 52  *      --------
 53  */
 54 #ifdef CONFIG_JFS_DEBUG
 55 #define ASSERT(p) assert(p)
 56 
 57 /* printk verbosity */
 58 #define JFS_LOGLEVEL_ERR 1
 59 #define JFS_LOGLEVEL_WARN 2
 60 #define JFS_LOGLEVEL_DEBUG 3
 61 #define JFS_LOGLEVEL_INFO 4
 62 
 63 extern int jfsloglevel;
 64 
 65 extern const struct file_operations jfs_txanchor_proc_fops;
 66 
 67 /* information message: e.g., configuration, major event */
 68 #define jfs_info(fmt, arg...) do {                      \
 69         if (jfsloglevel >= JFS_LOGLEVEL_INFO)           \
 70                 printk(KERN_INFO fmt "\n", ## arg);     \
 71 } while (0)
 72 
 73 /* debug message: ad hoc */
 74 #define jfs_debug(fmt, arg...) do {                     \
 75         if (jfsloglevel >= JFS_LOGLEVEL_DEBUG)          \
 76                 printk(KERN_DEBUG fmt "\n", ## arg);    \
 77 } while (0)
 78 
 79 /* warn message: */
 80 #define jfs_warn(fmt, arg...) do {                      \
 81         if (jfsloglevel >= JFS_LOGLEVEL_WARN)           \
 82                 printk(KERN_WARNING fmt "\n", ## arg);  \
 83 } while (0)
 84 
 85 /* error event message: e.g., i/o error */
 86 #define jfs_err(fmt, arg...) do {                       \
 87         if (jfsloglevel >= JFS_LOGLEVEL_ERR)            \
 88                 printk(KERN_ERR fmt "\n", ## arg);      \
 89 } while (0)
 90 
 91 /*
 92  *      debug OFF
 93  *      ---------
 94  */
 95 #else                           /* CONFIG_JFS_DEBUG */
 96 #define ASSERT(p) do {} while (0)
 97 #define jfs_info(fmt, arg...) do {} while (0)
 98 #define jfs_debug(fmt, arg...) do {} while (0)
 99 #define jfs_warn(fmt, arg...) do {} while (0)
100 #define jfs_err(fmt, arg...) do {} while (0)
101 #endif                          /* CONFIG_JFS_DEBUG */
102 
103 /*
104  *      statistics
105  *      ----------
106  */
107 #ifdef  CONFIG_JFS_STATISTICS
108 extern const struct file_operations jfs_lmstats_proc_fops;
109 extern const struct file_operations jfs_txstats_proc_fops;
110 extern const struct file_operations jfs_mpstat_proc_fops;
111 extern const struct file_operations jfs_xtstat_proc_fops;
112 
113 #define INCREMENT(x)            ((x)++)
114 #define DECREMENT(x)            ((x)--)
115 #define HIGHWATERMARK(x,y)      ((x) = max((x), (y)))
116 #else
117 #define INCREMENT(x)
118 #define DECREMENT(x)
119 #define HIGHWATERMARK(x,y)
120 #endif                          /* CONFIG_JFS_STATISTICS */
121 
122 #endif                          /* _H_JFS_DEBUG */
123 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp