This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH 1/2] ia64: add utrace support on ia64
- From: Masami Hiramatsu <mhiramat at redhat dot com>
- To: systemtap-ml <systemtap at sources dot redhat dot com>
- Date: Fri, 05 Sep 2008 11:23:42 -0400
- Subject: [PATCH 1/2] ia64: add utrace support on ia64
Hi,
Here is a patch which add utrace on ia64 support to systemtap.
I just checked it on rhel5.2 kernel (this means old utrace interface).
Thank you,
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division
e-mail: mhiramat@redhat.com
---
runtime/syscall.h | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 46 insertions(+), 1 deletion(-)
Index: systemtap/runtime/syscall.h
===================================================================
--- systemtap.orig/runtime/syscall.h
+++ systemtap/runtime/syscall.h
@@ -66,7 +66,15 @@
#define MUNMAP_SYSCALL_NO(tsk) 91
#define MREMAP_SYSCALL_NO(tsk) 163
#endif
-
+
+#if defined(__ia64__)
+#define MMAP_SYSCALL_NO(tsk) 1151
+#define MMAP2_SYSCALL_NO(tsk) 1172
+#define MPROTECT_SYSCALL_NO(tsk) 1155
+#define MUNMAP_SYSCALL_NO(tsk) 1152
+#define MREMAP_SYSCALL_NO(tsk) 1156
+#endif
+
#if !defined(MMAP_SYSCALL_NO) || !defined(MMAP2_SYSCALL_NO) \
|| !defined(MPROTECT_SYSCALL_NO) || !defined(MUNMAP_SYSCALL_NO) \
|| !defined(MREMAP_SYSCALL_NO)
@@ -95,6 +103,14 @@ __stp_user_syscall_nr(struct pt_regs *re
}
#endif
+#if defined(__ia64__)
+static inline unsigned long
+__stp_user_syscall_nr(struct pt_regs *regs)
+{
+ return regs->r15;
+}
+#endif
+
#if defined(__i386__) || defined(__x86_64__)
static inline long *
__stp_user_syscall_return_value(struct task_struct *task, struct pt_regs *regs)
@@ -129,6 +145,14 @@ __stp_user_syscall_return_value(struct t
}
#endif
+#if defined(__ia64__)
+static inline long *
+__stp_user_syscall_return_value(struct task_struct *task, struct pt_regs *regs)
+{
+ return ®s->r8;
+}
+#endif
+
#if defined(__i386__) || defined(__x86_64__)
static inline long *
__stp_user_syscall_arg(struct task_struct *task, struct pt_regs *regs,
@@ -211,4 +235,25 @@ __stp_user_syscall_arg(struct task_struc
}
#endif
+#if defined(__ia64__)
+static inline long *
+__stp_user_syscall_arg(struct task_struct *task, struct pt_regs *regs,
+ unsigned int n)
+{
+ struct ia64_stap_get_arbsp_param pa;
+ if (n > 5) {
+ _stp_error("syscall arg > 5");
+ return NULL;
+ }
+
+ pa.ip = regs->cr_iip;
+ unw_init_running(ia64_stap_get_arbsp, &pa);
+ if (pa.address == 0)
+ return NULL;
+
+ return ia64_rse_skip_regs(pa.address, n);
+
+}
+#endif
+
#endif /* _SYSCALL_H_ */