lkml.org 
[lkml]   [2015]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 10/12] sched: use {cpu|node}mask pr_cont and seq output functions
Hello, Peter.

On Mon, Dec 15, 2014 at 11:39:15AM +0100, Peter Zijlstra wrote:
> I would very much prefer something like the below instead..
>
> I'm not a great fan of pr_cont, it makes a mess of things if there's
> multiple cpus printing bits.

Yeah, it does sometimes get annoying and bitmaps should be generic
enough to have support from core printk functions.

...
> --- a/lib/vsprintf.c
> +++ b/lib/vsprintf.c
> @@ -27,6 +27,7 @@
> #include <linux/uaccess.h>
> #include <linux/ioport.h>
> #include <linux/dcache.h>
> +#include <linux/cpumask.h>
> #include <net/addrconf.h>
>
> #include <asm/page.h> /* for PAGE_SIZE */
> @@ -1218,6 +1219,7 @@ int kptr_restrict __read_mostly;
> * The maximum supported length is 64 bytes of the input. Consider
> * to use print_hex_dump() for the larger input.
> * - 'a' For a phys_addr_t type and its derivative types (passed by reference)
> + * - 'c' For a cpumask list
> *
> * Note: The difference between 'S' and 'F' is that on ia64 and ppc64
> * function pointers are really function descriptors, which contain a
> @@ -1335,6 +1337,8 @@ char *pointer(const char *fmt, char *buf
> return dentry_name(buf, end,
> ((const struct file *)ptr)->f_path.dentry,
> spec, fmt);
> + case 'c':
> + return buf + cpulist_scnprintf(buf, end - buf, ptr);

I think we prolly want something more generic than hard coding cpu and
node masks into printk. Prolly something along the line of %*pb so
that the caller can do something along the line of

printk("cpumask: %*pb\n", nr_cpumask_bits, cpumask);

I'll see if that's actually doable.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2015-01-12 14:41    [W:0.057 / U:1.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site