Christophe Leroy <christophe.le...@c-s.fr> writes: > Le 08/01/2019 à 13:04, Michael Ellerman a écrit : >> Using pr_cont() risks having our output interleaved with other output >> from other CPUs. Instead use a seq_buf to construct the line and then >> print it as a whole. > > Why not simply doing a single printk() or similar on the same model as > X86 for instance ? > (https://elixir.bootlin.com/linux/v5.0-rc1/source/arch/x86/kernel/dumpstack.c#L368)
Yeah we could do it that way, though it can become a bit of a mess. In this case I guess it's not *too* bad: printk("%s PAGE_SIZE=%luK%s%s%s%s%s %s\n", IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN) ? "LE" : "BE", PAGE_SIZE / 1024, IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT" : "", IS_ENABLED(CONFIG_SMP) ? " SMP" : "", IS_ENABLED(CONFIG_SMP) ? (" NR_CPUS=" __stringify(NR_CPUS)) : "", debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "", IS_ENABLED(CONFIG_NUMA) ? " NUMA" : "", ppc_md.name ? ppc_md.name : ""); And the generated code is obviously a lot smaller. So yeah I'll go with that. Thanks for the review. cheers