Similarly to dev/netdev/etc printk helpers, add standard printk helpers for the RDMA subsystem. Example output: efa 0000:00:06.0 efa_0: Hello World! efa_0: Hello World! (no parent device set) (NULL ib_device): Hello World! (ibdev is NULL)
Showing the changes to include/linux (1 of 4 files). Show all
Unified · Split
| @@ -71,6 +71,13 @@ void __dynamic_netdev_dbg(struct _ddebug *descriptor, · 70 unmodified lines | ||
| 71 | 71 | const struct net_device *dev, |
| 72 | 72 | const char *fmt, ...); |
| 73 | 73 | |
| 74 | +struct ib_device; | |
| 75 | + | |
| 76 | +extern __printf(3, 4) | |
| 77 | +void __dynamic_ibdev_dbg(struct _ddebug *descriptor, | |
| 78 | + const struct ib_device *ibdev, | |
| 79 | + const char *fmt, ...); | |
| 80 | + | |
| 74 | 81 | #define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \ |
| 75 | 82 | static struct _ddebug __aligned(8) \ |
| 76 | 83 | __attribute__((section("__verbose"))) name = { \ |
| @@ -154,6 +161,10 @@ void __dynamic_netdev_dbg(struct _ddebug *descriptor, · 77 unmodified lines | ||
| 154 | 161 | _dynamic_func_call(fmt, __dynamic_netdev_dbg, \ |
| 155 | 162 | dev, fmt, ##__VA_ARGS__) |
| 156 | 163 | |
| 164 | +#define dynamic_ibdev_dbg(dev, fmt, ...) \ | |
| 165 | + _dynamic_func_call(fmt, __dynamic_ibdev_dbg, \ | |
| 166 | + dev, fmt, ##__VA_ARGS__) | |
| 167 | + | |
| 157 | 168 | #define dynamic_hex_dump(prefix_str, prefix_type, rowsize, \ |
| 158 | 169 | groupsize, buf, len, ascii) \ |
| 159 | 170 | _dynamic_func_call_no_desc(__builtin_constant_p(prefix_str) ? prefix_str : "hexdump", \ |