blob: 903ad91b624f29eabcb53faa7bc9a528e0af0129 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Copyright 2003 PathScale, Inc.
3 *
4 * Licensed under the GPL
5 */
6
Jeff Dike95906b22008-02-04 22:31:20 -08007#include <linux/kernel.h>
8#include <linux/module.h>
9#include <linux/sched.h>
Ingo Molnarb17b0152017-02-08 18:51:35 +010010#include <linux/sched/debug.h>
Jeff Dike95906b22008-02-04 22:31:20 -080011#include <linux/utsname.h>
12#include <asm/current.h>
13#include <asm/ptrace.h>
Al Viro382d95f2012-10-08 03:26:54 +010014#include <asm/sysrq.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015
Richard Weinberger9d1ee8c2013-09-23 17:38:01 +020016void show_regs(struct pt_regs *regs)
Linus Torvalds1da177e2005-04-16 15:20:36 -070017{
18 printk("\n");
19 print_modules();
Jeff Dike95906b22008-02-04 22:31:20 -080020 printk(KERN_INFO "Pid: %d, comm: %.20s %s %s\n", task_pid_nr(current),
Alexey Dobriyan19c58702007-10-18 23:40:41 -070021 current->comm, print_tainted(), init_utsname()->release);
Jeff Dike95906b22008-02-04 22:31:20 -080022 printk(KERN_INFO "RIP: %04lx:[<%016lx>]\n", PT_REGS_CS(regs) & 0xffff,
Al Viro243412b2012-05-20 00:05:58 -040023 PT_REGS_IP(regs));
Al Virof67aa2f2011-08-18 20:10:39 +010024 printk(KERN_INFO "RSP: %016lx EFLAGS: %08lx\n", PT_REGS_SP(regs),
Linus Torvalds1da177e2005-04-16 15:20:36 -070025 PT_REGS_EFLAGS(regs));
Jeff Dike95906b22008-02-04 22:31:20 -080026 printk(KERN_INFO "RAX: %016lx RBX: %016lx RCX: %016lx\n",
Al Viro243412b2012-05-20 00:05:58 -040027 PT_REGS_AX(regs), PT_REGS_BX(regs), PT_REGS_CX(regs));
Jeff Dike95906b22008-02-04 22:31:20 -080028 printk(KERN_INFO "RDX: %016lx RSI: %016lx RDI: %016lx\n",
Al Viro243412b2012-05-20 00:05:58 -040029 PT_REGS_DX(regs), PT_REGS_SI(regs), PT_REGS_DI(regs));
Jeff Dike95906b22008-02-04 22:31:20 -080030 printk(KERN_INFO "RBP: %016lx R08: %016lx R09: %016lx\n",
Al Viro243412b2012-05-20 00:05:58 -040031 PT_REGS_BP(regs), PT_REGS_R8(regs), PT_REGS_R9(regs));
Jeff Dike95906b22008-02-04 22:31:20 -080032 printk(KERN_INFO "R10: %016lx R11: %016lx R12: %016lx\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -070033 PT_REGS_R10(regs), PT_REGS_R11(regs), PT_REGS_R12(regs));
Jeff Dike95906b22008-02-04 22:31:20 -080034 printk(KERN_INFO "R13: %016lx R14: %016lx R15: %016lx\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -070035 PT_REGS_R13(regs), PT_REGS_R14(regs), PT_REGS_R15(regs));
36}