From owner-freebsd-dtrace@freebsd.org Tue Sep 1 15:32:53 2015 Return-Path: Delivered-To: freebsd-dtrace@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 448789C7E36 for ; Tue, 1 Sep 2015 15:32:53 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: from mail-vk0-x230.google.com (mail-vk0-x230.google.com [IPv6:2607:f8b0:400c:c05::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 041DF8EA for ; Tue, 1 Sep 2015 15:32:53 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: by vkbc123 with SMTP id c123so58651612vkb.3 for ; Tue, 01 Sep 2015 08:32:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=W0MXbTZyy73D89t1ns2DqQz+0/+WgVmEUW7fN6ggbEo=; b=hFs8OmztoEtqNK3vQIGZ6q0gSEvOwPBXXekSRarjOOtPyf2g02ULXGDWkkWTuDyskC BsDHYaeNXkdIG/smGspiG0nh0Ysfb0wFeSbEFv29LwRev8QskmEzOftxtTOr7AKf+L7g 5LfbP5OU5CB9TtieFE+WUgLMGi5cfaiyLia4ughRZPryvZrsCf/99PbLkynjZYIQYN52 2/DDSbJxEVEVRovso3zq0qw4LDTOUknmKLZzd/bf46tdiCX3qkId8C3/OCm/wPAgAnZV g7XS7AbbEr8ns9Sbb8LVV4IWC3FdFpSRCknO2ja7v5MS5ViDySja18H9e0EoxM/r1S46 iYLg== MIME-Version: 1.0 X-Received: by 10.52.94.42 with SMTP id cz10mr30393796vdb.22.1441121571917; Tue, 01 Sep 2015 08:32:51 -0700 (PDT) Received: by 10.31.1.6 with HTTP; Tue, 1 Sep 2015 08:32:51 -0700 (PDT) Date: Tue, 1 Sep 2015 23:32:51 +0800 Message-ID: Subject: Dtrace in a jail From: Ben Woods To: freebsd-dtrace@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Sep 2015 15:32:53 -0000 Hi everyone, I am just discovering dtrace, having heard about it a number of times but never investigated further. I like what I see so far! Is there a way to use Dtrace to debug programs being run in a jail? Attempting to run Dtrace from within the jail results in the following error: # dtrace -l dtrace: failed to initialize dtrace: DTrace device not available on system I want to debug a program I am running in a jail which is crashing a few seconds after being run. It doesn't crash in my FreeBSD 10.2 host, but does in the FreeBSD 9.3 jail. Since I want to run Dtrace on the pid provider on my program, I want my program to be executed by the Dtrace application. Something like: # dtrace -l -n 'pid$target::strcmp:entry{}' -c "./foo hello" But this results in the same error about Dtrace device not being available on the system (within the jail). If I instead run Dtrace and pass it the jexec command, I think it is tracing the jexec program, rather than my program that is then being executed within the jail. I.e. I don't think this works as expected: # dtrace -l -n 'pid$target::strcmp:entry{}' -c "jexec 1 foo hello" Any hints on how I can trace this program running in the jail? Thanks, Ben -- -- From: Benjamin Woods woodsb02@gmail.com