From owner-freebsd-hackers@FreeBSD.ORG Sat Mar 3 01:16:25 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 85C1A106564A for ; Sat, 3 Mar 2012 01:16:25 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.freebsd.org (Postfix) with ESMTP id 0BAE28FC08 for ; Sat, 3 Mar 2012 01:16:24 +0000 (UTC) Received: from ur.dons.net.au (ppp121-45-45-100.lns20.adl2.internode.on.net [121.45.45.100]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id q230uYmH056959 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sat, 3 Mar 2012 11:26:40 +1030 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=iso-8859-1 From: "Daniel O'Connor" In-Reply-To: <4F516AA7.8060606@rawbw.com> Date: Sat, 3 Mar 2012 11:26:33 +1030 Content-Transfer-Encoding: quoted-printable Message-Id: <48E3F3E0-6DE1-46F7-A732-A44DE2C9D147@gsoft.com.au> References: <4F516AA7.8060606@rawbw.com> To: Yuri X-Mailer: Apple Mail (2.1257) X-Spam-Score: 2.162 (**) BAYES_00,KHOP_DYNAMIC,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: freebsd-hackers@freebsd.org Subject: Re: Can I take a snapshot of the current stack for every thread in some process from outside? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2012 01:16:25 -0000 On 03/03/2012, at 11:19, Yuri wrote: > I have the multithreaded process, each thread has some stack state at = each point of time. For example during the timer tick when processes are = switched? > Is there a way to take a snapshot without disrupting a process? >=20 > I was thinking gdb, but it requires the process to exit the system = call to attach (?). > DTrace is only activated particular sensors are crossed. >=20 > So is there such a tool/command? Will gcore do what you want? -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C