From owner-freebsd-dtrace@freebsd.org Sat Oct 27 22:40:40 2018 Return-Path: Delivered-To: freebsd-dtrace@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1848F10D6727 for ; Sat, 27 Oct 2018 22:40:40 +0000 (UTC) (envelope-from longwitz@incore.de) Received: from dss.incore.de (dss.incore.de [195.145.1.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9F197E78E for ; Sat, 27 Oct 2018 22:40:39 +0000 (UTC) (envelope-from longwitz@incore.de) Received: from inetmail.dmz (inetmail.dmz [10.3.0.3]) by dss.incore.de (Postfix) with ESMTP id 83A53139AF for ; Sun, 28 Oct 2018 00:40:38 +0200 (CEST) X-Virus-Scanned: amavisd-new at incore.de Received: from dss.incore.de ([10.3.0.3]) by inetmail.dmz (inetmail.dmz [10.3.0.3]) (amavisd-new, port 10024) with LMTP id CAj9bAJf2MNy for ; Sun, 28 Oct 2018 00:40:37 +0200 (CEST) Received: from mail.local.incore (fwintern.dmz [10.0.0.253]) by dss.incore.de (Postfix) with ESMTP id 8462E139AC for ; Sun, 28 Oct 2018 00:40:37 +0200 (CEST) Received: from bsdmhs.longwitz (unknown [192.168.99.6]) by mail.local.incore (Postfix) with ESMTP id 701C011F for ; Sun, 28 Oct 2018 00:40:37 +0200 (CEST) Message-ID: <5BD4E965.9040006@incore.de> Date: Sun, 28 Oct 2018 00:40:37 +0200 From: Andreas Longwitz User-Agent: Thunderbird 2.0.0.19 (X11/20090113) MIME-Version: 1.0 To: "freebsd-dtrace@freebsd.org" Subject: Why my DTrace script does not work after installing a new kernel without reboot Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.29 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: Sat, 27 Oct 2018 22:40:40 -0000 I have a simple, probably stupid question. I run FreeBSD 10.4 Stable r338093 and use the script #!/usr/sbin/dtrace -s dtrace:::BEGIN { printf("pf_default_rule.timeout[2/16/17]=%d/%d/%d\n", kernel`pf_default_rule.timeout[2], kernel`pf_default_rule.timeout[16], kernel`pf_default_rule.timeout[17]); } The output normally is pf_default_rule.timeout[2/16/17]=86400/6000/12000 But when I change the sourcefile /sys/netpfil/pf/pf.c trying a patch and build and install the new kernel but without reboot, then the output of the script is wrong: pf_default_rule.timeout[2/16/17]=3237216124/0/0 After reboot everything works again. -- Andreas Longwitz From owner-freebsd-dtrace@freebsd.org Sat Oct 27 22:53:53 2018 Return-Path: Delivered-To: freebsd-dtrace@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 099B310D6CAD for ; Sat, 27 Oct 2018 22:53:53 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it1-x12e.google.com (mail-it1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 837227F54D for ; Sat, 27 Oct 2018 22:53:52 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it1-x12e.google.com with SMTP id k206-v6so5557738ite.0 for ; Sat, 27 Oct 2018 15:53:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=apIJRg1TeZ7WnuFbXDZsXxA6n3Yzavn8FZzeIysAPPQ=; b=XHjdKOsTsMamyU7vSA8G5Q4K7s4o15NNLbOjJTMMmLsxfITdMX0+XwmvBJuWzRWN/T FlD2w3pNadeoM8+gd6oi1bVZp0uEiUWTW/1xNgppYkrhr5tnh2/IZcDBOMGudEK+CgIE ShznbFh9P1AskfPuTbUxCUNcczEvp+h0ZGHUPAPZCYfIXjIIDXsG82V+XI6tAjHnJbQ7 LhgL4rqBTkJv3s+yBSlGBtI7v9bvOybVE7ueilta+Arlv5jv8amYv1NDva5CCPjIJFXN S6Uhf5vAmOCs2f8T7lbGV2LZnn9RdCdnS1l2eTtlsp5nIbKHDGN49mB8LH5l3Q/TZN9Y 0kZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=apIJRg1TeZ7WnuFbXDZsXxA6n3Yzavn8FZzeIysAPPQ=; b=RPUlTjANKnx/jAq//5P8C8pesHvkk5/foHYmBIewXZ8nIQHUrccZG4x6nt+MLql3HS vLp1mYxJzm+cvtThUs8GRCK83Dzcq5/OLHHUmVJB0HRHz6/46ccDI6eoFb4z3YLHAcIR OYT/jY4YOEZoIP/IQZZXuP6Ju/fRuG+FuCu8EihkAB029DV61+CYtNZ773vmbSrjDOdO g4nokl7NKqvJE5BFhFi3LDIWEJwZzphLIOvdErIF9MxMy7QNI7l+zLlcnfFz/0Avbu8Q x1ecbh6zgxb6BOYxe/5dNBgYeea+X0V4Hdci71a6TOMUgTJL1u/kQ/UkCPVeIyYK560X jUKA== X-Gm-Message-State: AGRZ1gKqtQjNYFS/qrzz6vL6AuGUYQrCHnWFm00C0IQ70NEkz74HO5hQ MlS36p4SepN5LXcfM/1cHShHW29f X-Google-Smtp-Source: AJdET5cfrOWUd/IxB0iDznNKqbccJKGtZ+7Y5+x5lfEQ6I4MYzx1lyhQUHxKvl5Q9vgehHVWAEB05w== X-Received: by 2002:a24:bcc1:: with SMTP id n184-v6mr6701652ite.174.1540680831691; Sat, 27 Oct 2018 15:53:51 -0700 (PDT) Received: from spy (toroon0560w-lp130-08-67-71-176-199.dsl.bell.ca. [67.71.176.199]) by smtp.gmail.com with ESMTPSA id h12-v6sm3750904iok.64.2018.10.27.15.53.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 27 Oct 2018 15:53:50 -0700 (PDT) Sender: Mark Johnston Date: Sat, 27 Oct 2018 18:53:46 -0400 From: Mark Johnston To: Andreas Longwitz Cc: "freebsd-dtrace@freebsd.org" Subject: Re: Why my DTrace script does not work after installing a new kernel without reboot Message-ID: <20181027225339.GA4191@spy> References: <5BD4E965.9040006@incore.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5BD4E965.9040006@incore.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.29 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: Sat, 27 Oct 2018 22:53:53 -0000 On Sun, Oct 28, 2018 at 12:40:37AM +0200, Andreas Longwitz wrote: > I have a simple, probably stupid question. I run FreeBSD 10.4 Stable > r338093 and use the script > > #!/usr/sbin/dtrace -s > > dtrace:::BEGIN > { > printf("pf_default_rule.timeout[2/16/17]=%d/%d/%d\n", > kernel`pf_default_rule.timeout[2], kernel`pf_default_rule.timeout[16], > kernel`pf_default_rule.timeout[17]); > } > > The output normally is > pf_default_rule.timeout[2/16/17]=86400/6000/12000 > > But when I change the sourcefile /sys/netpfil/pf/pf.c trying a patch and > build and install the new kernel but without reboot, then the output of > the script is wrong: > > pf_default_rule.timeout[2/16/17]=3237216124/0/0 > > After reboot everything works again. Does your patch change the layout of the timeout structure? If so, the problem is that dtrace(1) is using the CTF from kern.bootfile, but that doesn't match the layout of the structures used by the running kernel.