@@ -3865,6 +3865,21 @@ void dev_printk(const char *level, const struct device *dev,
}
EXPORT_SYMBOL(dev_printk);
+void durable_name_printk(const char *level, const struct device *dev,
+ const char *fmt, ...)
+{
+ size_t dictlen;
+ va_list args;
+ char dict[288];
+
+ dictlen = dev_durable_name(dev, dict, sizeof(dict));
+
+ va_start(args, fmt);
+ vprintk_emit(0, level[1] - '0', dict, dictlen, fmt, args);
+ va_end(args);
+}
+EXPORT_SYMBOL(durable_name_printk);
+
#define define_dev_printk_level(func, kern_level) \
void func(const struct device *dev, const char *fmt, ...) \
{ \
@@ -32,6 +32,11 @@ int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...);
__printf(3, 4) __cold
void dev_printk(const char *level, const struct device *dev,
const char *fmt, ...);
+
+__printf(3, 4) __cold
+void durable_name_printk(const char *level, const struct device *dev,
+ const char *fmt, ...);
+
__printf(2, 3) __cold
void _dev_emerg(const struct device *dev, const char *fmt, ...);
__printf(2, 3) __cold
Ideally block related code would standardize on using dev_printk, but dev_printk does change the user visible messages which is questionable. Adding this function which adds the structured key/value durable name to the log entry. It has the same signature as dev_printk. In the future, code that is using this could easily transition to dev_printk when that becomes workable. Signed-off-by: Tony Asleson <tasleson@redhat.com> --- drivers/base/core.c | 15 +++++++++++++++ include/linux/dev_printk.h | 5 +++++ 2 files changed, 20 insertions(+)