summaryrefslogtreecommitdiffstats
path: root/include/linux/arcdevice.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/arcdevice.h')
-rw-r--r--include/linux/arcdevice.h32
1 files changed, 17 insertions, 15 deletions
diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h
index f07c66383b88..a678027ff6c2 100644
--- a/include/linux/arcdevice.h
+++ b/include/linux/arcdevice.h
@@ -81,34 +81,36 @@ extern int arcnet_debug;
81#define BUGLVL(x) ((x) & ARCNET_DEBUG_MAX & arcnet_debug) 81#define BUGLVL(x) ((x) & ARCNET_DEBUG_MAX & arcnet_debug)
82 82
83/* macros to simplify debug checking */ 83/* macros to simplify debug checking */
84#define BUGMSG(x, fmt, ...) \ 84#define arc_printk(x, dev, fmt, ...) \
85do { \ 85do { \
86 if (BUGLVL(x)) \ 86 if (BUGLVL(x)) { \
87 printk("%s%6s: " fmt, \ 87 if ((x) == D_NORMAL) \
88 (x) == D_NORMAL ? KERN_WARNING : \ 88 netdev_warn(dev, fmt, ##__VA_ARGS__); \
89 (x) < D_DURING ? KERN_INFO : KERN_DEBUG, \ 89 else if ((x) < D_DURING) \
90 dev->name, ##__VA_ARGS__); \ 90 netdev_info(dev, fmt, ##__VA_ARGS__); \
91 else \
92 netdev_dbg(dev, fmt, ##__VA_ARGS__); \
93 } \
91} while (0) 94} while (0)
92 95
93#define BUGMSG2(x, fmt, ...) \ 96#define arc_cont(x, fmt, ...) \
94do { \ 97do { \
95 if (BUGLVL(x)) \ 98 if (BUGLVL(x)) \
96 printk(fmt, ##__VA_ARGS__); \ 99 pr_cont(fmt, ##__VA_ARGS__); \
97} while (0) 100} while (0)
98 101
99/* see how long a function call takes to run, expressed in CPU cycles */ 102/* see how long a function call takes to run, expressed in CPU cycles */
100#define TIME(name, bytes, call) \ 103#define TIME(dev, name, bytes, call) \
101do { \ 104do { \
102 if (BUGLVL(D_TIMING)) { \ 105 if (BUGLVL(D_TIMING)) { \
103 unsigned long _x, _y; \ 106 unsigned long _x, _y; \
104 _x = get_cycles(); \ 107 _x = get_cycles(); \
105 call; \ 108 call; \
106 _y = get_cycles(); \ 109 _y = get_cycles(); \
107 BUGMSG(D_TIMING, \ 110 arc_printk(D_TIMING, dev, \
108 "%s: %d bytes in %lu cycles == " \ 111 "%s: %d bytes in %lu cycles == %lu Kbytes/100Mcycle\n", \
109 "%lu Kbytes/100Mcycle\n", \ 112 name, bytes, _y - _x, \
110 name, bytes, _y - _x, \ 113 100000000 / 1024 * bytes / (_y - _x + 1)); \
111 100000000 / 1024 * bytes / (_y - _x + 1)); \
112 } else { \ 114 } else { \
113 call; \ 115 call; \
114 } \ 116 } \