From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 22 19:41:39 2013 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C99FE5A5 for ; Tue, 22 Jan 2013 19:41:39 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell0.rawbw.com (shell0.rawbw.com [198.144.192.45]) by mx1.freebsd.org (Postfix) with ESMTP id B22ECFB8 for ; Tue, 22 Jan 2013 19:41:39 +0000 (UTC) Received: from eagle.yuri.org (stunnel@localhost [127.0.0.1]) (authenticated bits=0) by shell0.rawbw.com (8.14.4/8.14.4) with ESMTP id r0MJfWgx035013 for ; Tue, 22 Jan 2013 11:41:33 -0800 (PST) (envelope-from yuri@rawbw.com) Message-ID: <50FEEB6C.7090303@rawbw.com> Date: Tue, 22 Jan 2013 11:41:32 -0800 From: Yuri User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130112 Thunderbird/17.0.2 MIME-Version: 1.0 To: hackers@freebsd.org Subject: Why DTrace sensor is listed but not called? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2013 19:41:39 -0000 I tried to create my own DTrace sensors (for debugging purposes) through adding of the simple function like this: static u_int xxx_my_trace(int arg) { return 1; } It is listed in dtrace -l with its entry and return sensors. 8143 fbt kernel xxx_my_trace entry 8144 fbt kernel xxx_my_trace return This function is called, I know for sure because it is called from another procedure which does get traced by DTrace. However, these sensors are never triggered when run through dtrace(1M) #!/usr/sbin/dtrace -s ::xxx_my_trace:entry { printf("xxx_my_trace"); } It does print the following, but nothing else: dtrace: script './dt.d' matched 1 probe Adding __attribute__((noinline)) doesn't help. What is the problem? Why dtrace sensors aren't invoked? Yuri