Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
printk.h File Reference
#include <linux/init.h>
#include <linux/kern_levels.h>

Go to the source code of this file.

Data Structures

struct  va_format
 

Macros

#define console_loglevel   (console_printk[0])
 
#define default_message_loglevel   (console_printk[1])
 
#define minimum_console_loglevel   (console_printk[2])
 
#define default_console_loglevel   (console_printk[3])
 
#define FW_BUG   "[Firmware Bug]: "
 
#define FW_WARN   "[Firmware Warn]: "
 
#define FW_INFO   "[Firmware Info]: "
 
#define HW_ERR   "[Hardware Error]: "
 
#define pr_fmt(fmt)   fmt
 
#define pr_emerg(fmt,...)   printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_alert(fmt,...)   printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_crit(fmt,...)   printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_err(fmt,...)   printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_warning(fmt,...)   printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_warn   pr_warning
 
#define pr_notice(fmt,...)   printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_info(fmt,...)   printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_cont(fmt,...)   printk(KERN_CONT fmt, ##__VA_ARGS__)
 
#define pr_devel(fmt,...)   no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_debug(fmt,...)   no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
 
#define printk_once(fmt,...)   no_printk(fmt, ##__VA_ARGS__)
 
#define pr_emerg_once(fmt,...)   printk_once(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_alert_once(fmt,...)   printk_once(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_crit_once(fmt,...)   printk_once(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_err_once(fmt,...)   printk_once(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_warn_once(fmt,...)   printk_once(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_notice_once(fmt,...)   printk_once(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_info_once(fmt,...)   printk_once(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_cont_once(fmt,...)   printk_once(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_debug_once(fmt,...)   no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
 
#define printk_ratelimited(fmt,...)   no_printk(fmt, ##__VA_ARGS__)
 
#define pr_emerg_ratelimited(fmt,...)   printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_alert_ratelimited(fmt,...)   printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_crit_ratelimited(fmt,...)   printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_err_ratelimited(fmt,...)   printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_warn_ratelimited(fmt,...)   printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_notice_ratelimited(fmt,...)   printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_info_ratelimited(fmt,...)   printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_debug_ratelimited(fmt,...)   no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
 

Enumerations

enum  { DUMP_PREFIX_NONE, DUMP_PREFIX_ADDRESS, DUMP_PREFIX_OFFSET }
 

Functions

static asmlinkage int printk_needs_cpu (int cpu)
 
void printk_tick (void)
 
void dump_stack (void) __cold
 
void hex_dump_to_buffer (const void *buf, size_t len, int rowsize, int groupsize, char *linebuf, size_t linebuflen, bool ascii)
 

Variables

const char linux_banner []
 
const char linux_proc_banner []
 
int console_printk []
 
static va_list args
 
struct file_operations kmsg_fops
 

Macro Definition Documentation

#define console_loglevel   (console_printk[0])

Definition at line 36 of file printk.h.

#define default_console_loglevel   (console_printk[3])

Definition at line 39 of file printk.h.

#define default_message_loglevel   (console_printk[1])

Definition at line 37 of file printk.h.

#define FW_BUG   "[Firmware Bug]: "

Definition at line 77 of file printk.h.

#define FW_INFO   "[Firmware Info]: "

Definition at line 79 of file printk.h.

#define FW_WARN   "[Firmware Warn]: "

Definition at line 78 of file printk.h.

#define HW_ERR   "[Hardware Error]: "

Definition at line 86 of file printk.h.

#define minimum_console_loglevel   (console_printk[2])

Definition at line 38 of file printk.h.

#define pr_alert (   fmt,
  ... 
)    printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 185 of file printk.h.

#define pr_alert_once (   fmt,
  ... 
)    printk_once(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 244 of file printk.h.

#define pr_alert_ratelimited (   fmt,
  ... 
)    printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 288 of file printk.h.

#define pr_cont (   fmt,
  ... 
)    printk(KERN_CONT fmt, ##__VA_ARGS__)

Definition at line 198 of file printk.h.

#define pr_cont_once (   fmt,
  ... 
)    printk_once(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 256 of file printk.h.

#define pr_crit (   fmt,
  ... 
)    printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 187 of file printk.h.

#define pr_crit_once (   fmt,
  ... 
)    printk_once(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 246 of file printk.h.

#define pr_crit_ratelimited (   fmt,
  ... 
)    printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 290 of file printk.h.

#define pr_debug (   fmt,
  ... 
)    no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 219 of file printk.h.

#define pr_debug_once (   fmt,
  ... 
)    no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 263 of file printk.h.

#define pr_debug_ratelimited (   fmt,
  ... 
)    no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 306 of file printk.h.

#define pr_devel (   fmt,
  ... 
)    no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 206 of file printk.h.

#define pr_emerg (   fmt,
  ... 
)    printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 183 of file printk.h.

#define pr_emerg_once (   fmt,
  ... 
)    printk_once(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 242 of file printk.h.

#define pr_emerg_ratelimited (   fmt,
  ... 
)    printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 286 of file printk.h.

#define pr_err (   fmt,
  ... 
)    printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 189 of file printk.h.

#define pr_err_once (   fmt,
  ... 
)    printk_once(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 248 of file printk.h.

#define pr_err_ratelimited (   fmt,
  ... 
)    printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 292 of file printk.h.

#define pr_fmt (   fmt)    fmt

Definition at line 180 of file printk.h.

#define pr_info (   fmt,
  ... 
)    printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 196 of file printk.h.

#define pr_info_once (   fmt,
  ... 
)    printk_once(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 254 of file printk.h.

#define pr_info_ratelimited (   fmt,
  ... 
)    printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 298 of file printk.h.

#define pr_notice (   fmt,
  ... 
)    printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 194 of file printk.h.

#define pr_notice_once (   fmt,
  ... 
)    printk_once(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 252 of file printk.h.

#define pr_notice_ratelimited (   fmt,
  ... 
)    printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 296 of file printk.h.

#define pr_warn   pr_warning

Definition at line 193 of file printk.h.

#define pr_warn_once (   fmt,
  ... 
)    printk_once(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 250 of file printk.h.

#define pr_warn_ratelimited (   fmt,
  ... 
)    printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 294 of file printk.h.

#define pr_warning (   fmt,
  ... 
)    printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 191 of file printk.h.

#define printk_once (   fmt,
  ... 
)    no_printk(fmt, ##__VA_ARGS__)

Definition at line 238 of file printk.h.

#define printk_ratelimited (   fmt,
  ... 
)    no_printk(fmt, ##__VA_ARGS__)

Definition at line 282 of file printk.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
DUMP_PREFIX_NONE 
DUMP_PREFIX_ADDRESS 
DUMP_PREFIX_OFFSET 

Definition at line 312 of file printk.h.

Function Documentation

void dump_stack ( void  )

Definition at line 172 of file traps.c.

void hex_dump_to_buffer ( const void buf,
size_t  len,
int  rowsize,
int  groupsize,
char linebuf,
size_t  linebuflen,
bool  ascii 
)

hex_dump_to_buffer - convert a blob of data to "hex ASCII" in memory : data blob to dump : number of bytes in the : number of bytes to print per line; must be 16 or 32 : number of bytes to print at a time (1, 2, 4, 8; default = 1) : where to put the converted data : total size of , including space for terminating NUL : include ASCII after the hex output

hex_dump_to_buffer() works on one "line" of output at a time, i.e., 16 or 32 bytes of input data converted to hex + ASCII output.

Given a buffer of u8 data, hex_dump_to_buffer() converts the input data to a hex + ASCII dump at the supplied memory location. The converted output is always NUL-terminated.

E.g.: hex_dump_to_buffer(frame->data, frame->len, 16, 1, linebuf, sizeof(linebuf), true);

example output buffer: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f

Definition at line 83 of file hexdump.c.

static asmlinkage int printk_needs_cpu ( int  cpu)

Definition at line 1971 of file printk.c.

void printk_tick ( void  )

Definition at line 1958 of file printk.c.

Variable Documentation

va_list args
Initial value:
{
return 0

Definition at line 145 of file printk.h.

int console_printk[]

Definition at line 67 of file printk.c.

const char linux_banner[]

Definition at line 41 of file version.c.

const char linux_proc_banner[]

Definition at line 45 of file version.c.