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: implement older syscall_get_exit_fields()

Older kernel use older syscall_get_exit_fields().
Implement(emulate) for it!

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/extensions/trace.c b/extensions/trace.c
index 3bad4af..e04c504 100755
--- a/extensions/trace.c
+++ b/extensions/trace.c
@@ -697,6 +697,38 @@ work:
return 0;
}

+static int syscall_get_exit_fields_old(ulong call, ulong *fields)
+{
+ static int inited;
+ static int data_offset;
+ static int exit_fields_offset;
+
+ ulong metadata;
+
+ if (inited)
+ goto work;
+
+ inited = 1;
+ data_offset = MEMBER_OFFSET("ftrace_event_call", "data");
+ if (data_offset < 0)
+ return -1;
+
+ exit_fields_offset = MEMBER_OFFSET("syscall_metadata", "exit_fields");
+ if (exit_fields_offset < 0)
+ return -1;
+
+work:
+ if (data_offset < 0 || exit_fields_offset < 0)
+ return -1;
+
+ if (!readmem(call + data_offset, KVADDR, &metadata, sizeof(metadata),
+ "read ftrace_event_call data", RETURN_ON_ERROR))
+ return -1;
+
+ *fields = metadata + exit_fields_offset;
+ return 0;
+}
+
static int syscall_get_exit_fields(ulong call, ulong *fields)
{
static int inited;
@@ -714,7 +746,7 @@ static int syscall_get_exit_fields(ulong call, ulong *fields)
}

if (inited == -1)
- return -1;
+ return syscall_get_exit_fields_old(call, fields);

*fields = syscall_exit_fields_value;


--
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 05:34 AM.

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