Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 1 | #ifndef __KERNEL_PRINTK__ |
| 2 | #define __KERNEL_PRINTK__ |
| 3 | |
Mike Travis | 162a7e7 | 2011-05-24 17:13:20 -0700 | [diff] [blame] | 4 | #include <linux/init.h> |
| 5 | |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 6 | extern const char linux_banner[]; |
| 7 | extern const char linux_proc_banner[]; |
| 8 | |
Joe Perches | 7d1e91a | 2011-01-12 16:59:45 -0800 | [diff] [blame] | 9 | #define KERN_EMERG "<0>" /* system is unusable */ |
| 10 | #define KERN_ALERT "<1>" /* action must be taken immediately */ |
| 11 | #define KERN_CRIT "<2>" /* critical conditions */ |
| 12 | #define KERN_ERR "<3>" /* error conditions */ |
| 13 | #define KERN_WARNING "<4>" /* warning conditions */ |
| 14 | #define KERN_NOTICE "<5>" /* normal but significant condition */ |
| 15 | #define KERN_INFO "<6>" /* informational */ |
| 16 | #define KERN_DEBUG "<7>" /* debug-level messages */ |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 17 | |
| 18 | /* Use the default kernel loglevel */ |
| 19 | #define KERN_DEFAULT "<d>" |
| 20 | /* |
| 21 | * Annotation for a "continued" line of log printout (only done after a |
| 22 | * line that had no enclosing \n). Only to be used by core/arch code |
| 23 | * during early bootup (a continued line is not SMP-safe otherwise). |
| 24 | */ |
Joe Perches | 7d1e91a | 2011-01-12 16:59:45 -0800 | [diff] [blame] | 25 | #define KERN_CONT "<c>" |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 26 | |
| 27 | extern int console_printk[]; |
| 28 | |
| 29 | #define console_loglevel (console_printk[0]) |
| 30 | #define default_message_loglevel (console_printk[1]) |
| 31 | #define minimum_console_loglevel (console_printk[2]) |
| 32 | #define default_console_loglevel (console_printk[3]) |
| 33 | |
Joe Perches | a9747cc | 2011-01-12 16:59:43 -0800 | [diff] [blame] | 34 | static inline void console_silent(void) |
| 35 | { |
| 36 | console_loglevel = 0; |
| 37 | } |
| 38 | |
| 39 | static inline void console_verbose(void) |
| 40 | { |
| 41 | if (console_loglevel) |
| 42 | console_loglevel = 15; |
| 43 | } |
| 44 | |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 45 | struct va_format { |
| 46 | const char *fmt; |
| 47 | va_list *va; |
| 48 | }; |
| 49 | |
| 50 | /* |
| 51 | * FW_BUG |
| 52 | * Add this to a message where you are sure the firmware is buggy or behaves |
| 53 | * really stupid or out of spec. Be aware that the responsible BIOS developer |
| 54 | * should be able to fix this issue or at least get a concrete idea of the |
| 55 | * problem by reading your message without the need of looking at the kernel |
| 56 | * code. |
| 57 | * |
| 58 | * Use it for definite and high priority BIOS bugs. |
| 59 | * |
| 60 | * FW_WARN |
| 61 | * Use it for not that clear (e.g. could the kernel messed up things already?) |
| 62 | * and medium priority BIOS bugs. |
| 63 | * |
| 64 | * FW_INFO |
| 65 | * Use this one if you want to tell the user or vendor about something |
| 66 | * suspicious, but generally harmless related to the firmware. |
| 67 | * |
| 68 | * Use it for information or very low priority BIOS bugs. |
| 69 | */ |
| 70 | #define FW_BUG "[Firmware Bug]: " |
| 71 | #define FW_WARN "[Firmware Warn]: " |
| 72 | #define FW_INFO "[Firmware Info]: " |
| 73 | |
| 74 | /* |
| 75 | * HW_ERR |
| 76 | * Add this to a message for hardware errors, so that user can report |
| 77 | * it to hardware vendor instead of LKML or software vendor. |
| 78 | */ |
| 79 | #define HW_ERR "[Hardware Error]: " |
| 80 | |
Joe Perches | 5264f2f | 2011-01-12 16:59:45 -0800 | [diff] [blame] | 81 | /* |
| 82 | * Dummy printk for disabled debugging statements to use whilst maintaining |
| 83 | * gcc's format and side-effect checking. |
| 84 | */ |
Joe Perches | b9075fa | 2011-10-31 17:11:33 -0700 | [diff] [blame] | 85 | static inline __printf(1, 2) |
Joe Perches | 5264f2f | 2011-01-12 16:59:45 -0800 | [diff] [blame] | 86 | int no_printk(const char *fmt, ...) |
| 87 | { |
| 88 | return 0; |
| 89 | } |
| 90 | |
Joe Perches | b9075fa | 2011-10-31 17:11:33 -0700 | [diff] [blame] | 91 | extern asmlinkage __printf(1, 2) |
Joe Perches | 5264f2f | 2011-01-12 16:59:45 -0800 | [diff] [blame] | 92 | void early_printk(const char *fmt, ...); |
| 93 | |
| 94 | extern int printk_needs_cpu(int cpu); |
| 95 | extern void printk_tick(void); |
| 96 | |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 97 | #ifdef CONFIG_PRINTK |
Kay Sievers | 7ff9554 | 2012-05-03 02:29:13 +0200 | [diff] [blame] | 98 | asmlinkage __printf(5, 0) |
| 99 | int vprintk_emit(int facility, int level, |
| 100 | const char *dict, size_t dictlen, |
| 101 | const char *fmt, va_list args); |
| 102 | |
Joe Perches | b9075fa | 2011-10-31 17:11:33 -0700 | [diff] [blame] | 103 | asmlinkage __printf(1, 0) |
Joe Perches | 5264f2f | 2011-01-12 16:59:45 -0800 | [diff] [blame] | 104 | int vprintk(const char *fmt, va_list args); |
Kay Sievers | 7ff9554 | 2012-05-03 02:29:13 +0200 | [diff] [blame] | 105 | |
| 106 | asmlinkage __printf(5, 6) __cold |
| 107 | asmlinkage int printk_emit(int facility, int level, |
| 108 | const char *dict, size_t dictlen, |
| 109 | const char *fmt, ...); |
| 110 | |
Joe Perches | b9075fa | 2011-10-31 17:11:33 -0700 | [diff] [blame] | 111 | asmlinkage __printf(1, 2) __cold |
Joe Perches | 5264f2f | 2011-01-12 16:59:45 -0800 | [diff] [blame] | 112 | int printk(const char *fmt, ...); |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 113 | |
| 114 | /* |
Peter Zijlstra | 3ccf3e8 | 2012-02-27 10:47:00 +0100 | [diff] [blame] | 115 | * Special printk facility for scheduler use only, _DO_NOT_USE_ ! |
| 116 | */ |
| 117 | __printf(1, 2) __cold int printk_sched(const char *fmt, ...); |
| 118 | |
| 119 | /* |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 120 | * Please don't use printk_ratelimit(), because it shares ratelimiting state |
| 121 | * with all other unrelated printk_ratelimit() callsites. Instead use |
| 122 | * printk_ratelimited() or plain old __ratelimit(). |
| 123 | */ |
| 124 | extern int __printk_ratelimit(const char *func); |
| 125 | #define printk_ratelimit() __printk_ratelimit(__func__) |
| 126 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, |
| 127 | unsigned int interval_msec); |
| 128 | |
| 129 | extern int printk_delay_msec; |
| 130 | extern int dmesg_restrict; |
Dan Rosenberg | 455cd5a | 2011-01-12 16:59:41 -0800 | [diff] [blame] | 131 | extern int kptr_restrict; |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 132 | |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 133 | void log_buf_kexec_setup(void); |
Mike Travis | 162a7e7 | 2011-05-24 17:13:20 -0700 | [diff] [blame] | 134 | void __init setup_log_buf(int early); |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 135 | #else |
Joe Perches | b9075fa | 2011-10-31 17:11:33 -0700 | [diff] [blame] | 136 | static inline __printf(1, 0) |
Joe Perches | 5264f2f | 2011-01-12 16:59:45 -0800 | [diff] [blame] | 137 | int vprintk(const char *s, va_list args) |
| 138 | { |
| 139 | return 0; |
| 140 | } |
Joe Perches | b9075fa | 2011-10-31 17:11:33 -0700 | [diff] [blame] | 141 | static inline __printf(1, 2) __cold |
Joe Perches | 5264f2f | 2011-01-12 16:59:45 -0800 | [diff] [blame] | 142 | int printk(const char *s, ...) |
| 143 | { |
| 144 | return 0; |
| 145 | } |
Peter Zijlstra | 3ccf3e8 | 2012-02-27 10:47:00 +0100 | [diff] [blame] | 146 | static inline __printf(1, 2) __cold |
| 147 | int printk_sched(const char *s, ...) |
| 148 | { |
| 149 | return 0; |
| 150 | } |
Joe Perches | 5264f2f | 2011-01-12 16:59:45 -0800 | [diff] [blame] | 151 | static inline int printk_ratelimit(void) |
| 152 | { |
| 153 | return 0; |
| 154 | } |
| 155 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, |
| 156 | unsigned int interval_msec) |
| 157 | { |
| 158 | return false; |
| 159 | } |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 160 | |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 161 | static inline void log_buf_kexec_setup(void) |
| 162 | { |
| 163 | } |
Mike Travis | 162a7e7 | 2011-05-24 17:13:20 -0700 | [diff] [blame] | 164 | |
| 165 | static inline void setup_log_buf(int early) |
| 166 | { |
| 167 | } |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 168 | #endif |
| 169 | |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 170 | extern void dump_stack(void) __cold; |
| 171 | |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 172 | #ifndef pr_fmt |
| 173 | #define pr_fmt(fmt) fmt |
| 174 | #endif |
| 175 | |
| 176 | #define pr_emerg(fmt, ...) \ |
Joe Perches | a3f938b | 2011-01-12 16:59:48 -0800 | [diff] [blame] | 177 | printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 178 | #define pr_alert(fmt, ...) \ |
Joe Perches | a3f938b | 2011-01-12 16:59:48 -0800 | [diff] [blame] | 179 | printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 180 | #define pr_crit(fmt, ...) \ |
Joe Perches | a3f938b | 2011-01-12 16:59:48 -0800 | [diff] [blame] | 181 | printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 182 | #define pr_err(fmt, ...) \ |
Joe Perches | a3f938b | 2011-01-12 16:59:48 -0800 | [diff] [blame] | 183 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 184 | #define pr_warning(fmt, ...) \ |
Joe Perches | a3f938b | 2011-01-12 16:59:48 -0800 | [diff] [blame] | 185 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 186 | #define pr_warn pr_warning |
| 187 | #define pr_notice(fmt, ...) \ |
Joe Perches | a3f938b | 2011-01-12 16:59:48 -0800 | [diff] [blame] | 188 | printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 189 | #define pr_info(fmt, ...) \ |
Joe Perches | a3f938b | 2011-01-12 16:59:48 -0800 | [diff] [blame] | 190 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 191 | #define pr_cont(fmt, ...) \ |
| 192 | printk(KERN_CONT fmt, ##__VA_ARGS__) |
| 193 | |
| 194 | /* pr_devel() should produce zero code unless DEBUG is defined */ |
| 195 | #ifdef DEBUG |
| 196 | #define pr_devel(fmt, ...) \ |
| 197 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
| 198 | #else |
| 199 | #define pr_devel(fmt, ...) \ |
Joe Perches | 5264f2f | 2011-01-12 16:59:45 -0800 | [diff] [blame] | 200 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 201 | #endif |
| 202 | |
| 203 | /* If you are writing a driver, please use dev_dbg instead */ |
Jim Cromie | b558c96 | 2011-12-19 17:11:18 -0500 | [diff] [blame] | 204 | #if defined(CONFIG_DYNAMIC_DEBUG) |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 205 | /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */ |
| 206 | #define pr_debug(fmt, ...) \ |
| 207 | dynamic_pr_debug(fmt, ##__VA_ARGS__) |
Jim Cromie | b558c96 | 2011-12-19 17:11:18 -0500 | [diff] [blame] | 208 | #elif defined(DEBUG) |
| 209 | #define pr_debug(fmt, ...) \ |
| 210 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 211 | #else |
| 212 | #define pr_debug(fmt, ...) \ |
Joe Perches | 5264f2f | 2011-01-12 16:59:45 -0800 | [diff] [blame] | 213 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 214 | #endif |
| 215 | |
| 216 | /* |
Joe Perches | 16cb839 | 2011-01-12 16:59:46 -0800 | [diff] [blame] | 217 | * Print a one-time message (analogous to WARN_ONCE() et al): |
| 218 | */ |
| 219 | |
| 220 | #ifdef CONFIG_PRINTK |
| 221 | #define printk_once(fmt, ...) \ |
| 222 | ({ \ |
| 223 | static bool __print_once; \ |
| 224 | \ |
| 225 | if (!__print_once) { \ |
| 226 | __print_once = true; \ |
| 227 | printk(fmt, ##__VA_ARGS__); \ |
| 228 | } \ |
| 229 | }) |
| 230 | #else |
| 231 | #define printk_once(fmt, ...) \ |
| 232 | no_printk(fmt, ##__VA_ARGS__) |
| 233 | #endif |
| 234 | |
| 235 | #define pr_emerg_once(fmt, ...) \ |
| 236 | printk_once(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) |
| 237 | #define pr_alert_once(fmt, ...) \ |
| 238 | printk_once(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) |
| 239 | #define pr_crit_once(fmt, ...) \ |
| 240 | printk_once(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) |
| 241 | #define pr_err_once(fmt, ...) \ |
| 242 | printk_once(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) |
| 243 | #define pr_warn_once(fmt, ...) \ |
| 244 | printk_once(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) |
| 245 | #define pr_notice_once(fmt, ...) \ |
| 246 | printk_once(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) |
| 247 | #define pr_info_once(fmt, ...) \ |
| 248 | printk_once(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) |
| 249 | #define pr_cont_once(fmt, ...) \ |
| 250 | printk_once(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__) |
| 251 | /* If you are writing a driver, please use dev_dbg instead */ |
| 252 | #if defined(DEBUG) |
| 253 | #define pr_debug_once(fmt, ...) \ |
| 254 | printk_once(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
| 255 | #else |
| 256 | #define pr_debug_once(fmt, ...) \ |
| 257 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
| 258 | #endif |
| 259 | |
| 260 | /* |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 261 | * ratelimited messages with local ratelimit_state, |
| 262 | * no local ratelimit_state used in the !PRINTK case |
| 263 | */ |
| 264 | #ifdef CONFIG_PRINTK |
Joe Perches | 6ec42a56 | 2011-01-12 16:59:47 -0800 | [diff] [blame] | 265 | #define printk_ratelimited(fmt, ...) \ |
| 266 | ({ \ |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 267 | static DEFINE_RATELIMIT_STATE(_rs, \ |
| 268 | DEFAULT_RATELIMIT_INTERVAL, \ |
| 269 | DEFAULT_RATELIMIT_BURST); \ |
| 270 | \ |
| 271 | if (__ratelimit(&_rs)) \ |
| 272 | printk(fmt, ##__VA_ARGS__); \ |
| 273 | }) |
| 274 | #else |
Joe Perches | 6ec42a56 | 2011-01-12 16:59:47 -0800 | [diff] [blame] | 275 | #define printk_ratelimited(fmt, ...) \ |
| 276 | no_printk(fmt, ##__VA_ARGS__) |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 277 | #endif |
| 278 | |
Joe Perches | 6ec42a56 | 2011-01-12 16:59:47 -0800 | [diff] [blame] | 279 | #define pr_emerg_ratelimited(fmt, ...) \ |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 280 | printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) |
Joe Perches | 6ec42a56 | 2011-01-12 16:59:47 -0800 | [diff] [blame] | 281 | #define pr_alert_ratelimited(fmt, ...) \ |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 282 | printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) |
Joe Perches | 6ec42a56 | 2011-01-12 16:59:47 -0800 | [diff] [blame] | 283 | #define pr_crit_ratelimited(fmt, ...) \ |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 284 | printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) |
Joe Perches | 6ec42a56 | 2011-01-12 16:59:47 -0800 | [diff] [blame] | 285 | #define pr_err_ratelimited(fmt, ...) \ |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 286 | printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) |
Joe Perches | 6ec42a56 | 2011-01-12 16:59:47 -0800 | [diff] [blame] | 287 | #define pr_warn_ratelimited(fmt, ...) \ |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 288 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) |
Joe Perches | 6ec42a56 | 2011-01-12 16:59:47 -0800 | [diff] [blame] | 289 | #define pr_notice_ratelimited(fmt, ...) \ |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 290 | printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) |
Joe Perches | 6ec42a56 | 2011-01-12 16:59:47 -0800 | [diff] [blame] | 291 | #define pr_info_ratelimited(fmt, ...) \ |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 292 | printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) |
| 293 | /* no pr_cont_ratelimited, don't do that... */ |
| 294 | /* If you are writing a driver, please use dev_dbg instead */ |
| 295 | #if defined(DEBUG) |
Joe Perches | 6ec42a56 | 2011-01-12 16:59:47 -0800 | [diff] [blame] | 296 | #define pr_debug_ratelimited(fmt, ...) \ |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 297 | printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
| 298 | #else |
| 299 | #define pr_debug_ratelimited(fmt, ...) \ |
Joe Perches | 5264f2f | 2011-01-12 16:59:45 -0800 | [diff] [blame] | 300 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 301 | #endif |
| 302 | |
Kay Sievers | e11fea9 | 2012-05-03 02:29:41 +0200 | [diff] [blame] | 303 | extern const struct file_operations kmsg_fops; |
| 304 | |
Joe Perches | ac83ed6 | 2011-01-12 16:59:47 -0800 | [diff] [blame] | 305 | enum { |
| 306 | DUMP_PREFIX_NONE, |
| 307 | DUMP_PREFIX_ADDRESS, |
| 308 | DUMP_PREFIX_OFFSET |
| 309 | }; |
| 310 | extern void hex_dump_to_buffer(const void *buf, size_t len, |
| 311 | int rowsize, int groupsize, |
| 312 | char *linebuf, size_t linebuflen, bool ascii); |
| 313 | #ifdef CONFIG_PRINTK |
| 314 | extern void print_hex_dump(const char *level, const char *prefix_str, |
| 315 | int prefix_type, int rowsize, int groupsize, |
| 316 | const void *buf, size_t len, bool ascii); |
| 317 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, |
| 318 | const void *buf, size_t len); |
| 319 | #else |
| 320 | static inline void print_hex_dump(const char *level, const char *prefix_str, |
| 321 | int prefix_type, int rowsize, int groupsize, |
| 322 | const void *buf, size_t len, bool ascii) |
| 323 | { |
| 324 | } |
| 325 | static inline void print_hex_dump_bytes(const char *prefix_str, int prefix_type, |
| 326 | const void *buf, size_t len) |
| 327 | { |
| 328 | } |
| 329 | |
| 330 | #endif |
| 331 | |
Linus Torvalds | 968ab18 | 2010-11-15 13:37:37 -0800 | [diff] [blame] | 332 | #endif |