Release 4.14 arch/powerpc/kernel/stacktrace.c
/*
* Stack trace utility
*
* Copyright 2008 Christoph Hellwig, IBM Corp.
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include <linux/export.h>
#include <linux/sched.h>
#include <linux/sched/debug.h>
#include <linux/stacktrace.h>
#include <asm/ptrace.h>
#include <asm/processor.h>
/*
* Save stack-backtrace addresses into a stack_trace buffer.
*/
static void save_context_stack(struct stack_trace *trace, unsigned long sp,
struct task_struct *tsk, int savesched)
{
for (;;) {
unsigned long *stack = (unsigned long *) sp;
unsigned long newsp, ip;
if (!validate_sp(sp, tsk, STACK_FRAME_OVERHEAD))
return;
newsp = stack[0];
ip = stack[STACK_FRAME_LR_SAVE];
if (savesched || !in_sched_functions(ip)) {
if (!trace->skip)
trace->entries[trace->nr_entries++] = ip;
else
trace->skip--;
}
if (trace->nr_entries >= trace->max_entries)
return;
sp = newsp;
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Christoph Hellwig | 101 | 79.53% | 1 | 50.00% |
Arnd Bergmann | 26 | 20.47% | 1 | 50.00% |
Total | 127 | 100.00% | 2 | 100.00% |
void save_stack_trace(struct stack_trace *trace)
{
unsigned long sp;
sp = current_stack_pointer();
save_context_stack(trace, sp, current, 1);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Arnd Bergmann | 25 | 83.33% | 1 | 33.33% |
Anton Blanchard | 5 | 16.67% | 2 | 66.67% |
Total | 30 | 100.00% | 3 | 100.00% |
EXPORT_SYMBOL_GPL(save_stack_trace);
void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
{
unsigned long sp;
if (tsk == current)
sp = current_stack_pointer();
else
sp = tsk->thread.ksp;
save_context_stack(trace, sp, tsk, 0);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Arnd Bergmann | 26 | 52.00% | 2 | 66.67% |
Thadeu Lima de Souza Cascardo | 24 | 48.00% | 1 | 33.33% |
Total | 50 | 100.00% | 3 | 100.00% |
EXPORT_SYMBOL_GPL(save_stack_trace_tsk);
void
save_stack_trace_regs(struct pt_regs *regs, struct stack_trace *trace)
{
save_context_stack(trace, regs->gpr[1], current, 0);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Steven Rostedt | 31 | 100.00% | 1 | 100.00% |
Total | 31 | 100.00% | 1 | 100.00% |
EXPORT_SYMBOL_GPL(save_stack_trace_regs);
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Christoph Hellwig | 112 | 41.03% | 1 | 11.11% |
Arnd Bergmann | 92 | 33.70% | 2 | 22.22% |
Steven Rostedt | 36 | 13.19% | 1 | 11.11% |
Thadeu Lima de Souza Cascardo | 24 | 8.79% | 1 | 11.11% |
Anton Blanchard | 5 | 1.83% | 2 | 22.22% |
Ingo Molnar | 3 | 1.10% | 1 | 11.11% |
Paul Gortmaker | 1 | 0.37% | 1 | 11.11% |
Total | 273 | 100.00% | 9 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.