Skip to content

Commit

Permalink
Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/s…
Browse files Browse the repository at this point in the history
…cm/linux/kernel/git/tip/tip

Pull lockdep fix from Ingo Molnar:
 "This fixes an ugly lockdep stack trace output regression. (But also
  affects other stacktrace users such as kmemleak, KASAN, etc)"

* 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  stacktrace, lockdep: Fix address, newline ugliness
  • Loading branch information
Linus Torvalds committed Feb 11, 2017
2 parents 21a7061 + bfeda41 commit 4e4f74a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions kernel/stacktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,24 @@ void print_stack_trace(struct stack_trace *trace, int spaces)
if (WARN_ON(!trace->entries))
return;

for (i = 0; i < trace->nr_entries; i++) {
printk("%*c", 1 + spaces, ' ');
print_ip_sym(trace->entries[i]);
}
for (i = 0; i < trace->nr_entries; i++)
printk("%*c%pS\n", 1 + spaces, ' ', (void *)trace->entries[i]);
}
EXPORT_SYMBOL_GPL(print_stack_trace);

int snprint_stack_trace(char *buf, size_t size,
struct stack_trace *trace, int spaces)
{
int i;
unsigned long ip;
int generated;
int total = 0;

if (WARN_ON(!trace->entries))
return 0;

for (i = 0; i < trace->nr_entries; i++) {
ip = trace->entries[i];
generated = snprintf(buf, size, "%*c[<%p>] %pS\n",
1 + spaces, ' ', (void *) ip, (void *) ip);
generated = snprintf(buf, size, "%*c%pS\n", 1 + spaces, ' ',
(void *)trace->entries[i]);

total += generated;

Expand Down

0 comments on commit 4e4f74a

Please sign in to comment.