<?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=KFI_Docs&amp;feed=atom&amp;action=history</id>
		<title>KFI Docs - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://elinux.org/index.php?title=KFI_Docs&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=KFI_Docs&amp;action=history"/>
		<updated>2013-05-25T01:59:14Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.22alpha</generator>

	<entry>
		<id>http://elinux.org/index.php?title=KFI_Docs&amp;diff=69739&amp;oldid=prev</id>
		<title>Adushistova at 09:57, 27 October 2011</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=KFI_Docs&amp;diff=69739&amp;oldid=prev"/>
				<updated>2011-10-27T09:57:44Z</updated>
		
		<summary type="html">&lt;p&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; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 09:57, 27 October 2011&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 98:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 98:&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-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; - int id;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; - int id;&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-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; - struct kfi_run * next;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; - struct kfi_run * next;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Development Tools]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Tips and Tricks]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key elinux:diff:version:1.11a:oldid:2007:newid:69739 --&gt;
&lt;/table&gt;</summary>
		<author><name>Adushistova</name></author>	</entry>

	<entry>
		<id>http://elinux.org/index.php?title=KFI_Docs&amp;diff=2007&amp;oldid=prev</id>
		<title>RBot: Bot (Edward's framework)</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=KFI_Docs&amp;diff=2007&amp;oldid=prev"/>
				<updated>2007-03-06T03:34:03Z</updated>
		
		<summary type="html">&lt;p&gt;Bot (Edward&amp;#039;s framework)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This is documentation for using KFI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See &amp;lt;code&amp;gt;README.kfi&amp;lt;/code&amp;gt; inside the kfi user-space tarfile for a quick overview.&lt;br /&gt;
&lt;br /&gt;
Rough outline:&lt;br /&gt;
== Introduction ==&lt;br /&gt;
 - Description&lt;br /&gt;
 - Theory of operation&lt;br /&gt;
   - callout instrumentation&lt;br /&gt;
     - gcc option&lt;br /&gt;
       - -finstrument_functions&lt;br /&gt;
   - static run vs. dynamic run&lt;br /&gt;
     - initiating and terminating a trace run&lt;br /&gt;
   - reading the data from the trace buffer&lt;br /&gt;
  - trace buffer size issues&lt;br /&gt;
  - tracing overhead issues&lt;br /&gt;
&lt;br /&gt;
== Using KFI ==&lt;br /&gt;
 - Apply patch found at [[Kernel Function Instrumentation]]&lt;br /&gt;
 - configure kernel&lt;br /&gt;
   - decide whether to do a static or dynamic run&lt;br /&gt;
   - edit kfistatic.conf&lt;br /&gt;
 - compile kfi for target&lt;br /&gt;
   - Makefile uses $CROSS_COMPILE to indicate toolchain prefix (same as Linux kernel)&lt;br /&gt;
     - set this in environment variable, and run make&lt;br /&gt;
 - make device node on target&lt;br /&gt;
   - execute the command &amp;lt;code&amp;gt;mknod /dev/kfi c 10 51&amp;lt;/code&amp;gt; on the target&lt;br /&gt;
static run:&lt;br /&gt;
 - run kernel&lt;br /&gt;
 - run &amp;lt;code&amp;gt;kfi&amp;lt;/code&amp;gt; to collect trace buffer&lt;br /&gt;
 - run post-trace tools to examine data&lt;br /&gt;
dynamic run:&lt;br /&gt;
 - run kernel&lt;br /&gt;
 - run &amp;lt;code&amp;gt;kfi&amp;lt;/code&amp;gt; to set up a trace&lt;br /&gt;
 - run &amp;lt;code&amp;gt;kfi&amp;lt;/code&amp;gt; to read a trace&lt;br /&gt;
 - run post-trace tools to examine data&lt;br /&gt;
&lt;br /&gt;
== Using the post-trace analysis tools ==&lt;br /&gt;
 - kfiresolve.py&lt;br /&gt;
   - resolves numeric addresses to function names, in a kfiboot log&lt;br /&gt;
   - requires System.map for kernel from which dump was made&lt;br /&gt;
 - kd - kfiboot dump&lt;br /&gt;
   - filters and formats a kfiboot log&lt;br /&gt;
   - finds time spent locally and in sub-functions, to isolate where time is being spent&lt;br /&gt;
 - kt - kfi tree (not finished yet)&lt;br /&gt;
   - generates call tree from kfiboot log, and reports time spent in branches&lt;br /&gt;
&lt;br /&gt;
== Configuring a kfi trace ==&lt;br /&gt;
 - kfistatic.conf&lt;br /&gt;
   - filters:&lt;br /&gt;
     - start&lt;br /&gt;
     - stop&lt;br /&gt;
     - time threshold (duration)&lt;br /&gt;
     - interrupt&lt;br /&gt;
     - user id (not implemented yet)&lt;br /&gt;
&lt;br /&gt;
Filter types:&lt;br /&gt;
 - DEV/NONE - system call???&lt;br /&gt;
 - TIME - time since boot or start of trace&lt;br /&gt;
 - FUNC_ENTRY - function entry&lt;br /&gt;
 - FUNC_EXIT - function exit&lt;br /&gt;
 - LOG_FULL - trace buffer full&lt;br /&gt;
 - multiple trace buffers??&lt;br /&gt;
&lt;br /&gt;
== Tasks: ==&lt;br /&gt;
 - creating a static run&lt;br /&gt;
 - creating a dynamic run&lt;br /&gt;
&lt;br /&gt;
== Miscelaneous Info ==&lt;br /&gt;
 - trace structures:&lt;br /&gt;
   - trigger structure:&lt;br /&gt;
     - type (one of: DEV, NONE, TIME, ENTRY, EXIT, FULL)&lt;br /&gt;
     - time or func_addr&lt;br /&gt;
     - mark - time at which this trigger occurred&lt;br /&gt;
   - filter structure&lt;br /&gt;
     - min_delta&lt;br /&gt;
     - max_delta&lt;br /&gt;
     - no_ints&lt;br /&gt;
     - only_ints&lt;br /&gt;
     - func_list - list of functions&lt;br /&gt;
   - trace entry structure&lt;br /&gt;
     - va - VA of instrumented function&lt;br /&gt;
     - call_site - where this func was called from&lt;br /&gt;
     - time - function entry time since trigger start time, in usec&lt;br /&gt;
     - delta - delta time from entry to exit, in usec&lt;br /&gt;
     - pid - process ID at time of call&lt;br /&gt;
   - run structure&lt;br /&gt;
     - int triggered;&lt;br /&gt;
        - int complete;&lt;br /&gt;
        - struct kfi_trigger start_trigger;&lt;br /&gt;
        - struct kfi_trigger stop_trigger;&lt;br /&gt;
        - struct kfi_filters filters;&lt;br /&gt;
        - struct kfi_entry* log;&lt;br /&gt;
        - int num_entries;&lt;br /&gt;
        - int next_entry;&lt;br /&gt;
        - int id;&lt;br /&gt;
        - struct kfi_run * next;&lt;/div&gt;</summary>
		<author><name>RBot</name></author>	</entry>

	</feed>