From owner-freebsd-hackers@freebsd.org Sat Aug 12 20:17:02 2017 Return-Path: Delivered-To: freebsd-hackers@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 5BDEDDC7BBB for ; Sat, 12 Aug 2017 20:17:02 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [78.47.246.247]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E19CD6FD30 for ; Sat, 12 Aug 2017 20:17:01 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id v7CKChPr034191 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 12 Aug 2017 22:12:44 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: khanzf@gmail.com Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id v7CKCcxq028571 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sun, 13 Aug 2017 03:12:38 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: Monitor kernel variable with ddb(4) To: Farhan Khan , freebsd-hackers@freebsd.org References: From: Eugene Grosbein Message-ID: <598F6131.3090002@grosbein.net> Date: Sun, 13 Aug 2017 03:12:33 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS * 2.6 LOCAL_FROM From my domains X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Aug 2017 20:17:02 -0000 13.08.2017 2:42, Farhan Khan пишет: > Hi all, > > I am trying to figure out where a net80211's vap flags are modified. I see > that memory is originally allocated here: > http://src.illumos.org/source/xref/freebsd-head/sys/net/if.c#445. However, > I cannot figure out where the ifp->if_flags and if->if_drv_flags are ever > modified in the kernel. > > Someone suggested using ddb(4), so I entered the live debugger using sysctl > debug.kdb.enter=1 > > I then set a breakpoint at if_alloc. > > However, I cannot seem to figure out the next steps to monitor where the > ifp->if_flags or if->if_drv_flags are updated. > > Full explanation - My kernel module is immediately unloading, but I am not > certain why. I traced it back in the ieee80211 code to those flags, but not > sure where they are updated. > > Any ideas? Thank you! What driver do you use? There are lots of kernel level files that change ifp->if_flags and if->if_drv_flags: $ grep -lER '\