Bug 19997

Summary: [PATCH] Addition of info about debug kernels to the FAQ
Product: Documentation Reporter: eogren <eogren>
Component: Books & ArticlesAssignee: ben <ben>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description eogren 2000-07-18 03:30:01 UTC
 There have been a couple more "why is my kernel so huge??" questions on
the mailing lists recently, so I thought adding an entry to the FAQ about
debug kernels would be a good idea. I stuck in the Kernel Configuration
section; I'm not sure if it's better there or under System Administration. 
 I seem to remember this being batted around -doc a couple of days ago by
somebody else (Ben Smithurst maybe?), but I deleted all of that email, and
I can't see any other entries having to do with debug kernels in the FAQ,
so...

 >How-To-Repeat: 

n/a
Comment 1 ben freebsd_committer freebsd_triage 2000-07-18 13:42:50 UTC
eogren@earthlink.net wrote:

>  I seem to remember this being batted around -doc a couple of days ago by
> somebody else (Ben Smithurst maybe?), but I deleted all of that email, and
> I can't see any other entries having to do with debug kernels in the FAQ,
> so...

Ah...  I was talking about a similar thing, for the handbook.  Perhaps
that's what you were thinking of.  Having this in the FAQ could be
useful...

>  <qandaentry><question>
> +<para>Why is my kernel so big (over 10MB)?</para></question><answer>
> +
> +<para>Chances are, you compiled your kernel in <emphasis>debug
> +mode</emphasis>. Kernels built in debug mode contain many symbols that
> +are used for debugging, thus greatly increasing the size of the
> +kernel. Note that if you running a FreeBSD 3.0 or later system, there
> +will be little or no performance decrease from running a debug
> +kernel, and it is useful to keep one around in case of a system
> +panic.</para>
> +<para>However, if you are running low on disk space, or you simply
> +don't want to run a debug kernel, make sure that:</para>
> +<itemizedlist>
> + <listitem><para>You do not have a line in your kernel configuration file
> + that reads <emphasis>makeoptions DEBUG=-g</emphasis>,
> + and</para></listitem>
> + 
> + <listitem><para>You are not running <command>config</command> with the
> + <option>-g</option> option.</para></listitem>
> +</itemizedlist>
> +
> +<para>Both of the above situations will cause your kernel to be built
> +in debug mode. As long as you make sure you follow the steps above,
> +you can build your kernel normally, and you should notice a fairly
> +large size decrease; most kernels tend to be around 1.5MB to 2MB.</para>
> +</answer></qandaentry>  

Two minor points:

1.  Generally, two spaces are used after a fullstop in documentation.
I'm not sure how important this is.

2.  Indentation.  As Nik told me, new questions should be indented
correctly, even though the rest of the FAQ isn't.  Indentation rules
are described in the FDP primer.  For the FAQ, you need 6 spaces before
the <qandaentry> (check at the top of the FAQ -- this is because of
the number of outer tags, not some specific rule for the FAQ) and
then follow the normal rules.  If you don't have 6 spaces before the
</qandaentry> at the end you've gone wrong somewhere.

The actual text looks good though.  There's a couple of other things I'm
putting in there soon.  ("Why do I have so little free memory" and "Why
have I got -RC instead of -STABLE" gives the general idea.)

-- 
Ben Smithurst                 / ben@FreeBSD.org / PGP: 0x99392F7D
FreeBSD Documentation Project /
Comment 2 eogren 2000-07-18 14:33:16 UTC
On Tue, Jul 18, 2000 at 01:42:50PM +0100, Ben Smithurst wrote:
> eogren@earthlink.net wrote:
> 
> >  I seem to remember this being batted around -doc a couple of days ago by
> > somebody else (Ben Smithurst maybe?), but I deleted all of that email, and
> > I can't see any other entries having to do with debug kernels in the FAQ,
> > so...
> 
> Ah...  I was talking about a similar thing, for the handbook.  Perhaps
> that's what you were thinking of.  Having this in the FAQ could be
> useful...
> 

Yup, that was it.
> 
> Two minor points:
> 
> 1.  Generally, two spaces are used after a fullstop in documentation.
> I'm not sure how important this is.

Bleh. Old habits are hard to break. :)

> 
> 2.  Indentation.  As Nik told me, new questions should be indented
> correctly, even though the rest of the FAQ isn't.  Indentation rules
> are described in the FDP primer.  For the FAQ, you need 6 spaces before
> the <qandaentry> (check at the top of the FAQ -- this is because of
> the number of outer tags, not some specific rule for the FAQ) and
> then follow the normal rules.  If you don't have 6 spaces before the
> </qandaentry> at the end you've gone wrong somewhere.
> 

OK, I can fix that pretty easily, probably tonight sometimes.

Eric

> The actual text looks good though.  There's a couple of other things I'm
> putting in there soon.  ("Why do I have so little free memory" and "Why
> have I got -RC instead of -STABLE" gives the general idea.)
Comment 3 ben freebsd_committer freebsd_triage 2000-07-18 17:28:36 UTC
Responsible Changed
From-To: freebsd-doc->ben

I'll handle this.
Comment 4 ben freebsd_committer freebsd_triage 2000-07-18 22:48:37 UTC
Eric Ogren wrote:

> OK, I can fix that pretty easily, probably tonight sometimes.

Hmm, don't bother.  I did it myself actually. :-)

Index: book.sgml
===================================================================
RCS file: /usr/cvs/doc/en_US.ISO_8859-1/books/faq/book.sgml,v
retrieving revision 1.72
diff -u -r1.72 book.sgml
--- book.sgml	2000/07/16 20:39:43	1.72
+++ book.sgml	2000/07/18 20:40:28
@@ -4099,6 +4099,47 @@
 
 </answer></qandaentry>
 
+      <qandaentry>
+        <question>
+          <para>Why is my kernel so big (over 10MB)?</para>
+        </question>
+
+        <answer>
+          <para>Chances are, you compiled your kernel in
+            <emphasis>debug mode</emphasis>.  Kernels built in debug
+            mode contain many symbols that are used for debugging, thus
+            greatly increasing the size of the kernel.  Note that if you
+            running a FreeBSD 3.0 or later system, there will be little
+            or no performance decrease from running a debug kernel,
+            and it is useful to keep one around in case of a system
+            panic.</para>
+
+          <para>However, if you are running low on disk space, or
+            you simply don't want to run a debug kernel, make sure
+            that both of the following are true:</para>
+
+          <itemizedlist>
+            <listitem>
+              <para>You do not have a line in your kernel
+                configuration file that reads:</para>
+
+              <programlisting>makeoptions DEBUG=-g</programlisting>
+            </listitem>
+
+            <listitem>
+              <para>You are not running <command>config</command> with
+                the <option>-g</option> option.</para>
+            </listitem>
+          </itemizedlist>
+
+          <para>Both of the above situations will cause your kernel to
+            be built in debug mode.  As long as you make sure you follow
+            the steps above, you can build your kernel normally, and you
+            should notice a fairly large size decrease; most kernels
+            tend to be around 1.5MB to 2MB.</para>
+        </answer>
+      </qandaentry>  
+
 <qandaentry><question>
 <para>Interrupt conflicts with multi-port serial code.</para></question><answer>
 

I'll probably commit this tomorrow unless anyone shouts at me.

-- 
Ben Smithurst                 / ben@FreeBSD.org / PGP: 0x99392F7D
FreeBSD Documentation Project /
Comment 5 ben freebsd_committer freebsd_triage 2000-07-19 20:17:47 UTC
State Changed
From-To: open->closed

Committed, thanks!