cregit-Linux how code gets into the kernel

Release 4.14 arch/sh/kernel/stacktrace.c

Directory: arch/sh/kernel
/*
 * arch/sh/kernel/stacktrace.c
 *
 * Stack trace management functions
 *
 *  Copyright (C) 2006 - 2008  Paul Mundt
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 */
#include <linux/sched.h>
#include <linux/sched/debug.h>
#include <linux/stacktrace.h>
#include <linux/thread_info.h>
#include <linux/module.h>
#include <asm/unwinder.h>
#include <asm/ptrace.h>
#include <asm/stacktrace.h>


static int save_stack_stack(void *data, char *name) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Matt Fleming1694.12%150.00%
Paul Mundt15.88%150.00%
Total17100.00%2100.00%

/* * Save stack-backtrace addresses into a stack_trace buffer. */
static void save_stack_address(void *data, unsigned long addr, int reliable) { struct stack_trace *trace = data; if (!reliable) return; if (trace->skip > 0) { trace->skip--; return; } if (trace->nr_entries < trace->max_entries) trace->entries[trace->nr_entries++] = addr; }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mundt3754.41%266.67%
Matt Fleming3145.59%133.33%
Total68100.00%3100.00%

static const struct stacktrace_ops save_stack_ops = { .stack = save_stack_stack, .address = save_stack_address, };
void save_stack_trace(struct stack_trace *trace) { unsigned long *sp = (unsigned long *)current_stack_pointer; unwind_stack(current, NULL, sp, &save_stack_ops, trace); if (trace->nr_entries < trace->max_entries) trace->entries[trace->nr_entries++] = ULONG_MAX; }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mundt4475.86%250.00%
Matt Fleming1424.14%250.00%
Total58100.00%4100.00%

EXPORT_SYMBOL_GPL(save_stack_trace);
static void save_stack_address_nosched(void *data, unsigned long addr, int reliable) { struct stack_trace *trace = (struct stack_trace *)data; if (!reliable) return; if (in_sched_functions(addr)) return; if (trace->skip > 0) { trace->skip--; return; } if (trace->nr_entries < trace->max_entries) trace->entries[trace->nr_entries++] = addr; }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mundt4454.32%266.67%
Matt Fleming3745.68%133.33%
Total81100.00%3100.00%

static const struct stacktrace_ops save_stack_ops_nosched = { .stack = save_stack_stack, .address = save_stack_address_nosched, };
void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace) { unsigned long *sp = (unsigned long *)tsk->thread.sp; unwind_stack(current, NULL, sp, &save_stack_ops_nosched, trace); if (trace->nr_entries < trace->max_entries) trace->entries[trace->nr_entries++] = ULONG_MAX; }

Contributors

PersonTokensPropCommitsCommitProp
Matt Fleming4161.19%250.00%
Paul Mundt2638.81%250.00%
Total67100.00%4100.00%

EXPORT_SYMBOL_GPL(save_stack_trace_tsk);

Overall Contributors

PersonTokensPropCommitsCommitProp
Matt Fleming18751.52%225.00%
Paul Mundt17046.83%450.00%
Heiko Carstens30.83%112.50%
Ingo Molnar30.83%112.50%
Total363100.00%8100.00%
Directory: arch/sh/kernel
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.