From owner-freebsd-dtrace@freebsd.org Sun Oct 28 19:00:19 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 16E9010DD707 for ; Sun, 28 Oct 2018 19:00:19 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gate2.funkthat.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AFE16B109; Sun, 28 Oct 2018 19:00:18 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.15.2/8.15.2) with ESMTPS id w9SJ0AY7063365 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 28 Oct 2018 12:00:11 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.15.2/8.15.2/Submit) id w9SJ0AaC063364; Sun, 28 Oct 2018 12:00:10 -0700 (PDT) (envelope-from jmg) Date: Sun, 28 Oct 2018 12:00:10 -0700 From: John-Mark Gurney To: Mark Johnston Cc: Andreas Longwitz , "freebsd-dtrace@freebsd.org" Subject: Re: Why my DTrace script does not work after installing a new kernel without reboot Message-ID: <20181028190010.GF75530@funkthat.com> References: <5BD4E965.9040006@incore.de> <20181027225339.GA4191@spy> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181027225339.GA4191@spy> X-Operating-System: FreeBSD 11.0-RELEASE-p7 amd64 X-PGP-Fingerprint: D87A 235F FB71 1F3F 55B7 ED9B D5FF 5A51 C0AC 3D65 X-Files: The truth is out there X-URL: https://www.funkthat.com/ X-Resume: https://www.funkthat.com/~jmg/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (gold.funkthat.com [127.0.0.1]); Sun, 28 Oct 2018 12:00:11 -0700 (PDT) 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: Sun, 28 Oct 2018 19:00:19 -0000 Mark Johnston wrote this message on Sat, Oct 27, 2018 at 18:53 -0400: > 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. Except that the default make installkernel will adjust kern.bootfile to point to the correct old location.. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."