Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Crash Utility (http://www.linux-archive.org/crash-utility/)
-   -   crash-trace-command: support old kernel that has no print_fmt (http://www.linux-archive.org/crash-utility/480409-crash-trace-command-support-old-kernel-has-no-print_fmt.html)

Lai Jiangshan 01-24-2011 08:35 AM

crash-trace-command: support old kernel that has no print_fmt
 
very old kernel has no print_fmt field, use "Unknown print_fmt"
instead.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/extensions/trace.c b/extensions/trace.c
index e04c504..714765e 100755
--- a/extensions/trace.c
+++ b/extensions/trace.c
@@ -1080,8 +1080,10 @@ int ftrace_get_event_type_print_fmt(ulong call, char **print_fmt)
fmt_offset = MEMBER_OFFSET("ftrace_event_call", "print_fmt");
}

- if (fmt_offset < 0)
- return -1;
+ if (fmt_offset < 0) {
+ *print_fmt = strdup("Unknown print_fmt");
+ return 0;
+ }

if (!readmem(call + fmt_offset, KVADDR, &fmt_addr, sizeof(fmt_addr),
"read ftrace_event_call fmt_addr", RETURN_ON_ERROR))

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility


All times are GMT. The time now is 06:59 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.