lkml.org 
[lkml]   [2016]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH] printk: Add option to append kernel version to the dict
Hello,

On (05/13/16 13:58), Calvin Owens wrote:
[..]
> +#if defined(CONFIG_PRINTK_APPEND_UNAME)
> +static ssize_t msg_print_ext_uname(char *buf, size_t size)
> +{
> + return scnprintf(buf, size, " UNAME=%s\n", init_utsname()->release);
> +}
> +#else
> +static ssize_t msg_print_ext_uname(char *buf, size_t size)
> +{
> + return 0;
> +}
> +#endif
> +
> /* /dev/kmsg - userspace message inject/listen interface */
> struct devkmsg_user {
> u64 seq;
> @@ -2305,6 +2317,8 @@ skip:
> sizeof(ext_text) - ext_len,
> log_dict(msg), msg->dict_len,
> log_text(msg), msg->text_len);
> + ext_len += msg_print_ext_uname(ext_text + ext_len,
> + sizeof(ext_text) - ext_len);
> }

what if there is no place left for init_utsname() after msg_print_ext_header() + msg_print_ext_body()?
do you need init_utsname in every message? or just in WARN/ERR ones?

-ss

\
 
 \ /
  Last update: 2016-05-15 08:01    [W:0.079 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site