Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Crash Utility (http://www.linux-archive.org/crash-utility/)
-   -   crash-trace-command: load id for different kernels (http://www.linux-archive.org/crash-utility/480400-crash-trace-command-load-id-different-kernels.html)

Lai Jiangshan 01-24-2011 08:35 AM

crash-trace-command: load id for different kernels
 
The id field of struct ftrace_event_call is different for kernels:

Old kernel uses ftrace_event_call.id
newer kernel uses ftrace_event_call.event.type

Change ftrace_get_event_type_id() and make it serves for different kernels.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/extensions/trace.c b/extensions/trace.c
index 3697108..1ad53c1 100755
--- a/extensions/trace.c
+++ b/extensions/trace.c
@@ -878,6 +878,15 @@ int ftrace_get_event_type_id(ulong call, int *id)
if (!inited) {
inited = 1;
id_offset = MEMBER_OFFSET("ftrace_event_call", "id");
+
+ if (id_offset < 0) {
+ /* id = call->event.type */
+ int f1 = MEMBER_OFFSET("ftrace_event_call", "event");
+ int f2 = MEMBER_OFFSET("trace_event", "type");
+
+ if (f1 >= 0 && f2 >= 0)
+ id_offset = f1 + f2;
+ }
}

if (id_offset < 0)

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


All times are GMT. The time now is 12:52 AM.

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