From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 15 14:53:21 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC7DE1065693 for ; Mon, 15 Feb 2010 14:53:21 +0000 (UTC) (envelope-from fergleiser@yahoo.com) Received: from web31703.mail.mud.yahoo.com (web31703.mail.mud.yahoo.com [68.142.201.183]) by mx1.freebsd.org (Postfix) with SMTP id 98C768FC12 for ; Mon, 15 Feb 2010 14:53:21 +0000 (UTC) Received: (qmail 98102 invoked by uid 60001); 15 Feb 2010 14:53:20 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1266245600; bh=6kV6YzfdJMBaTA+I6jBpsquA70in4x3A00cdxTNGN5Y=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=lh6lXfuP9cSRJRunHpCpoBQpHHXviyJizupqRiL6e+MMfS6zXu+S6bD6jfMYCuU9hg99jBxm1nTIjI/1JoXVjwPsBc0tu2QtBDBg8LWy65gMjy5aUY/bNAMZKp7bw+qIGduWxan6kNfP6XO8HnM2vOH5c2YlEWuCOdRQO/QQeYU= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=Sve5baNOCyUM97F3Q0e5ChsyBd9qSsiVcKVjhz0Svr7vvVbAAjgdGOIJm3vukh1x6ST8RW2rfNYRNjIY124SSuvAR0HnvQ8pQDK7mn3uUWJbct6IsWOda4hYt60pQeagZxETEJZczvrFHqJGST84uiQu0OSX6qPwpX6m1R01D+s=; Message-ID: <909320.96307.qm@web31703.mail.mud.yahoo.com> X-YMail-OSG: w5whr7UVM1nNyjwrH71msOKe.0X.928G2fFlh29m2H0xpUzHXt0PEjrquteyveC.V_6D6IFCwkKWPJRCbU3HLQuiBtFlNvy0O4MrpWWBz4tOv8l13ZINRuTmNttuUT.bCbZwMRxA9TaZY4xeGlp553tBxsHo2sTv5b849xDYj.0IwimFwmi0P4wiGsWAvQisTb_IpMGO6Vq8KsWBo_iTRGansFiqsGh4iMmewXi1gPTlmvKxUzKrRAATa8n_0XCK86ydOzgHitlTw2XHUG0.JJlAflB.TjYSQ2eqStQfCqoEnwNomCirKwTzQk3bf.3WVqaZ.VcP7QvYdvRWkPJ8gC7jOrVriM_N7_.UTctSHMubuVtIxvnhlm2HtCDm Received: from [190.136.181.68] by web31703.mail.mud.yahoo.com via HTTP; Mon, 15 Feb 2010 06:53:20 PST X-Mailer: YahooMailRC/300.3 YahooMailWebService/0.8.100.260964 References: <291941b81002150321w7b0479beo1c6fec39ef6a7922@mail.gmail.com> Date: Mon, 15 Feb 2010 06:53:20 -0800 (PST) From: Fernando Gleiser To: Shrikanth Kamath , freebsd-hackers@freebsd.org In-Reply-To: <291941b81002150321w7b0479beo1c6fec39ef6a7922@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Subject: Re: Ktrace'ing kernel threads 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: Mon, 15 Feb 2010 14:53:21 -0000 ----- Original Message ---- > From: Shrikanth Kamath > To: freebsd-hackers@freebsd.org > Sent: Mon, February 15, 2010 8:21:40 AM > Subject: Ktrace'ing kernel threads > > Can ktrace trace another kernel thread which has roughly the semantics as > below, right now it > does not hit any of the designated interesting points that ktrace is built > for, but what if I could define those, > will ktrace still allow tracing another kernel thread? Yo can do that easily with dtrace #!/usr/sbin/dtrace -s fbt::build_msg:entry { printf("%d\n", timestamp) } fbt::build_msg:return { printf("%d\n", timestamp) } or if you want to get an histogram of the call time distributions: fbt::build_msg:entry { self->ts=timestamp; } fbt::build_msg:return { @[probefunc]=quantize(timestamp - self->ts); } Those are from the top of my head, I don't have a FreeBSD system at hand to test them, but I hope you'll get the idea Fer