From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28884 invoked by alias); 11 Dec 2007 09:41:42 -0000 Received: (qmail 28877 invoked by uid 22791); 11 Dec 2007 09:41:42 -0000 X-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: sourceware.org Received: from e28smtp07.in.ibm.com (HELO e28esmtp07.in.ibm.com) (59.145.155.7) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 11 Dec 2007 09:41:35 +0000 Received: from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61]) by e28esmtp07.in.ibm.com (8.13.1/8.13.1) with ESMTP id lBB9et1s005135 for ; Tue, 11 Dec 2007 15:10:55 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay04.in.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id lBB9et9v602278 for ; Tue, 11 Dec 2007 15:10:55 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.13.1/8.13.3) with ESMTP id lBB9esv2008376 for ; Tue, 11 Dec 2007 09:40:54 GMT Received: from [9.124.35.50] (srinivasa-009124035050.in.ibm.com [9.124.35.50]) by d28av01.in.ibm.com (8.13.1/8.12.11) with ESMTP id lBB9esFs008373 for ; Tue, 11 Dec 2007 09:40:54 GMT Message-ID: <475E5B32.90408@in.ibm.com> Date: Tue, 11 Dec 2007 09:41:00 -0000 From: Srinivasa Ds User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: SystemTAP Subject: [RFC] [PATCH] To make systemtap work on 2.6.24-rc4-mm1 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2007-q4/txt/msg00464.txt.bz2 I was testing Masami's kprobes patch on x86_64. I found that some changes in vfs and Roland's fix (those are present in -mm1) have made systemtap not to work on -mm1. =========================================== /home/systemtap/tmp/stap_testing_200712110755/install/share/systemtap/runtime/regs.c:37: error: 'struct pt_regs' has no member named 'rsp' _stp_print_regs /home/systemtap/tmp/stap_testing_200712110755/install/share/systemtap/runtime/regs.c: In function '_stp_print_regs': /home/systemtap/tmp/stap_testing_200712110755/install/share/systemtap/runtime/regs.c:87: error: 'struct pt_regs' has no member named 'rip' /home/systemtap/tmp/stap_testing_200712110755/install/share/systemtap/runtime/regs.c:87: error: 'struct pt_regs' has no member named 'rsp' ========================================== I have developed the patch, which fixes this issue. Since Roland's and vfs patches may get pulled to rc tree from mm, this patch might be helpful to people. Please let me know your comments on this patch. ======================================================= Signed-off-by: Srinivasa DS diff -Naurp src-orig/runtime/loc2c-runtime.h src/runtime/loc2c-runtime.h --- src-orig/runtime/loc2c-runtime.h 2007-10-03 02:03:22.000000000 +0530 +++ src/runtime/loc2c-runtime.h 2007-12-11 13:44:55.000000000 +0530 @@ -104,14 +104,14 @@ #elif defined __x86_64__ -#define dwarf_register_0(regs) regs->rax -#define dwarf_register_1(regs) regs->rdx -#define dwarf_register_2(regs) regs->rcx -#define dwarf_register_3(regs) regs->rbx -#define dwarf_register_4(regs) regs->rsi -#define dwarf_register_5(regs) regs->rdi -#define dwarf_register_6(regs) regs->rbp -#define dwarf_register_7(regs) regs->rsp +#define dwarf_register_0(regs) regs->ax +#define dwarf_register_1(regs) regs->dx +#define dwarf_register_2(regs) regs->cx +#define dwarf_register_3(regs) regs->bx +#define dwarf_register_4(regs) regs->si +#define dwarf_register_5(regs) regs->di +#define dwarf_register_6(regs) regs->bp +#define dwarf_register_7(regs) regs->sp #define dwarf_register_8(regs) regs->r8 #define dwarf_register_9(regs) regs->r9 #define dwarf_register_10(regs) regs->r10 diff -Naurp src-orig/runtime/procfs.c src/runtime/procfs.c --- src-orig/runtime/procfs.c 2007-09-19 18:34:57.000000000 +0530 +++ src/runtime/procfs.c 2007-12-11 14:19:59.000000000 +0530 @@ -87,8 +87,8 @@ int _stp_mkdir_proc_module(void) goto done; } } else { - _stp_proc_stap = PDE(nd.dentry->d_inode); - path_release (&nd); + _stp_proc_stap = PDE(nd.path.dentry->d_inode); + path_put (&nd.path); } _stp_proc_root = proc_mkdir(THIS_MODULE->name, _stp_proc_stap); diff -Naurp src-orig/runtime/regs.c src/runtime/regs.c --- src-orig/runtime/regs.c 2007-07-04 22:35:00.000000000 +0530 +++ src/runtime/regs.c 2007-12-11 13:44:11.000000000 +0530 @@ -34,7 +34,7 @@ unsigned long _stp_ret_addr (struct pt_regs *regs) { #ifdef __x86_64__ - unsigned long *ra = (unsigned long *)regs->rsp; + unsigned long *ra = (unsigned long *)regs->sp; if (ra) return *ra; else @@ -84,13 +84,13 @@ void _stp_print_regs(struct pt_regs * re unsigned int fsindex,gsindex; unsigned int ds,cs,es; - _stp_printf("RIP: %016lx\nRSP: %016lx EFLAGS: %08lx\n", regs->rip, regs->rsp, regs->eflags); + _stp_printf("RIP: %016lx\nRSP: %016lx EFLAGS: %08lx\n", regs->ip, regs->sp, regs->flags); _stp_printf("RAX: %016lx RBX: %016lx RCX: %016lx\n", - regs->rax, regs->rbx, regs->rcx); + regs->ax, regs->bx, regs->cx); _stp_printf("RDX: %016lx RSI: %016lx RDI: %016lx\n", - regs->rdx, regs->rsi, regs->rdi); + regs->dx, regs->si, regs->di); _stp_printf("RBP: %016lx R08: %016lx R09: %016lx\n", - regs->rbp, regs->r8, regs->r9); + regs->bp, regs->r8, regs->r9); _stp_printf("R10: %016lx R11: %016lx R12: %016lx\n", regs->r10, regs->r11, regs->r12); _stp_printf("R13: %016lx R14: %016lx R15: %016lx\n", diff -Naurp src-orig/runtime/regs.h src/runtime/regs.h --- src-orig/runtime/regs.h 2007-05-30 20:03:55.000000000 +0530 +++ src/runtime/regs.h 2007-12-11 13:51:04.000000000 +0530 @@ -14,8 +14,8 @@ #ifdef __x86_64__ -#define REG_IP(regs) regs->rip -#define REG_SP(regs) regs->rsp +#define REG_IP(regs) regs->ip +#define REG_SP(regs) regs->sp #elif defined (__i386__)