<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://elinux.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://elinux.org/index.php?title=Kernel_Function_Instrumentation&amp;feed=atom&amp;action=history</id>
		<title>Kernel Function Instrumentation - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://elinux.org/index.php?title=Kernel_Function_Instrumentation&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=Kernel_Function_Instrumentation&amp;action=history"/>
		<updated>2013-05-21T02:21:40Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.21alpha</generator>

	<entry>
		<id>http://elinux.org/index.php?title=Kernel_Function_Instrumentation&amp;diff=8463&amp;oldid=prev</id>
		<title>Tim Bird: fix link to KFI Docs and KFT page</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=Kernel_Function_Instrumentation&amp;diff=8463&amp;oldid=prev"/>
				<updated>2008-12-11T00:00:48Z</updated>
		
		<summary type="html">&lt;p&gt;fix link to KFI Docs and KFT page&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 00:00, 11 December 2008&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Image:Alert.gif]] - '''NOTE:''' ''KFI has been renamed to KFT (Kernel Function Trace) starting with the patches for kernel version 2.6.12.&amp;#160; If you are using a recent kernel, version 2.6.12 or later, please see the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;KernelFunctionTrace &lt;/del&gt;page &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;insteadof &lt;/del&gt;this one.''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Image:Alert.gif]] - '''NOTE:''' ''KFI has been renamed to KFT (Kernel Function Trace) starting with the patches for kernel version 2.6.12.&amp;#160; If you are using a recent kernel, version 2.6.12 or later, please see the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[Kernel Function Trace]] &lt;/ins&gt;page &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;instead of &lt;/ins&gt;this one.''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Introduction ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Introduction ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;*attachment:omap-serial_init.trace.txt - Sample trace used with presentation&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;*attachment:omap-serial_init.trace.txt - Sample trace used with presentation&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;For prior releases of KFI, see [&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;KFIDocs&amp;quot;&lt;/del&gt;]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;For prior releases of KFI, see [&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[KFI Docs]&lt;/ins&gt;]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Download ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;== Download ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key elinux:diff:version:1.11a:oldid:1479:newid:8463 --&gt;
&lt;/table&gt;</summary>
		<author><name>Tim Bird</name></author>	</entry>

	<entry>
		<id>http://elinux.org/index.php?title=Kernel_Function_Instrumentation&amp;diff=1479&amp;oldid=prev</id>
		<title>Wmat: /* Basic Use */</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=Kernel_Function_Instrumentation&amp;diff=1479&amp;oldid=prev"/>
				<updated>2006-11-27T19:52:12Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Basic Use&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 19:52, 27 November 2006&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 14:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 14:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Here's a presentation about KFI usage:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Here's a presentation about KFI usage:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;*&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[&lt;/del&gt;KFI-presentation.pdf &amp;quot;Learning the Kernel and Finding Performance Problems with KFI&amp;quot;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;*&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{{pdf|&lt;/ins&gt;KFI-presentation.pdf&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;|&lt;/ins&gt;&amp;quot;Learning the Kernel and Finding Performance Problems with KFI&amp;quot;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;*attachment:omap-serial_init.trace.txt - Sample trace used with presentation&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;*attachment:omap-serial_init.trace.txt - Sample trace used with presentation&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Wmat</name></author>	</entry>

	<entry>
		<id>http://elinux.org/index.php?title=Kernel_Function_Instrumentation&amp;diff=1477&amp;oldid=prev</id>
		<title>Wmat at 18:30, 27 November 2006</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=Kernel_Function_Instrumentation&amp;diff=1477&amp;oldid=prev"/>
				<updated>2006-11-27T18:30:02Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;http://elinux.org/index.php?title=Kernel_Function_Instrumentation&amp;amp;diff=1477&amp;amp;oldid=1476&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Wmat</name></author>	</entry>

	<entry>
		<id>http://elinux.org/index.php?title=Kernel_Function_Instrumentation&amp;diff=1476&amp;oldid=prev</id>
		<title>Wmat: Legacy Content Conversion</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=Kernel_Function_Instrumentation&amp;diff=1476&amp;oldid=prev"/>
				<updated>2006-11-27T15:29:28Z</updated>
		
		<summary type="html">&lt;p&gt;Legacy Content Conversion&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Image:Alert.gif]] - '''NOTE:''' ''KFI has been renamed to KFT (Kernel Function Trace) starting with the patches for kernel version 2.6.12.  If you are using a recent kernel, version 2.6.12 or later, please see the KernelFunctionTrace page insteadof this one.''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Kernel Function Instrumentation (KFI) is a kernel function tracing system, which uses the &amp;quot;-finstrument-functions&amp;quot; capability of the gcc compiler to add instrumentation callouts to every function entry and exit.  The KFI system provides for capturing these callouts and generating a trace of events, with timing details.  KFI is excellent at providing a good timing overview of kernel procedures, allowing you to see where time is spent in functions and sub-routines in the kernel.&lt;br /&gt;
&lt;br /&gt;
The main mode of operation with KFI is to use the system with a dynamic trace configuration. That is, you can set a trace configuration after kernel startup, using the &amp;lt;code&amp;gt;/proc/kfi&amp;lt;/code&amp;gt; interface, and retrieve trace data immediately. However, another (special) mode of operation is available, called STATIC_RUN mode, where the configuration for a KFI run is configured and compiled statically into the kernel.  This mode is useful for getting a trace of kernel operation during system bootup (before user space is running).&lt;br /&gt;
&lt;br /&gt;
The KFI configuration lets you specify how to automatically start and stop a trace, whether to include interrupts as part of the trace, and whether to filter the trace data by various criteria (for minimum function duration, only certain listed functions, etc.)  KFI trace data is retrieved by reading from &amp;lt;code&amp;gt;/proc/kfi_trace&amp;lt;/code&amp;gt; after the trace is complete.&lt;br /&gt;
&lt;br /&gt;
Tools are supplied to convert numeric trace data to kernel symbols, and to process and analyze the data in a KFI trace.&lt;br /&gt;
&lt;br /&gt;
== Basic Use ==&lt;br /&gt;
Documentation for KFI is available (as of 2.6.11) in Documentation/kfi.txt, after applying the kfi-2.patch.&lt;br /&gt;
&lt;br /&gt;
Here's a presentation about KFI usage:&lt;br /&gt;
*[KFI-presentation.pdf &amp;quot;Learning the Kernel and Finding Performance Problems with KFI&amp;quot;]&lt;br /&gt;
*attachment:omap-serial_init.trace.txt - Sample trace used with presentation&lt;br /&gt;
&lt;br /&gt;
For prior releases of KFI, see [&amp;quot;KFIDocs&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
=== Patches ===&lt;br /&gt;
*Patch for CELF kernel (based on linux-2.4.20): attachment:kfi-24-test4.patch&lt;br /&gt;
*Patch for Linux 2.6.7 (for x86 only): attachment:kfi-26-test1.patch&lt;br /&gt;
*Patch for Linux 2.6.8.1: see the PatchArchive page&lt;br /&gt;
*Patch for Linux 2.6.11: see the PatchArchive page (or just download attachment:kfi-2.patch)&lt;br /&gt;
&lt;br /&gt;
=== KFI utilities ===&lt;br /&gt;
*User-space programs: attachment:kfi-0.8.tar.gz (for KFI version 1)&lt;br /&gt;
&lt;br /&gt;
For KFI version 2 and above, the only user-space programs are scripts, which are now located in the kernel &amp;lt;code&amp;gt;scripts&amp;lt;/code&amp;gt; directory:&lt;br /&gt;
*addr2sym - script to convert function addresses to symbols in the trace data&lt;br /&gt;
*kd - kfi dump - does filtering, sorting, and analysis of KFI trace logs&lt;br /&gt;
&lt;br /&gt;
See Documentation/kfi.txt for instructions on using these programs.&lt;br /&gt;
&lt;br /&gt;
== How To Use ==&lt;br /&gt;
*download both the patch&lt;br /&gt;
*apply the patch in the kernel top-level directory:&lt;br /&gt;
*patch -p1 &amp;lt;kfi-2.patch&lt;br /&gt;
*read the rest of the instructions in the Documentation/kfi.txt file. (my apologies for being lazy!)&lt;br /&gt;
&lt;br /&gt;
=== Adding platform support for the kfi clock source ===&lt;br /&gt;
The current patch (from Sep 2004), uses sched_clock() as the clock source for kfi_readclock(). sched_clock() is new in the 2.6 kernel, and returns a 64-bit value containing nanoseconds (not necessarily relative to any particular time base, but assumed to be monotonically increasing, and relatively frequency-stable.)&lt;br /&gt;
&lt;br /&gt;
If your platform has good support for sched_clock(), then KFI should work for you unmodified. If not, you may wish to do one of two things:&lt;br /&gt;
*improve support for sched_clock() in your board port, or&lt;br /&gt;
*write a custom kfi_readclock() routine.&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;good&amp;quot; sched_clock() routine will provide at least microsecond resolution on return values. Some architectures have sched_clock() returning values based on the &amp;lt;code&amp;gt;jiffy&amp;lt;/code&amp;gt; variable, which on many embedded platforms only has resolution to 10 milliseconds.&lt;br /&gt;
&lt;br /&gt;
There are some sample custom kfi_readclock() routines in the current patch (one for x86 using the TSC, and one for PPC using the TBU.&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
Here is a list of things that need more work:&lt;br /&gt;
*may need to add noinstrument attributes for some time-critical code (need to check this)&lt;br /&gt;
*maybe can check &amp;quot;Function Trace in KDB&amp;quot; patch for help with this&lt;br /&gt;
*would like a tutorial on the configuration language for defining a tracing run&lt;br /&gt;
*documentation needs lots of work&lt;br /&gt;
*should especially document how to do a dynamic trace&lt;br /&gt;
&lt;br /&gt;
=== Overhead ===&lt;br /&gt;
Mitsubishi measured the overhead of KFI.&lt;br /&gt;
The period is from start_kernel() to smp_init().&lt;br /&gt;
Platform was: SH7751R 240MHz (Memory Clock 80MHz)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
With KFI    : 922.419 msec&lt;br /&gt;
Without KFI : 666.982 msec&lt;br /&gt;
Overhead    : 27.69%&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Similar technologies ==&lt;br /&gt;
There are other technologies for doing call traces or kernel profiling that are similar to KFI.  Some of these are mentioned on the KernelInstrumentation page.&lt;br /&gt;
&lt;br /&gt;
One that is very similar is a kernel trace mechanism for use with KDB. A patch was posted to LKML in January of 2002.  See the message:&lt;br /&gt;
http://www.uwsg.iu.edu/hypermail/linux/kernel/0201.3/0888.html&lt;br /&gt;
&lt;br /&gt;
== Filter Q&amp;amp;A ==&lt;br /&gt;
Tim asked the question:&lt;br /&gt;
&lt;br /&gt;
Q. Is there a way to adjust the trigger or filters to reduce the memory usage?&lt;br /&gt;
&lt;br /&gt;
A. Todd Poynor from MontaVista answered:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
kfistatic.conf&lt;br /&gt;
  begin&lt;br /&gt;
     trigger start entry start_kernel&lt;br /&gt;
     trigger stop entry to_userspace&lt;br /&gt;
     filter mintime 1&lt;br /&gt;
     filter maxtime 0&lt;br /&gt;
  #   filter noints&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above filters out only those routines that take less than 1 microsecond.  We usually are not interested in routines that execute so quickly, and instead use something like &amp;quot;filter mintime 500&amp;quot; to filter out routines taking less than 500 microseconds.&lt;br /&gt;
&lt;br /&gt;
I didn't track down the original log file being discussed, but if the &amp;quot;quiet&amp;quot; command line parameter wasn't used then even a 500us filter may include a lot of calls for serial console printks.&lt;br /&gt;
&lt;br /&gt;
The filters don't affect memory usage so far as I understand.  You can set the amount of memory used for a static run by specifying &amp;quot;logsize &amp;lt;n&amp;gt;&amp;quot;, where &amp;lt;n&amp;gt; is the number of entries, in kfistatic.conf.&lt;br /&gt;
----&lt;br /&gt;
Q. Is it possible to specifically omit certain routines with a filter.&lt;br /&gt;
&lt;br /&gt;
A. I believe there's a filter for including only certain routines (rather than excluding certain routines).  It shouldn't normally be necessary, but if there's a routine that matches the time filtering suggested above and is called so often as to be a problem, then adding attribute &amp;quot;__noinstrument&amp;quot; to the function definition and recompiling will exclude it; see drivers/char/kfi.c for an example.&lt;br /&gt;
&lt;br /&gt;
== Sample results ==&lt;br /&gt;
Here is an excerpt from a KFI log trace (processed with addr2sym). It shows all functions which lasted longer than 500 microseconds, from when the kernel entered start_kernel() to when it entered to_userspace().&lt;br /&gt;
&lt;br /&gt;
=== kfi log output (excerpt) ===&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Kernel Instrumentation Run ID 0&lt;br /&gt;
&lt;br /&gt;
Logging started at 6785045 usec by entry to function start_kernel&lt;br /&gt;
Logging stopped at 8423650 usec by entry to function to_userspace&lt;br /&gt;
&lt;br /&gt;
Filters:&lt;br /&gt;
	500 usecs minimum execution time&lt;br /&gt;
&lt;br /&gt;
Filter Counters:&lt;br /&gt;
&lt;br /&gt;
Execution time filter count = 896348&lt;br /&gt;
Total entries filtered = 896348&lt;br /&gt;
Entries not found = 24&lt;br /&gt;
&lt;br /&gt;
Number of entries after filters = 1757&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Entry      Delta      PID            Function                    Called At&lt;br /&gt;
--------   --------   -----   -------------------------   &lt;br /&gt;
       1          0       0                start_kernel   L6+0x0&lt;br /&gt;
      14       8687       0                  setup_arch   start_kernel+0x35&lt;br /&gt;
      39        891       0                setup_memory   setup_arch+0x2a8&lt;br /&gt;
      53        872       0   register_bootmem_low_pages   setup_memory+0x8f&lt;br /&gt;
      54        871       0                free_bootmem   register_bootmem_low_pages+0x95&lt;br /&gt;
      54        871       0           free_bootmem_core   free_bootmem+0x34&lt;br /&gt;
     930       7432       0                 paging_init   setup_arch+0x2af&lt;br /&gt;
     935       7427       0             zone_sizes_init   paging_init+0x4e&lt;br /&gt;
     935       7427       0              free_area_init   zone_sizes_init+0x83&lt;br /&gt;
     935       7427       0         free_area_init_node   free_area_init+0x4b&lt;br /&gt;
     935       3759       0        __alloc_bootmem_node   free_area_init_node+0xc5&lt;br /&gt;
     935       3759       0        __alloc_bootmem_core   __alloc_bootmem_node+0x43&lt;br /&gt;
    4694       3668       0         free_area_init_core   free_area_init_node+0x75&lt;br /&gt;
    4817       3535       0            memmap_init_zone   free_area_init_core+0x2bd&lt;br /&gt;
    8807     266911       0                   time_init   start_kernel+0xb6&lt;br /&gt;
    8807     261404       0               get_cmos_time   time_init+0x1c&lt;br /&gt;
  270211       5507       0                select_timer   time_init+0x41&lt;br /&gt;
  270211       5507       0                    init_tsc   select_timer+0x45&lt;br /&gt;
  270211       5507       0               calibrate_tsc   init_tsc+0x6c&lt;br /&gt;
  275718       1638       0                console_init   start_kernel+0xbb&lt;br /&gt;
  275718       1638       0                    con_init   console_init+0x59&lt;br /&gt;
  275954        733       0          vgacon_save_screen   con_init+0x288&lt;br /&gt;
  277376       6730       0                    mem_init   start_kernel+0xf8&lt;br /&gt;
  277376       1691       0            free_all_bootmem   mem_init+0x52&lt;br /&gt;
  277376       1691       0       free_all_bootmem_core   free_all_bootmem+0x24&lt;br /&gt;
  284118      25027       0             calibrate_delay   start_kernel+0x10f&lt;br /&gt;
  293860        770       0                     __delay   calibrate_delay+0x62&lt;br /&gt;
  293860        770       0                   delay_tsc   __delay+0x26&lt;br /&gt;
  294951       1534       0                     __delay   calibrate_delay+0x62&lt;br /&gt;
  294951       1534       0                   delay_tsc   __delay+0x26&lt;br /&gt;
  297134       1149       0                     __delay   calibrate_delay+0xbe&lt;br /&gt;
  297134       1149       0                   delay_tsc   __delay+0x26&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
 1638605          0     145              filemap_nopage   do_no_page+0xef&lt;br /&gt;
 1638605          0     145                 __lock_page   filemap_nopage+0x286&lt;br /&gt;
 1638605          0     145                 io_schedule   __lock_page+0x95&lt;br /&gt;
 1638605          0     145                    schedule   io_schedule+0x24&lt;br /&gt;
 1638605          0       5                    schedule   worker_thread+0x217&lt;br /&gt;
 1638605          0       1                to_userspace   init+0xa6&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The log is attached here: attachment:kfiboot-9.lst&lt;br /&gt;
A Delta value of 0 usually means the exit from the routine was not seen.&lt;br /&gt;
&lt;br /&gt;
=== kfi log analysis with 'kd' ===&lt;br /&gt;
Below is a &amp;lt;code&amp;gt;kd&amp;lt;/code&amp;gt; dump of the data from the above log.&lt;br /&gt;
&lt;br /&gt;
For the purpose of finding areas of big time in the kernel, the functions with high &amp;quot;Local&amp;quot; time are important.  For example, &amp;lt;code&amp;gt;delay_tsc()&amp;lt;/code&amp;gt; is called 156 times, resulting in 619 milliseconds of duration.  Other time-consuming routines were: &amp;lt;code&amp;gt;isapnp_isolate()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;get_cmos_time()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;default_idle()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The top line showing schedule() called 192 times and lasting over 5 seconds, is accounted wrong due to the switch in execution control inside the schedule routine.  (The count of 192 calls is correct, but the duration is wrong.)&lt;br /&gt;
&lt;br /&gt;
$ ~/work/kfi/kfi/kd -n 30 kfiboot-9.lst&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Function                  Count Time     Average  Local&lt;br /&gt;
------------------------- ----- -------- -------- --------&lt;br /&gt;
schedule                    192  5173790    26946  5173790&lt;br /&gt;
do_basic_setup                1  1159270  1159270       14&lt;br /&gt;
do_initcalls                  1  1159256  1159256      627&lt;br /&gt;
__delay                     156   619322     3970        0&lt;br /&gt;
delay_tsc                   156   619322     3970   619322&lt;br /&gt;
__const_udelay              146   608427     4167        0&lt;br /&gt;
probe_hwif                    8   553972    69246      126&lt;br /&gt;
do_probe                     31   553025    17839       68&lt;br /&gt;
ide_delay_50ms              103   552588     5364        0&lt;br /&gt;
isapnp_init                   1   383138   383138       18&lt;br /&gt;
isapnp_isolate                1   383120   383120   311629&lt;br /&gt;
ide_init                      1   339778   339778       22&lt;br /&gt;
probe_for_hwifs               1   339756   339756      103&lt;br /&gt;
ide_scan_pcibus               1   339653   339653       13&lt;br /&gt;
init_setup_piix               2   339640   169820        0&lt;br /&gt;
ide_scan_pcidev               2   339640   169820        0&lt;br /&gt;
piix_init_one                 2   339640   169820        0&lt;br /&gt;
ide_setup_pci_device          2   339640   169820      242&lt;br /&gt;
probe_hwif_init               4   339398    84849       40&lt;br /&gt;
time_init                     1   266911   266911        0&lt;br /&gt;
get_cmos_time                 1   261404   261404   261404&lt;br /&gt;
ide_generic_init              1   214614   214614        0&lt;br /&gt;
ideprobe_init                 1   214614   214614        0&lt;br /&gt;
wait_for_completion           6   194573    32428        0&lt;br /&gt;
default_idle                183   192589     1052   192589&lt;br /&gt;
io_schedule                  18   171313     9517        0&lt;br /&gt;
__wait_on_buffer             14   150369    10740      141&lt;br /&gt;
i8042_init                    1   137210   137210      295&lt;br /&gt;
i8042_port_register           2   135318    67659      301&lt;br /&gt;
__serio_register_port         2   135017    67508        0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Kernel Function Instrumentaiton]]&lt;/div&gt;</summary>
		<author><name>Wmat</name></author>	</entry>

	</feed>