Re: [PATCH 3/6] x86/dumpstack: make printk_stack_address() more generally useful

From: Linus Torvalds
Date: Wed Aug 24 2016 - 15:12:10 EST


On Wed, Aug 24, 2016 at 12:50 PM, Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
> Change printk_stack_address() to be useful when called by an unwinder
> outside the context of dump_trace().
...
> printk("%s [<%p>] %s%pB\n",
> - (char *)data, (void *)address, reliable ? "" : "? ",
> + log_lvl, (void *)address, reliable ? "" : "? ",
> (void *)address);

Side note: we should just remove the "[<hex>]" thing entirely, I
think. It's not just redundant, but when people care about kernel
address randomization it ends up spilling the beans on the offset in
warnings (in oopses you can generally find the data in the stack
backtraces, which we probably should remove too as useless).

So it would be just

printk("%s %s%pB\n", log_lvl, reliable ? "" : "? ", (void *)address);

instead.

For the non-kallsyms case we _could_ also just make the '%pB' format
add the [<>] markers back in case somebody still uses the user-space
kallsyms script that looks up hex numbers.

Right now the hex numbers are not only useless in stack dumps (since
you can't look up symbols using them anyway thanks to randomization),
they are noise that makes the stack traces harder to read. So let's
just remove them?

I realize that is entirely orthogonal to this particular patch, but it
happened to touch this file.

No objections to this series other than that comment.

Linus