From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25948 invoked by alias); 20 Oct 2006 02:02:28 -0000 Received: (qmail 25730 invoked by uid 22791); 20 Oct 2006 02:02:26 -0000 X-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 20 Oct 2006 02:02:23 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by mga03.intel.com with ESMTP; 19 Oct 2006 19:02:20 -0700 Received: from scsmsx332.sc.intel.com (HELO scsmsx332.amr.corp.intel.com) ([10.3.90.6]) by azsmga001.ch.intel.com with ESMTP; 19 Oct 2006 19:02:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: i="4.09,331,1157353200"; d="scan'208"; a="133508756:sNHT19819856" Received: from scsmsx413.amr.corp.intel.com ([10.3.90.32]) by scsmsx332.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 19 Oct 2006 19:02:19 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: user mode backtrace Date: Fri, 20 Oct 2006 02:02:00 -0000 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: user mode backtrace Thread-Index: Acbz1cu1TXH5j2jkQs+fgLhekL5L2QAFa6ZA From: "Stone, Joshua I" To: Cc: "SystemTap" X-OriginalArrivalTime: 20 Oct 2006 02:02:19.0750 (UTC) FILETIME=[C65D3860:01C6F3EB] 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/msg00213.txt.bz2 On Thursday, October 19, 2006 4:25 PM, David Boreham wrote: >> pid =3D fork_ptraceme_exec("myapp"); // start the app paused >> stappid =3D fork_exec("stap myscript.stp -x " + pid); // start >> systemtap ptrace(DETACH, pid, ...); // let the app run >>=20 >>=20 > Actually I don't think this will help me because it looks like > it assumes a specific target process. That's the specific problem that > I have : I don't know which processes are going to be interesting > in advance. I just filter on a single tid because it's convenient. The thing you have to avoid is probing any of the processes you kick off, like the pstack. Otherwise you get yourself in a recursive loop, and congratulations, you've just fork-bombed the system. So it's hard to be smart about which processes NOT to probe. You could try filtering by execname, if that's known. If you can manage that your application is spawned from a central process, you could try to follow forks from that process: ----------------------------------------------- global filter probe begin { filter[target()] =3D 1 } probe process.create { if (filter[tid()]) filter[new_pid] =3D 1 } probe process.exit { delete filter[tid()] } ----------------------------------------------- Then instead of "if (target() !=3D tid()) next;" you have "if (!filter[tid()]) next;". Josh