mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-02 07:15:31 +00:00
Move pr_ helpers to log.[ch]
This is a place where they should belong to. util.c is too big already. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Acked-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
@@ -15,9 +15,7 @@
|
||||
|
||||
#include "compiler.h"
|
||||
#include "types.h"
|
||||
|
||||
extern void printk(const char *format, ...)
|
||||
__attribute__ ((__format__ (__printf__, 1, 2)));
|
||||
#include "log.h"
|
||||
|
||||
#define PREF_SHIFT_OP(pref, op, size) ((size) op (pref ##BYTES_SHIFT))
|
||||
#define KBYTES_SHIFT 10
|
||||
@@ -32,36 +30,6 @@ extern void printk(const char *format, ...)
|
||||
#define MEGA(size) PREF_SHIFT_OP(K, <<, size)
|
||||
#define GIGA(size) PREF_SHIFT_OP(K, <<, size)
|
||||
|
||||
#define pr_info(fmt, ...) printk(fmt, ##__VA_ARGS__)
|
||||
#define pr_err(fmt, ...) printk("Error (%s:%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
||||
#define pr_panic(fmt, ...) printk("PANIC (%s:%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
||||
#define pr_warning(fmt, ...) printk("Warning (%s:%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
||||
|
||||
#ifdef CR_DEBUG
|
||||
#define pr_debug(fmt, ...) \
|
||||
do { \
|
||||
printk("%s:%d:%s: " fmt, \
|
||||
__FILE__, __LINE__,__func__, \
|
||||
##__VA_ARGS__); \
|
||||
} while (0)
|
||||
#define dprintk(fmt, ...) printk(fmt, ##__VA_ARGS__)
|
||||
#else
|
||||
#define pr_debug(fmt, ...)
|
||||
#define dprintk(fmt, ...)
|
||||
#endif
|
||||
|
||||
#define die(fmt, ...) \
|
||||
do { \
|
||||
printk("die (%s:%d): " fmt, __FILE__, \
|
||||
__LINE__, ##__VA_ARGS__); \
|
||||
exit(1); \
|
||||
} while (0)
|
||||
|
||||
#define pr_perror(fmt, ...) \
|
||||
do { \
|
||||
pr_err(fmt ": %m\n", ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#ifndef BUG_ON_HANDLER
|
||||
|
||||
#ifdef CR_NOGLIBC
|
||||
|
Reference in New Issue
Block a user