stacktrace.c

来自「linux 内核源代码」· C语言 代码 · 共 37 行

C
37
字号
/* * arch/sh/kernel/stacktrace.c * * Stack trace management functions * *  Copyright (C) 2006  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/stacktrace.h>#include <linux/thread_info.h>#include <asm/ptrace.h>/* * Save stack-backtrace addresses into a stack_trace buffer. */void save_stack_trace(struct stack_trace *trace){	unsigned long *sp = (unsigned long *)current_stack_pointer;	while (!kstack_end(sp)) {		unsigned long addr = *sp++;		if (__kernel_text_address(addr)) {			if (trace->skip > 0)				trace->skip--;			else				trace->entries[trace->nr_entries++] = addr;			if (trace->nr_entries >= trace->max_entries)				break;		}	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?