|
|
267c68 |
--- crash-7.0.2/kernel.c.orig
|
|
|
267c68 |
+++ crash-7.0.2/kernel.c
|
|
|
267c68 |
@@ -1,8 +1,8 @@
|
|
|
267c68 |
/* kernel.c - core analysis suite
|
|
|
267c68 |
*
|
|
|
267c68 |
* Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
|
|
|
267c68 |
- * Copyright (C) 2002-2013 David Anderson
|
|
|
267c68 |
- * Copyright (C) 2002-2013 Red Hat, Inc. All rights reserved.
|
|
|
267c68 |
+ * Copyright (C) 2002-2014 David Anderson
|
|
|
267c68 |
+ * Copyright (C) 2002-2014 Red Hat, Inc. All rights reserved.
|
|
|
267c68 |
*
|
|
|
267c68 |
* This program is free software; you can redistribute it and/or modify
|
|
|
267c68 |
* it under the terms of the GNU General Public License as published by
|
|
|
267c68 |
@@ -1994,7 +1994,10 @@ cmd_bt(void)
|
|
|
267c68 |
break;
|
|
|
267c68 |
|
|
|
267c68 |
case 'F':
|
|
|
267c68 |
- bt->flags |= (BT_FULL|BT_FULL_SYM_SLAB);
|
|
|
267c68 |
+ if (bt->flags & BT_FULL_SYM_SLAB)
|
|
|
267c68 |
+ bt->flags |= BT_FULL_SYM_SLAB2;
|
|
|
267c68 |
+ else
|
|
|
267c68 |
+ bt->flags |= (BT_FULL|BT_FULL_SYM_SLAB);
|
|
|
267c68 |
break;
|
|
|
267c68 |
|
|
|
267c68 |
case 'o':
|
|
|
267c68 |
--- crash-7.0.2/task.c.orig
|
|
|
267c68 |
+++ crash-7.0.2/task.c
|
|
|
267c68 |
@@ -5304,7 +5304,10 @@ cmd_foreach(void)
|
|
|
267c68 |
break;
|
|
|
267c68 |
|
|
|
267c68 |
case 'F':
|
|
|
267c68 |
- fd->flags |= FOREACH_F_FLAG;
|
|
|
267c68 |
+ if (fd->flags & FOREACH_F_FLAG)
|
|
|
267c68 |
+ fd->flags |= FOREACH_F_FLAG2;
|
|
|
267c68 |
+ else
|
|
|
267c68 |
+ fd->flags |= FOREACH_F_FLAG;
|
|
|
267c68 |
break;
|
|
|
267c68 |
|
|
|
267c68 |
case 'a':
|
|
|
267c68 |
@@ -5859,6 +5862,8 @@ foreach(struct foreach_data *fd)
|
|
|
267c68 |
bt->flags |= BT_FULL;
|
|
|
267c68 |
if (fd->flags & FOREACH_F_FLAG)
|
|
|
267c68 |
bt->flags |= (BT_FULL|BT_FULL_SYM_SLAB);
|
|
|
267c68 |
+ if (fd->flags & FOREACH_F_FLAG2)
|
|
|
267c68 |
+ bt->flags |= BT_FULL_SYM_SLAB2;
|
|
|
267c68 |
if (fd->flags & FOREACH_x_FLAG)
|
|
|
267c68 |
bt->radix = 16;
|
|
|
267c68 |
if (fd->flags & FOREACH_d_FLAG)
|
|
|
267c68 |
--- crash-7.0.2/help.c.orig
|
|
|
267c68 |
+++ crash-7.0.2/help.c
|
|
|
267c68 |
@@ -1,8 +1,8 @@
|
|
|
267c68 |
/* help.c - core analysis suite
|
|
|
267c68 |
*
|
|
|
267c68 |
* Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
|
|
|
267c68 |
- * Copyright (C) 2002-2013 David Anderson
|
|
|
267c68 |
- * Copyright (C) 2002-2013 Red Hat, Inc. All rights reserved.
|
|
|
267c68 |
+ * Copyright (C) 2002-2014 David Anderson
|
|
|
267c68 |
+ * Copyright (C) 2002-2014 Red Hat, Inc. All rights reserved.
|
|
|
267c68 |
*
|
|
|
267c68 |
* This program is free software; you can redistribute it and/or modify
|
|
|
267c68 |
* it under the terms of the GNU General Public License as published by
|
|
|
267c68 |
@@ -1553,9 +1553,12 @@ char *help_rd[] = {
|
|
|
267c68 |
" -d display output in signed decimal format (default is hexadecimal).",
|
|
|
267c68 |
" -D display output in unsigned decimal format (default is hexadecimal).",
|
|
|
267c68 |
" -s displays output symbolically when appropriate.",
|
|
|
267c68 |
-" -S displays output symbolically when appropriate; if the address",
|
|
|
267c68 |
-" references a slab cache object, the name of the slab cache will",
|
|
|
267c68 |
-" be displayed in brackets.",
|
|
|
267c68 |
+" -S[S] displays output symbolically when appropriate; if the memory",
|
|
|
267c68 |
+" contents reference a slab cache object, the name of the slab cache",
|
|
|
267c68 |
+" will be displayed in brackets. If -S is entered twice, and the",
|
|
|
267c68 |
+" memory contents reference a slab cache object, both the memory",
|
|
|
267c68 |
+" contents and the name of the slab cache will be displayed in",
|
|
|
267c68 |
+" brackets.",
|
|
|
267c68 |
" -x do not display ASCII translation at end of each line.",
|
|
|
267c68 |
#ifdef NOTDEF
|
|
|
267c68 |
" -o Shows offset value from the starting address.",
|
|
|
267c68 |
@@ -1593,36 +1596,39 @@ char *help_rd[] = {
|
|
|
267c68 |
"",
|
|
|
267c68 |
" Display the same block of memory, first without symbols, again",
|
|
|
267c68 |
" with symbols, and then with symbols and slab cache references:\n",
|
|
|
267c68 |
-" %s> rd dff12e80 36",
|
|
|
267c68 |
-" dff12e80: dff12e94 00000000 c05a363a dff12ed0 ........:6Z.....",
|
|
|
267c68 |
-" dff12e90: 00000001 dff12e98 0041fe3f ffffffff ........?.A.....",
|
|
|
267c68 |
-" dff12ea0: 00000001 d5147800 00000000 def8abc0 .....x..........",
|
|
|
267c68 |
-" dff12eb0: dff12ebc c05a4aa0 00000000 dff12ed0 .....JZ.........",
|
|
|
267c68 |
-" dff12ec0: 00000001 00000000 00000000 00000000 ................",
|
|
|
267c68 |
-" dff12ed0: 0808b353 00000000 dff12efc c0698220 S........... .i.",
|
|
|
267c68 |
-" dff12ee0: dff12efc df7c6480 00000001 c046f99b .....d|.......F.",
|
|
|
267c68 |
-" dff12ef0: 00000000 00000000 0808b352 dff12f68 ........R...h/..",
|
|
|
267c68 |
-" dff12f00: c155a128 00000000 00000001 ffffffff (.U.............",
|
|
|
267c68 |
-" %s> rd -s dff12e80 36",
|
|
|
267c68 |
-" dff12e80: dff12e94 00000000 sock_aio_write+83 dff12ed0 ",
|
|
|
267c68 |
-" dff12e90: 00000001 dff12e98 0041fe3f ffffffff ",
|
|
|
267c68 |
-" dff12ea0: 00000001 d5147800 00000000 def8abc0 ",
|
|
|
267c68 |
-" dff12eb0: dff12ebc sys_recvfrom+207 00000000 dff12ed0 ",
|
|
|
267c68 |
-" dff12ec0: 00000001 00000000 00000000 00000000 ",
|
|
|
267c68 |
-" dff12ed0: 0808b353 00000000 dff12efc socket_file_ops ",
|
|
|
267c68 |
-" dff12ee0: dff12efc df7c6480 00000001 do_sync_write+182 ",
|
|
|
267c68 |
-" dff12ef0: 00000000 00000000 0808b352 dff12f68 ",
|
|
|
267c68 |
-" dff12f00: c155a128 00000000 00000001 ffffffff ",
|
|
|
267c68 |
-" %s> rd -S dff12e80 36",
|
|
|
267c68 |
-" dff12e80: [size-4096] 00000000 sock_aio_write+83 [size-4096] ",
|
|
|
267c68 |
-" dff12e90: 00000001 [size-4096] 0041fe3f ffffffff ",
|
|
|
267c68 |
-" dff12ea0: 00000001 [sock_inode_cache] 00000000 [filp] ",
|
|
|
267c68 |
-" dff12eb0: [size-4096] sys_recvfrom+207 00000000 [size-4096] ",
|
|
|
267c68 |
-" dff12ec0: 00000001 00000000 00000000 00000000 ",
|
|
|
267c68 |
-" dff12ed0: 0808b353 00000000 [size-4096] socket_file_ops ",
|
|
|
267c68 |
-" dff12ee0: [size-4096] [filp] 00000001 do_sync_write+182 ",
|
|
|
267c68 |
-" dff12ef0: 00000000 00000000 0808b352 [size-4096] ",
|
|
|
267c68 |
-" dff12f00: [vm_area_struct] 00000000 00000001 ffffffff\n",
|
|
|
267c68 |
+" %s> rd f6e31f70 28",
|
|
|
267c68 |
+" f6e31f70: f6e31f6c f779c180 c04a4032 00a9dd40 l.....y.2@J.@...",
|
|
|
267c68 |
+" f6e31f80: 00000fff c0472da0 f6e31fa4 f779c180 .....-G.......y.",
|
|
|
267c68 |
+" f6e31f90: fffffff7 00a9b70f f6e31000 c04731ee .............1G.",
|
|
|
267c68 |
+" f6e31fa0: f6e31fa4 00000000 00000000 00000000 ................",
|
|
|
267c68 |
+" f6e31fb0: 00000000 00a9dd40 c0404f17 00000000 ....@....O@.....",
|
|
|
267c68 |
+" f6e31fc0: 00a9dd40 00000fff 00a9dd40 00a9b70f @.......@.......",
|
|
|
267c68 |
+" f6e31fd0: bf9e2718 ffffffda c040007b 0000007b .'......{.@.{...",
|
|
|
267c68 |
+" %s> rd -s f6e31f70 28",
|
|
|
267c68 |
+" f6e31f70: f6e31f6c f779c180 kmsg_read 00a9dd40 ",
|
|
|
267c68 |
+" f6e31f80: 00000fff vfs_read+159 f6e31fa4 f779c180 ",
|
|
|
267c68 |
+" f6e31f90: fffffff7 00a9b70f f6e31000 sys_read+60 ",
|
|
|
267c68 |
+" f6e31fa0: f6e31fa4 00000000 00000000 00000000 ",
|
|
|
267c68 |
+" f6e31fb0: 00000000 00a9dd40 syscall_call+7 00000000 ",
|
|
|
267c68 |
+" f6e31fc0: 00a9dd40 00000fff 00a9dd40 00a9b70f ",
|
|
|
267c68 |
+" f6e31fd0: bf9e2718 ffffffda startup_32+123 0000007b ",
|
|
|
267c68 |
+" %s> rd -S f6e31f70 28",
|
|
|
267c68 |
+" f6e31f70: [size-4096] [filp] kmsg_read 00a9dd40 ",
|
|
|
267c68 |
+" f6e31f80: 00000fff vfs_read+159 [size-4096] [filp] ",
|
|
|
267c68 |
+" f6e31f90: fffffff7 00a9b70f [size-4096] sys_read+60 ",
|
|
|
267c68 |
+" f6e31fa0: [size-4096] 00000000 00000000 00000000 ",
|
|
|
267c68 |
+" f6e31fb0: 00000000 00a9dd40 syscall_call+7 00000000 ",
|
|
|
267c68 |
+" f6e31fc0: 00a9dd40 00000fff 00a9dd40 00a9b70f ",
|
|
|
267c68 |
+" f6e31fd0: bf9e2718 ffffffda startup_32+123 0000007b ",
|
|
|
267c68 |
+" %s> rd -SS f6e31f70 28",
|
|
|
267c68 |
+" f6e31f70: [f6e31f6c:size-4096] [f779c180:filp] kmsg_read 00a9dd40 ",
|
|
|
267c68 |
+" f6e31f80: 00000fff vfs_read+159 [f6e31fa4:size-4096] [f779c180:filp] ",
|
|
|
267c68 |
+" f6e31f90: fffffff7 00a9b70f [f6e31000:size-4096] sys_read+60 ",
|
|
|
267c68 |
+" f6e31fa0: [f6e31fa4:size-4096] 00000000 00000000 00000000 ",
|
|
|
267c68 |
+" f6e31fb0: 00000000 00a9dd40 syscall_call+7 00000000 ",
|
|
|
267c68 |
+" f6e31fc0: 00a9dd40 00000fff 00a9dd40 00a9b70f ",
|
|
|
267c68 |
+" f6e31fd0: bf9e2718 ffffffda startup_32+123 0000007b ",
|
|
|
267c68 |
+"",
|
|
|
267c68 |
" Read jiffies in hexadecimal and decimal format:\n",
|
|
|
267c68 |
" %s> rd jiffies",
|
|
|
267c68 |
" c0213ae0: 0008cc3a :...\n",
|
|
|
267c68 |
@@ -1706,10 +1712,13 @@ char *help_bt[] = {
|
|
|
267c68 |
" -f display all stack data contained in a frame; this option can be",
|
|
|
267c68 |
" used to determine the arguments passed to each function; on ia64,",
|
|
|
267c68 |
" the argument register contents are dumped.",
|
|
|
267c68 |
-" -F similar to -f, except that the stack data is displayed symbolically",
|
|
|
267c68 |
+" -F[F] similar to -f, except that the stack data is displayed symbolically",
|
|
|
267c68 |
" when appropriate; if the stack data references a slab cache object,",
|
|
|
267c68 |
" the name of the slab cache will be displayed in brackets; on ia64,",
|
|
|
267c68 |
-" the substitution is done to the argument register contents.",
|
|
|
267c68 |
+" the substitution is done to the argument register contents. If -F",
|
|
|
267c68 |
+" is entered twice, and the stack data references a slab cache object,",
|
|
|
267c68 |
+" both the address and the name of the slab cache will be displayed",
|
|
|
267c68 |
+" in brackets.",
|
|
|
267c68 |
" -o x86: use old backtrace method, permissible only on kernels that were",
|
|
|
267c68 |
" compiled without the -fomit-frame_pointer.",
|
|
|
267c68 |
" x86_64: use old backtrace method, which dumps potentially stale",
|
|
|
267c68 |
@@ -1937,6 +1946,34 @@ char *help_bt[] = {
|
|
|
267c68 |
" R10: 0000000000000000 R11: 0000000000000202 R12: ffff88007ac97300",
|
|
|
267c68 |
" R13: 0000000000000000 R14: 00007f571e104a80 R15: 00007f571e305048",
|
|
|
267c68 |
" ORIG_RAX: 0000000000000029 CS: 0033 SS: 002b",
|
|
|
267c68 |
+"",
|
|
|
267c68 |
+" The following three examples show the difference in the display of",
|
|
|
267c68 |
+" the same stack frame's contents using -f, -F, and -FF:",
|
|
|
267c68 |
+" ",
|
|
|
267c68 |
+" %s> bf -f",
|
|
|
267c68 |
+" ...",
|
|
|
267c68 |
+" #4 [ffff810072b47f10] vfs_write at ffffffff800789d8",
|
|
|
267c68 |
+" ffff810072b47f18: ffff81007e020380 ffff81007e2c2880 ",
|
|
|
267c68 |
+" ffff810072b47f28: 0000000000000002 fffffffffffffff7 ",
|
|
|
267c68 |
+" ffff810072b47f38: 00002b141825d000 ffffffff80078f75 ",
|
|
|
267c68 |
+" #5 [ffff810072b47f40] sys_write at ffffffff80078f75",
|
|
|
267c68 |
+" ...",
|
|
|
267c68 |
+" %s> bt -F",
|
|
|
267c68 |
+" ...",
|
|
|
267c68 |
+" #4 [ffff810072b47f10] vfs_write at ffffffff800789d8",
|
|
|
267c68 |
+" ffff810072b47f18: [files_cache] [filp] ",
|
|
|
267c68 |
+" ffff810072b47f28: 0000000000000002 fffffffffffffff7 ",
|
|
|
267c68 |
+" ffff810072b47f38: 00002b141825d000 sys_write+69 ",
|
|
|
267c68 |
+" #5 [ffff810072b47f40] sys_write at ffffffff80078f75",
|
|
|
267c68 |
+" ...",
|
|
|
267c68 |
+" %s> bf -FF",
|
|
|
267c68 |
+" ...",
|
|
|
267c68 |
+" #4 [ffff810072b47f10] vfs_write at ffffffff800789d8",
|
|
|
267c68 |
+" ffff810072b47f18: [ffff81007e020380:files_cache] [ffff81007e2c2880:filp]",
|
|
|
267c68 |
+" ffff810072b47f28: 0000000000000002 fffffffffffffff7 ",
|
|
|
267c68 |
+" ffff810072b47f38: 00002b141825d000 sys_write+69 ",
|
|
|
267c68 |
+" #5 [ffff810072b47f40] sys_write at ffffffff80078f75",
|
|
|
267c68 |
+" ...",
|
|
|
267c68 |
NULL
|
|
|
267c68 |
};
|
|
|
267c68 |
|
|
|
267c68 |
--- crash-7.0.2/cmdline.c.orig
|
|
|
267c68 |
+++ crash-7.0.2/cmdline.c
|
|
|
267c68 |
@@ -1,8 +1,8 @@
|
|
|
267c68 |
/* cmdline.c - core analysis suite
|
|
|
267c68 |
*
|
|
|
267c68 |
* Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
|
|
|
267c68 |
- * Copyright (C) 2002-2013 David Anderson
|
|
|
267c68 |
- * Copyright (C) 2002-2013 Red Hat, Inc. All rights reserved.
|
|
|
267c68 |
+ * Copyright (C) 2002-2014 David Anderson
|
|
|
267c68 |
+ * Copyright (C) 2002-2014 Red Hat, Inc. All rights reserved.
|
|
|
267c68 |
*
|
|
|
267c68 |
* This program is free software; you can redistribute it and/or modify
|
|
|
267c68 |
* it under the terms of the GNU General Public License as published by
|
|
|
267c68 |
@@ -1405,6 +1405,9 @@ exec_input_file(void)
|
|
|
267c68 |
}
|
|
|
267c68 |
|
|
|
267c68 |
exec_command();
|
|
|
267c68 |
+
|
|
|
267c68 |
+ if (received_SIGINT())
|
|
|
267c68 |
+ goto done_input;
|
|
|
267c68 |
}
|
|
|
267c68 |
|
|
|
267c68 |
done_input:
|
|
|
267c68 |
@@ -2501,6 +2504,9 @@ exec_args_input_file(struct command_tabl
|
|
|
267c68 |
pc->cmd_cleanup(pc->cmd_cleanup_arg);
|
|
|
267c68 |
|
|
|
267c68 |
free_all_bufs();
|
|
|
267c68 |
+
|
|
|
267c68 |
+ if (received_SIGINT())
|
|
|
267c68 |
+ break;
|
|
|
267c68 |
}
|
|
|
267c68 |
|
|
|
267c68 |
fclose(pc->args_ifile);
|
|
|
267c68 |
--- crash-7.0.2/defs.h.orig
|
|
|
267c68 |
+++ crash-7.0.2/defs.h
|
|
|
267c68 |
@@ -1,8 +1,8 @@
|
|
|
267c68 |
/* defs.h - core analysis suite
|
|
|
267c68 |
*
|
|
|
267c68 |
* Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
|
|
|
267c68 |
- * Copyright (C) 2002-2013 David Anderson
|
|
|
267c68 |
- * Copyright (C) 2002-2013 Red Hat, Inc. All rights reserved.
|
|
|
267c68 |
+ * Copyright (C) 2002-2014 David Anderson
|
|
|
267c68 |
+ * Copyright (C) 2002-2014 Red Hat, Inc. All rights reserved.
|
|
|
267c68 |
* Copyright (C) 2002 Silicon Graphics, Inc.
|
|
|
267c68 |
*
|
|
|
267c68 |
* This program is free software; you can redistribute it and/or modify
|
|
|
267c68 |
@@ -1043,34 +1043,35 @@ extern struct machdep_table *machdep;
|
|
|
267c68 |
#define MAX_FOREACH_ARGS (50)
|
|
|
267c68 |
#define MAX_REGEX_ARGS (10)
|
|
|
267c68 |
|
|
|
267c68 |
-#define FOREACH_CMD (0x1)
|
|
|
267c68 |
-#define FOREACH_r_FLAG (0x2)
|
|
|
267c68 |
-#define FOREACH_s_FLAG (0x4)
|
|
|
267c68 |
-#define FOREACH_S_FLAG (0x8)
|
|
|
267c68 |
-#define FOREACH_i_FLAG (0x10)
|
|
|
267c68 |
-#define FOREACH_e_FLAG (0x20)
|
|
|
267c68 |
-#define FOREACH_g_FLAG (0x40)
|
|
|
267c68 |
-#define FOREACH_l_FLAG (0x80)
|
|
|
267c68 |
-#define FOREACH_p_FLAG (0x100)
|
|
|
267c68 |
-#define FOREACH_t_FLAG (0x200)
|
|
|
267c68 |
-#define FOREACH_u_FLAG (0x400)
|
|
|
267c68 |
-#define FOREACH_m_FLAG (0x800)
|
|
|
267c68 |
-#define FOREACH_v_FLAG (0x1000)
|
|
|
267c68 |
-#define FOREACH_KERNEL (0x2000)
|
|
|
267c68 |
-#define FOREACH_USER (0x4000)
|
|
|
267c68 |
-#define FOREACH_SPECIFIED (0x8000)
|
|
|
267c68 |
-#define FOREACH_ACTIVE (0x10000)
|
|
|
267c68 |
-#define FOREACH_k_FLAG (0x20000)
|
|
|
267c68 |
-#define FOREACH_c_FLAG (0x40000)
|
|
|
267c68 |
-#define FOREACH_f_FLAG (0x80000)
|
|
|
267c68 |
-#define FOREACH_o_FLAG (0x100000)
|
|
|
267c68 |
-#define FOREACH_T_FLAG (0x200000)
|
|
|
267c68 |
-#define FOREACH_F_FLAG (0x400000)
|
|
|
267c68 |
-#define FOREACH_x_FLAG (0x800000)
|
|
|
267c68 |
-#define FOREACH_d_FLAG (0x1000000)
|
|
|
267c68 |
-#define FOREACH_STATE (0x2000000)
|
|
|
267c68 |
-#define FOREACH_a_FLAG (0x4000000)
|
|
|
267c68 |
-#define FOREACH_G_FLAG (0x8000000)
|
|
|
267c68 |
+#define FOREACH_CMD (0x1)
|
|
|
267c68 |
+#define FOREACH_r_FLAG (0x2)
|
|
|
267c68 |
+#define FOREACH_s_FLAG (0x4)
|
|
|
267c68 |
+#define FOREACH_S_FLAG (0x8)
|
|
|
267c68 |
+#define FOREACH_i_FLAG (0x10)
|
|
|
267c68 |
+#define FOREACH_e_FLAG (0x20)
|
|
|
267c68 |
+#define FOREACH_g_FLAG (0x40)
|
|
|
267c68 |
+#define FOREACH_l_FLAG (0x80)
|
|
|
267c68 |
+#define FOREACH_p_FLAG (0x100)
|
|
|
267c68 |
+#define FOREACH_t_FLAG (0x200)
|
|
|
267c68 |
+#define FOREACH_u_FLAG (0x400)
|
|
|
267c68 |
+#define FOREACH_m_FLAG (0x800)
|
|
|
267c68 |
+#define FOREACH_v_FLAG (0x1000)
|
|
|
267c68 |
+#define FOREACH_KERNEL (0x2000)
|
|
|
267c68 |
+#define FOREACH_USER (0x4000)
|
|
|
267c68 |
+#define FOREACH_SPECIFIED (0x8000)
|
|
|
267c68 |
+#define FOREACH_ACTIVE (0x10000)
|
|
|
267c68 |
+#define FOREACH_k_FLAG (0x20000)
|
|
|
267c68 |
+#define FOREACH_c_FLAG (0x40000)
|
|
|
267c68 |
+#define FOREACH_f_FLAG (0x80000)
|
|
|
267c68 |
+#define FOREACH_o_FLAG (0x100000)
|
|
|
267c68 |
+#define FOREACH_T_FLAG (0x200000)
|
|
|
267c68 |
+#define FOREACH_F_FLAG (0x400000)
|
|
|
267c68 |
+#define FOREACH_x_FLAG (0x800000)
|
|
|
267c68 |
+#define FOREACH_d_FLAG (0x1000000)
|
|
|
267c68 |
+#define FOREACH_STATE (0x2000000)
|
|
|
267c68 |
+#define FOREACH_a_FLAG (0x4000000)
|
|
|
267c68 |
+#define FOREACH_G_FLAG (0x8000000)
|
|
|
267c68 |
+#define FOREACH_F_FLAG2 (0x10000000)
|
|
|
267c68 |
|
|
|
267c68 |
#define FOREACH_PS_EXCLUSIVE \
|
|
|
267c68 |
(FOREACH_g_FLAG|FOREACH_a_FLAG|FOREACH_t_FLAG|FOREACH_c_FLAG|FOREACH_p_FLAG|FOREACH_l_FLAG|FOREACH_r_FLAG)
|
|
|
267c68 |
@@ -4817,6 +4818,8 @@ ulong cpu_map_addr(const char *type);
|
|
|
267c68 |
#define BT_KDUMP_ELF_REGS (0x80000000000ULL)
|
|
|
267c68 |
#define BT_USER_SPACE (0x100000000000ULL)
|
|
|
267c68 |
#define BT_KERNEL_SPACE (0x200000000000ULL)
|
|
|
267c68 |
+#define BT_FULL_SYM_SLAB2 (0x400000000000ULL)
|
|
|
267c68 |
+#define BT_EFRAME_TARGET (0x800000000000ULL)
|
|
|
267c68 |
#define BT_SYMBOL_OFFSET (BT_SYMBOLIC_ARGS)
|
|
|
267c68 |
|
|
|
267c68 |
#define BT_REF_HEXVAL (0x1)
|
|
|
267c68 |
--- crash-7.0.2/x86_64.c.orig
|
|
|
267c68 |
+++ crash-7.0.2/x86_64.c
|
|
|
267c68 |
@@ -1,7 +1,7 @@
|
|
|
267c68 |
/* x86_64.c -- core analysis suite
|
|
|
267c68 |
*
|
|
|
267c68 |
- * Copyright (C) 2004-2013 David Anderson
|
|
|
267c68 |
- * Copyright (C) 2004-2013 Red Hat, Inc. All rights reserved.
|
|
|
267c68 |
+ * Copyright (C) 2004-2014 David Anderson
|
|
|
267c68 |
+ * Copyright (C) 2004-2014 Red Hat, Inc. All rights reserved.
|
|
|
267c68 |
*
|
|
|
267c68 |
* This program is free software; you can redistribute it and/or modify
|
|
|
267c68 |
* it under the terms of the GNU General Public License as published by
|
|
|
267c68 |
@@ -107,6 +107,7 @@ static ulong x86_64_get_stacktop_hyper(u
|
|
|
267c68 |
static int x86_64_framesize_cache_resize(void);
|
|
|
267c68 |
static int x86_64_framesize_cache_func(int, ulong, int *, int);
|
|
|
267c68 |
static ulong x86_64_get_framepointer(struct bt_info *, ulong);
|
|
|
267c68 |
+int search_for_eframe_target_caller(struct bt_info *, ulong, int *);
|
|
|
267c68 |
static int x86_64_get_framesize(struct bt_info *, ulong, ulong);
|
|
|
267c68 |
static void x86_64_framesize_debug(struct bt_info *);
|
|
|
267c68 |
static void x86_64_get_active_set(void);
|
|
|
267c68 |
@@ -3279,9 +3280,11 @@ in_exception_stack:
|
|
|
267c68 |
level++;
|
|
|
267c68 |
rsp += SIZE(pt_regs);
|
|
|
267c68 |
irq_eframe = 0;
|
|
|
267c68 |
+ bt->flags |= BT_EFRAME_TARGET;
|
|
|
267c68 |
if (bt->eframe_ip && ((framesize = x86_64_get_framesize(bt,
|
|
|
267c68 |
bt->eframe_ip, rsp)) >= 0))
|
|
|
267c68 |
rsp += framesize;
|
|
|
267c68 |
+ bt->flags &= ~BT_EFRAME_TARGET;
|
|
|
267c68 |
}
|
|
|
267c68 |
level++;
|
|
|
267c68 |
}
|
|
|
267c68 |
@@ -4111,6 +4114,8 @@ x86_64_eframe_verify(struct bt_info *bt,
|
|
|
267c68 |
long rip, long rsp, long rflags)
|
|
|
267c68 |
{
|
|
|
267c68 |
int estack;
|
|
|
267c68 |
+ struct syment *sp;
|
|
|
267c68 |
+ ulong offset, exception;
|
|
|
267c68 |
|
|
|
267c68 |
if ((rflags & RAZ_MASK) || !(rflags & 0x2))
|
|
|
267c68 |
return FALSE;
|
|
|
267c68 |
@@ -4144,7 +4149,18 @@ x86_64_eframe_verify(struct bt_info *bt,
|
|
|
267c68 |
*/
|
|
|
267c68 |
if (STREQ(closest_symbol(rip), "ia32_sysenter_target"))
|
|
|
267c68 |
return TRUE;
|
|
|
267c68 |
- }
|
|
|
267c68 |
+
|
|
|
267c68 |
+ if ((rip == 0) && INSTACK(rsp, bt) &&
|
|
|
267c68 |
+ STREQ(bt->call_target, "ret_from_fork"))
|
|
|
267c68 |
+ return TRUE;
|
|
|
267c68 |
+
|
|
|
267c68 |
+ if (readmem(kvaddr - 8, KVADDR, &exception, sizeof(ulong),
|
|
|
267c68 |
+ "exception type", RETURN_ON_ERROR|QUIET) &&
|
|
|
267c68 |
+ (sp = value_search(exception, &offset)) &&
|
|
|
267c68 |
+ STREQ(sp->name, "page_fault"))
|
|
|
267c68 |
+ return TRUE;
|
|
|
267c68 |
+
|
|
|
267c68 |
+ }
|
|
|
267c68 |
|
|
|
267c68 |
if ((cs == 0x10) && kvaddr) {
|
|
|
267c68 |
if (is_kernel_text(rip) && IS_KVADDR(rsp) &&
|
|
|
267c68 |
@@ -7157,6 +7173,57 @@ x86_64_get_framepointer(struct bt_info *
|
|
|
267c68 |
return framepointer;
|
|
|
267c68 |
}
|
|
|
267c68 |
|
|
|
267c68 |
+int
|
|
|
267c68 |
+search_for_eframe_target_caller(struct bt_info *bt, ulong stkptr, int *framesize)
|
|
|
267c68 |
+{
|
|
|
267c68 |
+ int i;
|
|
|
267c68 |
+ ulong *up, offset, rsp;
|
|
|
267c68 |
+ struct syment *sp1, *sp2;
|
|
|
267c68 |
+ char *called_function;
|
|
|
267c68 |
+
|
|
|
267c68 |
+ if ((sp1 = value_search(bt->eframe_ip, &offset)))
|
|
|
267c68 |
+ called_function = sp1->name;
|
|
|
267c68 |
+ else
|
|
|
267c68 |
+ return FALSE;
|
|
|
267c68 |
+
|
|
|
267c68 |
+ rsp = stkptr;
|
|
|
267c68 |
+
|
|
|
267c68 |
+ for (i = (rsp - bt->stackbase)/sizeof(ulong);
|
|
|
267c68 |
+ rsp < bt->stacktop; i++, rsp += sizeof(ulong)) {
|
|
|
267c68 |
+
|
|
|
267c68 |
+ up = (ulong *)(&bt->stackbuf[i*sizeof(ulong)]);
|
|
|
267c68 |
+
|
|
|
267c68 |
+ if (!is_kernel_text(*up))
|
|
|
267c68 |
+ continue;
|
|
|
267c68 |
+
|
|
|
267c68 |
+ if (!(sp1 = value_search(*up, &offset)))
|
|
|
267c68 |
+ continue;
|
|
|
267c68 |
+
|
|
|
267c68 |
+ if (!offset && !(bt->flags & BT_FRAMESIZE_DISABLE))
|
|
|
267c68 |
+ continue;
|
|
|
267c68 |
+
|
|
|
267c68 |
+ /*
|
|
|
267c68 |
+ * Get the syment of the function that the text
|
|
|
267c68 |
+ * routine above called before leaving its return
|
|
|
267c68 |
+ * address on the stack -- if it can be determined.
|
|
|
267c68 |
+ */
|
|
|
267c68 |
+ if ((sp2 = x86_64_function_called_by((*up)-5))) {
|
|
|
267c68 |
+ if (STREQ(sp2->name, called_function)) {
|
|
|
267c68 |
+ if (CRASHDEBUG(1)) {
|
|
|
267c68 |
+ fprintf(fp,
|
|
|
267c68 |
+ "< %lx/%s rsp: %lx caller: %s >\n",
|
|
|
267c68 |
+ bt->eframe_ip, called_function,
|
|
|
267c68 |
+ stkptr, sp1->name);
|
|
|
267c68 |
+ }
|
|
|
267c68 |
+ *framesize = rsp - stkptr;
|
|
|
267c68 |
+ return TRUE;
|
|
|
267c68 |
+ }
|
|
|
267c68 |
+ }
|
|
|
267c68 |
+ }
|
|
|
267c68 |
+
|
|
|
267c68 |
+ return FALSE;
|
|
|
267c68 |
+}
|
|
|
267c68 |
+
|
|
|
267c68 |
#define BT_FRAMESIZE_IGNORE_MASK \
|
|
|
267c68 |
(BT_OLD_BACK_TRACE|BT_TEXT_SYMBOLS|BT_TEXT_SYMBOLS_ALL|BT_FRAMESIZE_DISABLE)
|
|
|
267c68 |
|
|
|
267c68 |
@@ -7190,6 +7257,10 @@ x86_64_get_framesize(struct bt_info *bt,
|
|
|
267c68 |
|
|
|
267c68 |
exception = bt->eframe_ip == textaddr ? TRUE : FALSE;
|
|
|
267c68 |
|
|
|
267c68 |
+ if ((bt->flags & BT_EFRAME_TARGET) &&
|
|
|
267c68 |
+ search_for_eframe_target_caller(bt, rsp, &framesize))
|
|
|
267c68 |
+ return framesize;
|
|
|
267c68 |
+
|
|
|
267c68 |
if (!(bt->flags & BT_FRAMESIZE_DEBUG) &&
|
|
|
267c68 |
x86_64_framesize_cache_func(FRAMESIZE_QUERY, textaddr, &framesize,
|
|
|
267c68 |
exception)) {
|
|
|
267c68 |
--- crash-7.0.2/memory.c.orig
|
|
|
267c68 |
+++ crash-7.0.2/memory.c
|
|
|
267c68 |
@@ -288,6 +288,7 @@ static ulong kmem_cache_nodelists(ulong)
|
|
|
267c68 |
#define NET_ENDIAN (0x4000)
|
|
|
267c68 |
#define DISPLAY_RAW (0x8000)
|
|
|
267c68 |
#define NO_ERROR (0x10000)
|
|
|
267c68 |
+#define SLAB_CACHE2 (0x20000)
|
|
|
267c68 |
#define DISPLAY_TYPES (DISPLAY_RAW|DISPLAY_ASCII|DISPLAY_8|\
|
|
|
267c68 |
DISPLAY_16|DISPLAY_32|DISPLAY_64)
|
|
|
267c68 |
|
|
|
267c68 |
@@ -1147,8 +1148,12 @@ cmd_rd(void)
|
|
|
267c68 |
case 'S':
|
|
|
267c68 |
if (flag & DISPLAY_DEFAULT) {
|
|
|
267c68 |
flag |= SYMBOLIC;
|
|
|
267c68 |
- if (c == 'S')
|
|
|
267c68 |
- flag |= SLAB_CACHE;
|
|
|
267c68 |
+ if (c == 'S') {
|
|
|
267c68 |
+ if (flag & SLAB_CACHE)
|
|
|
267c68 |
+ flag |= SLAB_CACHE2;
|
|
|
267c68 |
+ else
|
|
|
267c68 |
+ flag |= SLAB_CACHE;
|
|
|
267c68 |
+ }
|
|
|
267c68 |
} else {
|
|
|
267c68 |
error(INFO, "-%c option"
|
|
|
267c68 |
" is only allowed with %d-bit display\n",
|
|
|
267c68 |
@@ -1475,7 +1480,7 @@ display_memory(ulonglong addr, long coun
|
|
|
267c68 |
if ((flag & SLAB_CACHE) &&
|
|
|
267c68 |
vaddr_to_kmem_cache(mem.u64, slab,
|
|
|
267c68 |
!VERBOSE)) {
|
|
|
267c68 |
- if (CRASHDEBUG(1))
|
|
|
267c68 |
+ if ((flag & SLAB_CACHE2) || CRASHDEBUG(1))
|
|
|
267c68 |
sprintf(buf, "[%llx:%s]",
|
|
|
267c68 |
(ulonglong)mem.u64,
|
|
|
267c68 |
slab);
|
|
|
267c68 |
@@ -1512,7 +1517,7 @@ display_memory(ulonglong addr, long coun
|
|
|
267c68 |
if ((flag & SLAB_CACHE) &&
|
|
|
267c68 |
vaddr_to_kmem_cache(mem.u32, slab,
|
|
|
267c68 |
!VERBOSE)) {
|
|
|
267c68 |
- if (CRASHDEBUG(1))
|
|
|
267c68 |
+ if ((flag & SLAB_CACHE2) || CRASHDEBUG(1))
|
|
|
267c68 |
sprintf(buf, "[%x:%s]",
|
|
|
267c68 |
mem.u32, slab);
|
|
|
267c68 |
else
|
|
|
267c68 |
@@ -1854,7 +1859,7 @@ format_stack_entry(struct bt_info *bt, c
|
|
|
267c68 |
sprintf(retbuf, INT_PRLEN == 16 ?
|
|
|
267c68 |
"%-16s" : "%-8s", buf);
|
|
|
267c68 |
else if (vaddr_to_kmem_cache(value, slab, !VERBOSE)) {
|
|
|
267c68 |
- if (CRASHDEBUG(1))
|
|
|
267c68 |
+ if ((bt->flags & BT_FULL_SYM_SLAB2) || CRASHDEBUG(1))
|
|
|
267c68 |
sprintf(buf, "[%lx:%s]", value, slab);
|
|
|
267c68 |
else
|
|
|
267c68 |
sprintf(buf, "[%s]", slab);
|
|
|
267c68 |
@@ -1871,7 +1876,7 @@ format_stack_entry(struct bt_info *bt, c
|
|
|
267c68 |
strlen(value_to_symstr(value, buf, 0)))
|
|
|
267c68 |
sprintf(retbuf, "%-16s", buf);
|
|
|
267c68 |
else if (vaddr_to_kmem_cache(value, slab, !VERBOSE)) {
|
|
|
267c68 |
- if (CRASHDEBUG(1))
|
|
|
267c68 |
+ if ((bt->flags & BT_FULL_SYM_SLAB2) || CRASHDEBUG(1))
|
|
|
267c68 |
sprintf(buf, "[%lx:%s]", value, slab);
|
|
|
267c68 |
else
|
|
|
267c68 |
sprintf(buf, "[%s]", slab);
|