[PATCH 12/12] crash-trace-command: support old kernel that has no print_fmt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



very old kernel has no print_fmt field, use "Unknown print_fmt"
instead.

Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>
---
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@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility


[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux