[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160515063643.GA817@swordfish>
Date: Sun, 15 May 2016 15:36:43 +0900
From: Sergey Senozhatsky <sergey.senozhatsky@...il.com>
To: Calvin Owens <calvinowens@...com>
Cc: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>,
David Howells <dhowells@...hat.com>,
Pranith Kumar <bobby.prani@...il.com>,
David Woodhouse <David.Woodhouse@...el.com>,
Johannes Weiner <hannes@...xchg.org>,
Ard Biesheuvel <ard.biesheuvel@...aro.org>,
Petr Mladek <pmladek@...e.com>, Tejun Heo <tj@...nel.org>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Vasily Averin <vvs@...tuozzo.com>,
Thierry Reding <treding@...dia.com>,
Geliang Tang <geliangtang@....com>,
Ivan Delalande <colona@...sta.com>,
linux-kernel@...r.kernel.org, kernel-team@...com
Subject: Re: [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
Powered by blists - more mailing lists