From owner-freebsd-hackers@freebsd.org Sat Jul 25 09:25:33 2015 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 0BCFE9A9ABC for ; Sat, 25 Jul 2015 09:25:33 +0000 (UTC) (envelope-from hetakcoder@gmail.com) Received: from mail-wi0-x22d.google.com (mail-wi0-x22d.google.com [IPv6:2a00:1450:400c:c05::22d]) (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 7118BA73; Sat, 25 Jul 2015 09:25:32 +0000 (UTC) (envelope-from hetakcoder@gmail.com) Received: by wibxm9 with SMTP id xm9so54044809wib.0; Sat, 25 Jul 2015 02:25:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=HsdvCDwfg5iTt+wj0a3NCwJNiQtET7eK+yfkLJaNIKw=; b=IpcFY5El40I1RzZMZPHEbjompIvO9puwxCJ4sGERelvh5iFB83ZIlmYDR4o3fuid5a QCfjaBLRnnX3XAC92/7ni7LfVIRiUv5rTucAZqHrXKsPzOuc5HBWGyIEoxYSha0NHxzR BDSKB7ke5rxJ3YEfnRiQ8T0CyZWVZbQinjQrs/PZ4ji/5zq5QJpsthQaKRB6p+IF5wQu PUdjLQj5FrVr3sSUmGsn9g01XKhEF/5dxwaRJFx+MuO4M96KrUVnaF1lK3zw6aiNaf3N hZWWSjMCOeomo1WzQWlq+dD8VAPHIYcZmttS+ZdmcrSskoHYbtUKBrnS59eW9bEjMKJg jwPw== X-Received: by 10.180.14.101 with SMTP id o5mr5154929wic.82.1437816329977; Sat, 25 Jul 2015 02:25:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.68.233 with HTTP; Sat, 25 Jul 2015 02:24:50 -0700 (PDT) In-Reply-To: <514DDE7F-CF61-461D-A9FF-232DC938BDF5@FreeBSD.org> References: <514DDE7F-CF61-461D-A9FF-232DC938BDF5@FreeBSD.org> From: HeTak Date: Sat, 25 Jul 2015 13:54:50 +0430 Message-ID: Subject: Re: Kernel Debug Howto To: Kristof Provost Cc: freebsd-hackers Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 09:25:33 -0000 On Sat, Jul 25, 2015 at 1:41 PM, Kristof Provost wrote: > > > On 25 Jul 2015, at 10:54, HeTak wrote: > > I have recently started some developments on FreeBSD net section. > Great! > =E2=80=8BThank you Kristof, b oth for your fast answering and your welcome.=E2=80=8B :) > > > But I am kinda new to this field. My base interest is to first > understand the > > implementation structure via tracing the code and so. > > > > I have three major questions: > > 1- how to debug changes made to FreeBSD kernel? > > (You know, till some levels, I can even use uprintf or so, but, for > example > > inside radix.c (where I wanna understand how a route is checked to be > > unique and then inserted to the tree) I can't do such checks..) > dtrace can be quite useful to understand flows. You can grab stack traces > (i.e. figure out where things are called from), get function arguments, = =E2=80=A6 > > 2- are there standards there for freebsd kernel developments of which I > can > > follow so my job gets a bit simplified? > > (Any development guides or so?I prospect it to be some differences > between > > system developments and normal coding, but I don't have an idea on how = to > > get that). > There=E2=80=99s style(9) for coding style. > I=E2=80=99d also recommend "The Design and Implementation of the FreeBSD = Operating > System=E2=80=9D > (the second edition). > > > 3- what is the fastest way to apply changes to FreeBSD kernel? > > (For now, I just follow the normal build & install kernel & reboot.) > I pretty much do that. Depending on what you=E2=80=99re working on it mig= ht be > easier to run it in a VM. > My work lately has been on the network code, so a VM is very convenient. > It=E2=80=99s not so useful if you=E2=80=99re working on drivers, of cours= e. > =E2=80=8B =E2=80=8BGreat to hear of such a tool as Dtrace and also the book. and actu= ally I'm using a VM as well. =E2=80=8B =E2=80=8BI'll check these and hope to be successful through my way. > > Regards, > Kristof =E2=80=8BCheerio, HeTak=E2=80=8B