--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
03-23-2011, 12:57 PM
Steven Rostedt
crash-trace-command: Update crash to handle new bprintk format structure
The bprintk format structure may change in the near future. Update the
reading of the structure to comply with the change.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Index: crash-5.1.3/extensions/trace.c
================================================== =================
--- crash-5.1.3.orig/extensions/trace.c
+++ crash-5.1.3/extensions/trace.c
@@ -3383,6 +3383,7 @@ static int save_ftrace_printk(int fd)
long bprintk_fmt_s, bprintk_fmt_e;
long *address;
size_t i, count;
+ int addr_is_array = 0;
s = symbol_search("__start___trace_bprintk_fmt");
e = symbol_search("__stop___trace_bprintk_fmt");
@@ -3422,6 +3423,16 @@ static int save_ftrace_printk(int fd)
if (!b)
goto out;
+ switch (MEMBER_TYPE("trace_bprintk_fmt", "fmt")) {
+ case TYPE_CODE_ARRAY:
+ addr_is_array = 1;
+ break;
+ case TYPE_CODE_PTR:
+ default:
+ /* default not array */
+ break;
+ }
+
mod_fmt = (struct kernel_list_head *)GETBUF(SIZE(list_head));
if (!readmem(b->value, KVADDR, mod_fmt,
SIZE(list_head), "trace_bprintk_fmt_list contents",
@@ -3432,6 +3443,12 @@ static int save_ftrace_printk(int fd)
unsigned long addr;