cregit-Linux how code gets into the kernel

Release 4.10 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/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

PersonTokensPropCommitsCommitProp
christoph hellwigchristoph hellwig10179.53%150.00%
arnd bergmannarnd bergmann2620.47%150.00%
Total127100.00%2100.00%


void save_stack_trace(struct stack_trace *trace) { unsigned long sp; sp = current_stack_pointer(); save_context_stack(trace, sp, current, 1); }

Contributors

PersonTokensPropCommitsCommitProp
arnd bergmannarnd bergmann2583.33%133.33%
anton blanchardanton blanchard516.67%266.67%
Total30100.00%3100.00%

EXPORT_SYMBOL_GPL(save_stack_trace);
void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace) { save_context_stack(trace, tsk->thread.ksp, tsk, 0); }

Contributors

PersonTokensPropCommitsCommitProp
arnd bergmannarnd bergmann30100.00%2100.00%
Total30100.00%2100.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

PersonTokensPropCommitsCommitProp
steven rostedtsteven rostedt31100.00%1100.00%
Total31100.00%1100.00%

EXPORT_SYMBOL_GPL(save_stack_trace_regs);

Overall Contributors

PersonTokensPropCommitsCommitProp
christoph hellwigchristoph hellwig11244.80%114.29%
arnd bergmannarnd bergmann9638.40%228.57%
steven rostedtsteven rostedt3614.40%114.29%
anton blanchardanton blanchard52.00%228.57%
paul gortmakerpaul gortmaker10.40%114.29%
Total250100.00%7100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.