From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13960 invoked by alias); 12 Oct 2006 18:58:35 -0000 Received: (qmail 13951 invoked by uid 22791); 12 Oct 2006 18:58:33 -0000 X-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 12 Oct 2006 18:58:30 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k9CIwS1w028804 for ; Thu, 12 Oct 2006 14:58:28 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k9CIwNKv020390 for ; Thu, 12 Oct 2006 14:58:23 -0400 Received: from vpn-248-27.boston.redhat.com (vpn-248-27.boston.redhat.com [10.13.248.27]) by pobox.corp.redhat.com (8.13.1/8.12.8) with ESMTP id k9CIwMl4018178 for ; Thu, 12 Oct 2006 14:58:22 -0400 Subject: stack trace changes From: Martin Hunt To: systemtap@sources.redhat.com Content-Type: text/plain Organization: Red Hat Inc. Date: Thu, 12 Oct 2006 18:58:00 -0000 Message-Id: <1160679497.4762.11.camel@dragon> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 (2.6.3-1.fc5.5) Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2006-q4/txt/msg00105.txt.bz2 I've checked in a rewrite of the stack trace code. I rewrote i386 and x86_64 only. ppc64 and ia64 should still work as before, unless I made any errors while reorganizing the code. In 2.6.18 there is code to use DWARF to accurately unwind the stacks. The new code uses this if available, otherwise it falls back to the inaccurate unwinder. Some situations like kretprobe trampolines confuse the unwinder and it does what it can accurately then uses the inaccurate unwinder. In all cases, it now says when the trace in not accurate. I also added some related functions: stack_size() - stack size stack_used() - bytes of stack used stack_unused() - bytes of stack unused caller() - for kretprobes only right now, returns the calling function name and address. caller_addr() - ditto but returns an address only Example output looks like this: WITH NEW UNWINDER (normal probe) 0xc04a28ac : meminfo_read_proc+0xf/0x313 [] 0xc04a01ad : proc_file_read+0x110/0x237 [] 0xc046f77c : vfs_read+0xa6/0x157 [] 0xc046fbeb : sys_read+0x41/0x67 [] 0xc0403f97 : syscall_call+0x7/0xb [] (normal probe when a return probe is on the same function) 0xc04a1bc3 : uptime_read_proc+0xe/0x99 [] 0xc06143c5 : kretprobe_trampoline+0x0/0x2b [] 0x00000c00 Leftover inexact backtrace: 0xc04a009d : proc_file_read+0x0/0x237 [] 0xc046f77c : vfs_read+0xa6/0x157 [] 0xc046fbeb : sys_read+0x41/0x67 [] 0xc0403f97 : syscall_call+0x7/0xb [] (return probe) Returning from: 0xc04a1bb5 : uptime_read_proc+0x0/0x99 [] Returning to: 0xc04a01ad : proc_file_read+0x110/0x237 [] Inexact backtrace: 0xc04a009d : proc_file_read+0x0/0x237 [] 0xc046f77c : vfs_read+0xa6/0x157 [] 0xc046fbeb : sys_read+0x41/0x67 [] 0xc0403f97 : syscall_call+0x7/0xb [] WITHOUT NEW UNWINDER 0xc04a1c54 : meminfo_read_proc+0xf/0x27a [] Inexact backtrace: 0xc048091e : dput+0x35/0x230 [] 0xc0479907 : __link_path_walk+0xbf4/0xd31 [] 0xc048091e : dput+0x35/0x230 [] 0xc0484fad : mntput_no_expire+0x11/0x6e [] 0xc0479af7 : link_path_walk+0xb3/0xbd [] 0xc06181fe : _read_unlock_irq+0x5/0x7 [] 0xc044c938 : find_get_page+0x3a/0x40 [] 0xc044f103 : filemap_nopage+0x192/0x31f [] 0xc0451564 : get_page_from_freelist+0x2a8/0x411 [] 0xc045bb40 : vma_adjust+0x3c8/0x43e [] 0xc045173a : __alloc_pages+0x6d/0x2c2 [] 0xc045c04f : vma_merge+0x18a/0x19a [] 0xc04a1c45 : meminfo_read_proc+0x0/0x27a [] 0xc04a028a : proc_file_read+0x110/0x237 [] 0xc04a017a : proc_file_read+0x0/0x237 [] 0xc046bac2 : vfs_read+0xa6/0x14e [] 0xc046bf26 : sys_read+0x41/0x67 [] 0xc0403e3f : syscall_call+0x7/0xb [] 0xc04a1ecd : uptime_read_proc+0xe/0x99 [] Inexact backtrace: 0xc06183fe : debug_stack_correct+0x1e/0x24 [] 0xc04a1ebf : uptime_read_proc+0x0/0x99 [] 0xc04a1ebf : uptime_read_proc+0x0/0x99 [] 0xc06188cf : kretprobe_trampoline+0x0/0x2b [] 0xc04a017a : proc_file_read+0x0/0x237 [] 0xc046bac2 : vfs_read+0xa6/0x14e [] 0xc046bf26 : sys_read+0x41/0x67 [] 0xc0403e3f : syscall_call+0x7/0xb [] Returning from: 0xc04a1ebf : uptime_read_proc+0x0/0x99 [] Returning to: 0xc04a028a : proc_file_read+0x110/0x237 [] Inexact backtrace: 0xc04a017a : proc_file_read+0x0/0x237 [] 0xc046bac2 : vfs_read+0xa6/0x14e [] 0xc046bf26 : sys_read+0x41/0x67 [] 0xc0403e3f : syscall_call+0x7/0xb []