cregit-Linux how code gets into the kernel

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

PersonTokensPropCommitsCommitProp
Christoph Hellwig10179.53%150.00%
Arnd 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 Bergmann2583.33%133.33%
Anton 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) { unsigned long sp; if (tsk == current) sp = current_stack_pointer(); else sp = tsk->thread.ksp; save_context_stack(trace, sp, tsk, 0); }

Contributors

PersonTokensPropCommitsCommitProp
Arnd Bergmann2652.00%266.67%
Thadeu Lima de Souza Cascardo2448.00%133.33%
Total50100.00%3100.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 Rostedt31100.00%1100.00%
Total31100.00%1100.00%

EXPORT_SYMBOL_GPL(save_stack_trace_regs);

Overall Contributors

PersonTokensPropCommitsCommitProp
Christoph Hellwig11241.03%111.11%
Arnd Bergmann9233.70%222.22%
Steven Rostedt3613.19%111.11%
Thadeu Lima de Souza Cascardo248.79%111.11%
Anton Blanchard51.83%222.22%
Ingo Molnar31.10%111.11%
Paul Gortmaker10.37%111.11%
Total273100.00%9100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.