FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Crash Utility

 
 
LinkBack Thread Tools
 
Old 01-24-2011, 08:35 AM
Lai Jiangshan
 
Default crash-trace-command: get event type's system from its class

In newer kernel, the "system name" of a event call is stored in
struct ftrace_event_class, so we have to change
ftrace_get_event_type_system() for it.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/extensions/trace.c b/extensions/trace.c
index 1ad53c1..a54e4fa 100755
--- a/extensions/trace.c
+++ b/extensions/trace.c
@@ -822,18 +822,37 @@ int ftrace_get_event_type_system(ulong call, char *system, int len)
{
static int inited;
static int sys_offset;
+ static int class_offset;

+ ulong ptr = call;
ulong sys_addr;

- if (!inited) {
- inited = 1;
- sys_offset = MEMBER_OFFSET("ftrace_event_call", "system");
- }
+ if (inited)
+ goto work;

+ inited = 1;
+ sys_offset = MEMBER_OFFSET("ftrace_event_call", "system");
+
+ if (sys_offset >= 0)
+ goto work;
+
+ class_offset = MEMBER_OFFSET("ftrace_event_call", "class");
+ if (class_offset < 0)
+ return -1;
+
+ sys_offset = MEMBER_OFFSET("ftrace_event_class", "system");
+ inited = 2;
+
+work:
if (sys_offset < 0)
return -1;

- if (!readmem(call + sys_offset, KVADDR, &sys_addr, sizeof(sys_addr),
+ if (inited == 2 && !readmem(call + class_offset, KVADDR, &ptr,
+ sizeof(ptr), "read ftrace_event_call class_addr",
+ RETURN_ON_ERROR))
+ return -1;
+
+ if (!readmem(ptr + sys_offset, KVADDR, &sys_addr, sizeof(sys_addr),
"read ftrace_event_call sys_addr", RETURN_ON_ERROR))
return -1;


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

Thread Tools




All times are GMT. The time now is 11:40 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org