diff options
author | Steven Rostedt <rostedt@goodmis.org> | 2010-04-09 11:57:28 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-04-09 11:57:28 -0400 |
commit | 933e3d54c021be56213b1475e5ac4fbebc7b48f1 (patch) | |
tree | 224dfeb650b918a23603c8a97f505ba5e7ced321 | |
parent | cf3a11c410f0f5453c2140c8737295f70bb33e3b (diff) |
kerselshark/doc: Add html documentation on how to use kernelshark
Add documentation on how to use kernelshark.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
35 files changed, 631 insertions, 0 deletions
diff --git a/Documentation/HTML/images/kshark-cursor-1.png b/Documentation/HTML/images/kshark-cursor-1.png new file mode 100644 index 0000000..64d19be --- /dev/null +++ b/Documentation/HTML/images/kshark-cursor-1.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-filter-advance-1.png b/Documentation/HTML/images/kshark-filter-advance-1.png new file mode 100644 index 0000000..23f6584 --- /dev/null +++ b/Documentation/HTML/images/kshark-filter-advance-1.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-filter-del-adv.png b/Documentation/HTML/images/kshark-filter-del-adv.png new file mode 100644 index 0000000..88e2376 --- /dev/null +++ b/Documentation/HTML/images/kshark-filter-del-adv.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-filter-event-adv-list.png b/Documentation/HTML/images/kshark-filter-event-adv-list.png new file mode 100644 index 0000000..c2f2d52 --- /dev/null +++ b/Documentation/HTML/images/kshark-filter-event-adv-list.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-filter-events-sched.png b/Documentation/HTML/images/kshark-filter-events-sched.png new file mode 100644 index 0000000..0941317 --- /dev/null +++ b/Documentation/HTML/images/kshark-filter-events-sched.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-filter-events.png b/Documentation/HTML/images/kshark-filter-events.png new file mode 100644 index 0000000..4732f8a --- /dev/null +++ b/Documentation/HTML/images/kshark-filter-events.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-filter-list-adv-irq.png b/Documentation/HTML/images/kshark-filter-list-adv-irq.png new file mode 100644 index 0000000..0b04031 --- /dev/null +++ b/Documentation/HTML/images/kshark-filter-list-adv-irq.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-filter-sync-graph-1.png b/Documentation/HTML/images/kshark-filter-sync-graph-1.png new file mode 100644 index 0000000..82e5849 --- /dev/null +++ b/Documentation/HTML/images/kshark-filter-sync-graph-1.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-filter-task-menu.png b/Documentation/HTML/images/kshark-filter-task-menu.png new file mode 100644 index 0000000..77fb98a --- /dev/null +++ b/Documentation/HTML/images/kshark-filter-task-menu.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-filter.png b/Documentation/HTML/images/kshark-filter.png new file mode 100644 index 0000000..0e9a380 --- /dev/null +++ b/Documentation/HTML/images/kshark-filter.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-graph-info-line.png b/Documentation/HTML/images/kshark-graph-info-line.png new file mode 100644 index 0000000..4f6be47 --- /dev/null +++ b/Documentation/HTML/images/kshark-graph-info-line.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-graph-plot-area.png b/Documentation/HTML/images/kshark-graph-plot-area.png new file mode 100644 index 0000000..84ed90e --- /dev/null +++ b/Documentation/HTML/images/kshark-graph-plot-area.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-graph-plot-title.png b/Documentation/HTML/images/kshark-graph-plot-title.png new file mode 100644 index 0000000..cbb8d2d --- /dev/null +++ b/Documentation/HTML/images/kshark-graph-plot-title.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-list-adjust.png b/Documentation/HTML/images/kshark-list-adjust.png new file mode 100644 index 0000000..aff15c1 --- /dev/null +++ b/Documentation/HTML/images/kshark-list-adjust.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-list-enable-filter-1.png b/Documentation/HTML/images/kshark-list-enable-filter-1.png new file mode 100644 index 0000000..8321c92 --- /dev/null +++ b/Documentation/HTML/images/kshark-list-enable-filter-1.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-list-graph-follow-1.png b/Documentation/HTML/images/kshark-list-graph-follow-1.png new file mode 100644 index 0000000..c4f8702 --- /dev/null +++ b/Documentation/HTML/images/kshark-list-graph-follow-1.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-list-graph-follow-2.png b/Documentation/HTML/images/kshark-list-graph-follow-2.png new file mode 100644 index 0000000..451de10 --- /dev/null +++ b/Documentation/HTML/images/kshark-list-graph-follow-2.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-list-info-area.png b/Documentation/HTML/images/kshark-list-info-area.png new file mode 100644 index 0000000..394dfdd --- /dev/null +++ b/Documentation/HTML/images/kshark-list-info-area.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-open.png b/Documentation/HTML/images/kshark-open.png new file mode 100644 index 0000000..1b201ce --- /dev/null +++ b/Documentation/HTML/images/kshark-open.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-plot-cpu-1.png b/Documentation/HTML/images/kshark-plot-cpu-1.png new file mode 100644 index 0000000..f49de93 --- /dev/null +++ b/Documentation/HTML/images/kshark-plot-cpu-1.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-plot-cpu-2.png b/Documentation/HTML/images/kshark-plot-cpu-2.png new file mode 100644 index 0000000..c1ea7d1 --- /dev/null +++ b/Documentation/HTML/images/kshark-plot-cpu-2.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-plot-cpu-result.png b/Documentation/HTML/images/kshark-plot-cpu-result.png new file mode 100644 index 0000000..635ddda --- /dev/null +++ b/Documentation/HTML/images/kshark-plot-cpu-result.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-plot-menu.png b/Documentation/HTML/images/kshark-plot-menu.png new file mode 100644 index 0000000..a26f052 --- /dev/null +++ b/Documentation/HTML/images/kshark-plot-menu.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-plot-task-measure-preempt.png b/Documentation/HTML/images/kshark-plot-task-measure-preempt.png new file mode 100644 index 0000000..243aef1 --- /dev/null +++ b/Documentation/HTML/images/kshark-plot-task-measure-preempt.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-plot-task-measure.png b/Documentation/HTML/images/kshark-plot-task-measure.png new file mode 100644 index 0000000..d4b7149 --- /dev/null +++ b/Documentation/HTML/images/kshark-plot-task-measure.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-plot-task-result.png b/Documentation/HTML/images/kshark-plot-task-result.png new file mode 100644 index 0000000..12bbf8b --- /dev/null +++ b/Documentation/HTML/images/kshark-plot-task-result.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-plot-task-select.png b/Documentation/HTML/images/kshark-plot-task-select.png new file mode 100644 index 0000000..be7f365 --- /dev/null +++ b/Documentation/HTML/images/kshark-plot-task-select.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-plot-task-zoom-1.png b/Documentation/HTML/images/kshark-plot-task-zoom-1.png new file mode 100644 index 0000000..716b5c6 --- /dev/null +++ b/Documentation/HTML/images/kshark-plot-task-zoom-1.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-select-a-1.png b/Documentation/HTML/images/kshark-select-a-1.png new file mode 100644 index 0000000..40a6cfa --- /dev/null +++ b/Documentation/HTML/images/kshark-select-a-1.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-select-b-1.png b/Documentation/HTML/images/kshark-select-b-1.png new file mode 100644 index 0000000..df4df41 --- /dev/null +++ b/Documentation/HTML/images/kshark-select-b-1.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-zoom-in-2.png b/Documentation/HTML/images/kshark-zoom-in-2.png new file mode 100644 index 0000000..25235e5 --- /dev/null +++ b/Documentation/HTML/images/kshark-zoom-in-2.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-zoom-in-3.png b/Documentation/HTML/images/kshark-zoom-in-3.png new file mode 100644 index 0000000..2c55319 --- /dev/null +++ b/Documentation/HTML/images/kshark-zoom-in-3.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-zoom-in-select.png b/Documentation/HTML/images/kshark-zoom-in-select.png new file mode 100644 index 0000000..12c2be7 --- /dev/null +++ b/Documentation/HTML/images/kshark-zoom-in-select.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/images/kshark-zoom-out-select.png b/Documentation/HTML/images/kshark-zoom-out-select.png new file mode 100644 index 0000000..25c7cfe --- /dev/null +++ b/Documentation/HTML/images/kshark-zoom-out-select.png | |||
Binary files differ | |||
diff --git a/Documentation/HTML/index.html b/Documentation/HTML/index.html new file mode 100644 index 0000000..9ab45a1 --- /dev/null +++ b/Documentation/HTML/index.html | |||
@@ -0,0 +1,631 @@ | |||
1 | <html> | ||
2 | |||
3 | <title>KernelShark</title> | ||
4 | |||
5 | <body> | ||
6 | |||
7 | <h1>KernelShark</h1> | ||
8 | |||
9 | <hr><h1><a name="ToC">Table of Contents</a></h1> | ||
10 | <p><b><a name="ToC_1" href="#Introduction">Introduction</a></b></br> | ||
11 | <p><b><a name="ToC_2" href="#graph">The Graph View</a></b></br> | ||
12 | <menu> | ||
13 | <li><a name="ToC_2_1" href="#graph-zoom-in">Zooming In</a> | ||
14 | <li><a name="ToC_2_2" href="#graph-zoom-out">Zooming Out</a> | ||
15 | <li><a name="ToC_2_3" href="#graph-marker">Graph Markers</a> | ||
16 | <li><a name="ToC_2_4" href="#graph-cursor">Graph Cursor</a> | ||
17 | <li><a name="ToC_2_5" href="#graph-plots">Graph Plots</a> | ||
18 | <menu> | ||
19 | <li><a name="ToC_2_5_1" href="#graph-plot-task">Process Plots</a> | ||
20 | <li><a name="ToC_2_5_2" href="#graph-plot-cpu">CPU Plots</a> | ||
21 | </menu> | ||
22 | </menu> | ||
23 | <p><b><a name="ToC_3" href="#list">The List View</a></b></br> | ||
24 | <menu> | ||
25 | <li><a name="ToC_3_1" href="#list-select">Selecting an event</a> | ||
26 | <li><a name="ToC_3_2" href="#list-graph-toggle">Graph follows toggle</a> | ||
27 | </menu> | ||
28 | <p><b><a name="ToC_4" href="#filters">Filters</a></b></br> | ||
29 | <menu> | ||
30 | <li><a name="ToC_4_1" href="#filter-task">Task Filter (filtering processes)</a> | ||
31 | <li><a name="ToC_4_2" href="#filter-event">Event Filter</a> | ||
32 | <menu> | ||
33 | <li><a name="ToC_4_2_1" href="#filter-adv-event">Advance Event Filter</a> | ||
34 | </menu> | ||
35 | </menu> | ||
36 | |||
37 | |||
38 | <h1><a name="Introduction">Introduction</a></h1> | ||
39 | |||
40 | <p> | ||
41 | KernelShark is a front end reader of <b>trace-cmd(1)</b> output. "trace-cmd record" | ||
42 | and "trace-cmd extract" create a trace.dat (<b>trace-cmd.dat(5)</b>) file. | ||
43 | <b>kernelshark</b> can read this file and produce a graph and list view of its data. | ||
44 | </p> | ||
45 | |||
46 | <img src="images/kshark-open.png"> | ||
47 | |||
48 | <p> | ||
49 | The application has two main viewing areas split by a paned divider. The top half | ||
50 | is a graphical display of the data and the bottom half is a list view of each | ||
51 | event. Underneath the menu bar is the graph information area: | ||
52 | </p> | ||
53 | |||
54 | <h4><a name="graph-info-line">Graph Info Area</a></h4> | ||
55 | |||
56 | <img src="images/kshark-graph-info-line.png"> | ||
57 | |||
58 | <p> | ||
59 | The graph information line displays the timestamp of various locations. | ||
60 | The Pointer: shows the timestamp of where the mouse pointer is. The Cursor: is | ||
61 | the timestamp of the cursor location. To select a cursor location, double click | ||
62 | on the graph. Marker A is set with a left mouse click and Marker B is set | ||
63 | with a with a left mouse click while holding down the shift key. | ||
64 | </p> | ||
65 | |||
66 | <p> | ||
67 | The graph is broken into two parts, the plot title section: | ||
68 | </p> | ||
69 | |||
70 | <h4><a name="graph-plot-title">Plot Title</a></h4> | ||
71 | |||
72 | <img src="images/kshark-graph-plot-title.png"> | ||
73 | |||
74 | <p> | ||
75 | and the plot area: | ||
76 | </p> | ||
77 | |||
78 | <img src="images/kshark-graph-plot-area.png"> | ||
79 | |||
80 | <p> | ||
81 | The plot area contains the data of the given plot, where plots can be per CPU or | ||
82 | per process. The top of the plot area shows a time line. The numbers in the time | ||
83 | line are seconds. The time in the time line is taken from the timestamps within | ||
84 | the trace.dat file which are architecture dependent. The time usually is the timestamp | ||
85 | from when the system started. | ||
86 | </p> | ||
87 | |||
88 | <p> | ||
89 | Below the graph is the list area. | ||
90 | </p> | ||
91 | |||
92 | <h4><a name="list-area">List Area</a></h4> | ||
93 | |||
94 | <img src="images/kshark-list-info-area.png"> | ||
95 | |||
96 | <p> | ||
97 | The list area contains the Page of the list. The list can hold a maximum of | ||
98 | 1 million entries per page. If the trace data contains more than a million | ||
99 | entries, then the list will have more than one page. | ||
100 | </p> | ||
101 | |||
102 | <p> | ||
103 | The list area also contains a search field to search for elements in the | ||
104 | list. | ||
105 | </p> | ||
106 | |||
107 | <h1><a name="graph">The Graph View</a></h1> | ||
108 | |||
109 | <p> | ||
110 | The graph view of kernelshark shows graphical plots of the data stored in | ||
111 | the trace.dat file. The data plots are per CPU or per process. | ||
112 | When there are too many events within the resolution of the graph, | ||
113 | the plots will appear as a rainbow colored bar. To make more sense out of | ||
114 | the graphs, you need to zoom into a given location to see the details of | ||
115 | that time frame more clearly. | ||
116 | </p> | ||
117 | |||
118 | <h2><a name="graph-zoom-in">Zooming In</a></h2> | ||
119 | |||
120 | <p> | ||
121 | To zoom in, left mouse click and hold and then drag the mouse right, release | ||
122 | to zoom. When you click the left mouse button a line will appear and stay | ||
123 | at that location. When you move the mouse to the right, another line appears | ||
124 | and will follow the mouse. When you release the mouse button, the area | ||
125 | between the two lines become the new width of the screen. That is, the graph | ||
126 | zooms in until the lines match the width of the screen. This allows you to | ||
127 | zoom into a specific location. | ||
128 | </p> | ||
129 | |||
130 | <img src="images/kshark-zoom-in-select.png"> | ||
131 | |||
132 | <p> | ||
133 | The area that you selected will now become the new width of the viewable area. | ||
134 | The smaller the selection, the deeper the zoom. Note, that you must select 10 | ||
135 | pixels to zoom in. Less than 10 pixels will cancel the zoom. You can continue zooming | ||
136 | in until you get mor details. | ||
137 | </p> | ||
138 | |||
139 | <img src="images/kshark-zoom-in-3.png"> | ||
140 | |||
141 | <p> | ||
142 | If a plot contains no events within the zoomed in raidus, then the line will be empty, | ||
143 | as CPU 1 is in the above image. CPU 0 shows two tasks that were running. One task | ||
144 | is given a pink/red color and the other a green color. The colored box represents | ||
145 | a task other than idle was running. The small lines that jet out of the box are | ||
146 | where events occur. | ||
147 | </p> | ||
148 | |||
149 | <p> | ||
150 | If you zoom in enough such that a single event has enough room between itself | ||
151 | and other events, the type of event and the name and PID of the task that was running will appear | ||
152 | over the event. | ||
153 | </p> | ||
154 | |||
155 | <h2><a name="graph-zoom-out">Zooming Out</a></h2> | ||
156 | |||
157 | <p> | ||
158 | To zoom back out, left mouse click and hold and then drag the mouse left. | ||
159 | This time the width between the two lines will become a single pixel. | ||
160 | The farther apart the lines are, the farther the zoom out will be. | ||
161 | Zoom out will stop at the width of the full trace. | ||
162 | </p> | ||
163 | |||
164 | <img src="images/kshark-zoom-out-select.png"> | ||
165 | |||
166 | <p> | ||
167 | When the mouse is over an event, a tool tip will appear showing the event name, | ||
168 | the <a href="#latency">latency data</a>, the event info, the timestamp and the process | ||
169 | name and process ID. | ||
170 | </p> | ||
171 | |||
172 | <img src="images/kshark-zoom-in-2.png"> | ||
173 | |||
174 | <h2><a name="graph-marker">Graph Markers</a></h2> | ||
175 | |||
176 | <p> | ||
177 | There are two markers that can be placed on the graph as well as a cursor. | ||
178 | Marker A is set by a left mouse click. When a marker is set, the | ||
179 | <a href="#graph-info-line">graph info area</a> will be updated. | ||
180 | Marker A is represented by a green line: | ||
181 | </p> | ||
182 | |||
183 | <img src="images/kshark-select-a-1.png"> | ||
184 | |||
185 | <p> | ||
186 | To set Marker B, press and hold the shift key and click the left mouse button. | ||
187 | Marker B will show up in red. | ||
188 | </p> | ||
189 | |||
190 | <img src="images/kshark-select-b-1.png"> | ||
191 | |||
192 | <p> | ||
193 | When both the A and B markers are set, the <a href="#graph-info-line">graph info area</a> | ||
194 | will show the timestamp of where the A and B markers are, as well as the difference | ||
195 | between the two. All timestamps are in seconds, with a resolution of microseconds. | ||
196 | </p> | ||
197 | |||
198 | <h2><a name="graph-cursor">Graph Cursor</a></h2> | ||
199 | |||
200 | <p> | ||
201 | Double clicking on the graph will set the cursor. The cursor is a blue line, and when | ||
202 | it is set, it will also select the event in the list view that is the closest event at the | ||
203 | timeline of where the cursor was selected at. | ||
204 | </p> | ||
205 | |||
206 | <img src="images/kshark-cursor-1.png"> | ||
207 | |||
208 | <p> | ||
209 | The above shows that list item 217448 (sys_exit) was the closest event to where | ||
210 | the cursor was selected. | ||
211 | </p> | ||
212 | |||
213 | <p> | ||
214 | Note that setting the cursor with double click will also set Marker A. | ||
215 | </p> | ||
216 | |||
217 | <h2><a name="graph-plots">Graph Plots</a></h2> | ||
218 | |||
219 | <p> | ||
220 | The graph data is represented by plots. The data on the plots is either CPU specific or | ||
221 | process specific. If it is CPU specific, then the data is the time line of events that | ||
222 | happened on a given CPU (which CPU is shown in the <a href="#graph-plot-title">plot title area</a>). | ||
223 | If the plot is process specific, then the time line of events is for the given | ||
224 | process regardless of what CPU it was on at the time. The process name is also shown | ||
225 | in the plot title area. | ||
226 | </p> | ||
227 | |||
228 | <p> | ||
229 | By default, all the CPUs within the loaded trace.dat file are plotted. | ||
230 | There's two ways to plot a process. One way is to right mouse click over a | ||
231 | displayed process in the graph and select the plot option. This will add the | ||
232 | process plot directly underneath the CPU plot that the process was on where | ||
233 | the right mouse click took place. The other way is to use the plot menu. | ||
234 | </p> | ||
235 | |||
236 | <img src="images/kshark-plot-menu.png"> | ||
237 | |||
238 | <h3><a name="graph-plot-task">Process Plots</a></h3> | ||
239 | |||
240 | <p> | ||
241 | Selecting the "Task" menu will bring up a dialog with all the processes (also referred | ||
242 | to as tasks) that was found in the trace data. | ||
243 | </p> | ||
244 | |||
245 | <img src="images/kshark-plot-task-select.png"> | ||
246 | |||
247 | <p> | ||
248 | Selecting a process in this dialog will add the task plot to the bottom of the graph | ||
249 | area. Unselecting a process in this dialog will remove the plot. | ||
250 | </p> | ||
251 | |||
252 | <img src="images/kshark-plot-task-result.png"> | ||
253 | |||
254 | <p> | ||
255 | The colors in the process plots are different depending on what CPU the process | ||
256 | was on at the time. The CPU plots change colors as different processes run | ||
257 | on the CPU, and the process plots change color depending on what CPU the process | ||
258 | is running on at a time. This makes it easy to see how much a process | ||
259 | bounces around the CPUs. Zooming in on a process plot also shows some more | ||
260 | characteristics of the process. | ||
261 | </p> | ||
262 | |||
263 | <img src="images/kshark-plot-task-zoom-1.png"> | ||
264 | |||
265 | <p> | ||
266 | The hollow green box that is shown in front of some events in the process | ||
267 | plot represents when the task was woken up from a sleeping state to | ||
268 | when it actually ran. The hollow red box between some events shows that | ||
269 | the process was preempted by another process even though that process | ||
270 | was still runnable. | ||
271 | </p> | ||
272 | |||
273 | <p> | ||
274 | Since the hollow green box shows the wake up latency of the task, the | ||
275 | <a href="#graph-marker">A,B markers</a> can be used to measure that time. | ||
276 | </p> | ||
277 | |||
278 | <img src="images/kshark-plot-task-measure.png"> | ||
279 | |||
280 | <p> | ||
281 | The above shows that the epiphany-browser with PID 28072 had a 479 microsecond wake up | ||
282 | latency. The same can be done with the preemption latency. | ||
283 | </p> | ||
284 | |||
285 | <img src="images/kshark-plot-task-measure-preempt.png"> | ||
286 | |||
287 | <h3><a name="graph-plot-cpu">CPU Plots</a></h2> | ||
288 | |||
289 | <p> | ||
290 | Selecting the CPU plot menu pops up a dialog that shows the available CPUs that | ||
291 | can be plotted. | ||
292 | <p> | ||
293 | |||
294 | <img src="images/kshark-plot-cpu-1.png"> | ||
295 | |||
296 | <p> | ||
297 | Removing a selected CPU and hitting "Apply" will remove that CPU plot. | ||
298 | </p> | ||
299 | |||
300 | <img src="images/kshark-plot-cpu-2.png"> | ||
301 | |||
302 | <p> | ||
303 | |||
304 | <img src="images/kshark-plot-cpu-result.png"> | ||
305 | |||
306 | <h1><a name="list">The List View</a></h1> | ||
307 | |||
308 | <p> | ||
309 | The list view is in the bottom half paned window and can be expanded or shortened | ||
310 | with the paned handle. | ||
311 | </p> | ||
312 | |||
313 | <img src="images/kshark-list-adjust.png"> | ||
314 | |||
315 | <p> | ||
316 | The top of the list view contains the <a href="#list-area">list area</a> which has the list page, list | ||
317 | search, and graph follow toggle button. If more than a million events are stored in the | ||
318 | list, then each set of million will be on a different page. | ||
319 | </p> | ||
320 | |||
321 | <p> | ||
322 | The columns of the list are: | ||
323 | </p> | ||
324 | |||
325 | <ul> | ||
326 | <li><b>#</b> - the index into the list. | ||
327 | <li><b>CPU</b> - the CPU that the event occurred on. | ||
328 | <li><b>Time Stamp</b> - The time stamp of the event. This is in seconds with microsecond | ||
329 | resolution. | ||
330 | <li><b>PID</b> - The process ID of the task that was running when the event occurred. | ||
331 | <li><b><a name="latency">Latency</a></b> - The latency is broken into 5 fields: | ||
332 | <ol> | ||
333 | <li>Interrupts disabled - 'd' if interrupts are enabled, otherwise '.' | ||
334 | <li>Need reschedule - 'N' if the kernel was notified that a schedule is needed, otherwise '.' | ||
335 | <li>In IRQ - 'h' if in a hard IRQ (hardware triggerred), 's' if in a soft IRQ | ||
336 | (context where the kernel initiated a the irq handler) or if soft IRQs | ||
337 | are disabled, 'H' if in a hard IRQ and soft IRQs are disabled or the hard IRQ | ||
338 | triggerred while processing a soft IRQ, otherwise '.' | ||
339 | <li>Preemption counter - The index of the preemption counter. If it is other | ||
340 | than zero, then the kernel will not preempt the running processes, even | ||
341 | if a schedule has been requested by some event. If the counter is zero, | ||
342 | then '.' is shown. | ||
343 | <li>Lock depth - The depth of the big kernel lock being held. The big kernel | ||
344 | lock is recusive (same task may acquire it multiple times). On the first | ||
345 | acquisition, the depth is zero. This field will be zero or greater, or | ||
346 | '.' if the big kernel lock is not held. When the big kernel lock is | ||
347 | finally removed from the kernel, this field will go away as well. | ||
348 | </ol> | ||
349 | <li><b>Event</b> - The name of the event. | ||
350 | <li><b>Info</b> - The data output of a particular event. | ||
351 | </ul> | ||
352 | |||
353 | <p> | ||
354 | The list search can find an event based on the contents in a row. Select a column, a | ||
355 | match criteria and the content to match will find the next row that matches the | ||
356 | search. The match criteria is one of the following: | ||
357 | </p> | ||
358 | |||
359 | <ul> | ||
360 | <li><b>contains</b> - the row cell of the selected column contains the match data. This works with numbers | ||
361 | as well. | ||
362 | <li><b>full match</b> - the row cell of the selected column matches exactly the match data. | ||
363 | <li><b>does not have</b> - the row cell of the selected column does not contain the match data. | ||
364 | </ul> | ||
365 | |||
366 | <p> | ||
367 | The search will find the next event that has the matching data within the column. | ||
368 | </p> | ||
369 | |||
370 | <h2><a name="list-select">Selecting an event</a></h2> | ||
371 | <p> | ||
372 | A single click on a row will select the row, but a double click on a row will select | ||
373 | that row as well as set the graph cursor to the location of that event. If the plot | ||
374 | that the event is on is not visible then the graph will adjust it vertical view area | ||
375 | to show the plot with the selected event. This has no effect on | ||
376 | <a href="#graph-marker">graph markers</a>. | ||
377 | <p> | ||
378 | |||
379 | <h2><a name="list-graph-toggle">Graph follows toggle</a></h2> | ||
380 | |||
381 | <p> | ||
382 | When the "graph follows" toggle is set, then even a single click on a row | ||
383 | will move the graph cursor. With the mouse focus on the list, using the keyboard | ||
384 | up and down arrow keys will move the selection of the list as well as the graph | ||
385 | cursor. | ||
386 | </p> | ||
387 | |||
388 | <img src="images/kshark-list-graph-follow-1.png"> | ||
389 | <p> | ||
390 | <img src="images/kshark-list-graph-follow-2.png"> | ||
391 | |||
392 | <h1><a name="filters">Filters</a></h1> | ||
393 | |||
394 | <p> | ||
395 | The amount of data that can be stored in a trace.dat file can be enourmous. | ||
396 | To make any sense out of some traces, it may be required to only display various | ||
397 | events. The same can be true about processes. | ||
398 | Kernelshark has filters for tasks as well as for events. The task filter | ||
399 | affects both the graph and the list, but the graph and list each have a separate | ||
400 | event filter. | ||
401 | <p> | ||
402 | |||
403 | <h2><a name="filter-task">Task Filter (filtering processes)</a></h2> | ||
404 | |||
405 | <p> | ||
406 | The task (process) filter is currently set by a right mouse click over | ||
407 | an event on either the graph or the list view, and by selecting the option to add or remove the | ||
408 | task to/from the task filter. The tasks within the task filter are the same for | ||
409 | both the graph and list, but each can be enabled separately. | ||
410 | </p> | ||
411 | |||
412 | <p> | ||
413 | There are two types of task filters: | ||
414 | </p> | ||
415 | |||
416 | <ul> | ||
417 | <li>Task Filter - only show tasks that are in this filter | ||
418 | <li>Hide Tasks - do not display the tasks within this filter | ||
419 | </ul> | ||
420 | |||
421 | <p> | ||
422 | If there are any tasks within the Task Filter then only those tasks will be displayed | ||
423 | when the filter is enabled. Any task within the Hide Tasks filter will not be | ||
424 | displayed, even if that same task is in the Task Filter. | ||
425 | </p> | ||
426 | |||
427 | <img src="images/kshark-filter-task-menu.png"> | ||
428 | |||
429 | <p> | ||
430 | When either filter contains a task, the filter can be enabled. | ||
431 | </p> | ||
432 | |||
433 | <img src="images/kshark-list-enable-filter-1.png"> | ||
434 | |||
435 | <h4>The scheduling events</h4> | ||
436 | |||
437 | <p> | ||
438 | The events "sched_switch", "sched_wakeup", and "sched_wakeup_new" are treated | ||
439 | differently by the task filter. Because these events deal with two tasks | ||
440 | (previous and next, waker and wakee), if either of the tasks should be visible | ||
441 | then that event is visible regardless if the other task should be hidden. | ||
442 | This may seem confusing when an event that is hidden shows up in the Task column. | ||
443 | </p> | ||
444 | |||
445 | <h2><a name="filter-event">Event Filter</a></h2> | ||
446 | |||
447 | <p> | ||
448 | The graph and list view each have their own event filter. The event filters | ||
449 | are enabled through the Filter menu on the top menu-bar. | ||
450 | </p> | ||
451 | |||
452 | <img src="images/kshark-filter.png"> | ||
453 | |||
454 | <p> | ||
455 | Selecting either the "list events" or "graph events" will bring up the event | ||
456 | dialog with the events that are visible selected. | ||
457 | </p> | ||
458 | |||
459 | <p> | ||
460 | Note: these do not mean that the events exist in the trace.dat file. They are | ||
461 | selected if the events are not to be hidden. Events that do not exist in the trace | ||
462 | and will not be displayed regardless of whether or not they are filtered. | ||
463 | </p> | ||
464 | |||
465 | <img src="images/kshark-filter-events.png"> | ||
466 | |||
467 | <p> | ||
468 | By clicking on "All" or any of the systems will either deselect all events underneath | ||
469 | or select all events underneath depending on the previous state of the box being | ||
470 | selected. By deselecting all events, it makes it easier to enable just a few individual events. | ||
471 | <p> | ||
472 | |||
473 | <img src="images/kshark-filter-events-sched.png"> | ||
474 | |||
475 | <p> | ||
476 | If it is desired that the graph and list view have the same events filtered, then just | ||
477 | set up the desired filtering in one and then synchronize the other through | ||
478 | the filter menu. | ||
479 | </p> | ||
480 | |||
481 | <img src="images/kshark-filter-sync-graph-1.png"> | ||
482 | |||
483 | <ul> | ||
484 | <li><b>sync graph events with list</b> - will set the graph event filter to be the same | ||
485 | as what is in the list filter. | ||
486 | <li><b>sync list events with graph</b> - will set the list event filter to be the same | ||
487 | as what is in the graph filter. | ||
488 | </ul> | ||
489 | |||
490 | <h3><a name="filter-adv-event">Advance Event Filter</a></h3> | ||
491 | |||
492 | <p> | ||
493 | Filtering on events may not be enough. The ability to filter on the content | ||
494 | of individual events may be needed. In order to accomplish this, the advanced event | ||
495 | filtering is used. Selecting the "list advanced event" or "graph advanced event" | ||
496 | from the filter menu will pop up the advanced event filtering dialog. | ||
497 | The graph and list view each have their own advanced event filter. | ||
498 | </p> | ||
499 | |||
500 | <img src="images/kshark-filter-advance-1.png"> | ||
501 | |||
502 | <p> | ||
503 | The "Filter:" entry at the bottom of the dialog is where the advanced filter is | ||
504 | written. Above that is helper buttons to pick events, operations and event fields. | ||
505 | The syntax of the filter is: | ||
506 | <p> | ||
507 | |||
508 | <pre> | ||
509 | FILTER := EVENTS | EVENTS ':' EXPRESSION | ||
510 | EVENTS := EVENTS ',' EVENTS | SYSTEM '/' EVENT | SYSTEM | EVENT | ||
511 | SYSTEM := any system name | ||
512 | EVENT := any event name | ||
513 | EXPRESSION := EXPRESSION BOOL EXPRESSION | '(' EXPRESSION ')' | OPERATION | ||
514 | BOOL := '&&' | '||' | ||
515 | OPERATION := '!' EXPRESSION | LVALUE CMP RVALUE | LVALUE STRCMP STRVALUE | ||
516 | CMP := '>' | '<' | '==' | '>=' | '<=' | '!=' | ||
517 | STRCMP := '==' | '!=' | '=~' | '!~' | ||
518 | RVALUE := integer | FIELD | ||
519 | STRVALUE := string (double quoted value) | FIELD | ||
520 | LVALUE := FIELD | EXPR | ||
521 | EXPR := FIELD OP RVALUE | '(' EXPR ')' | EXPR OP EXPR | ||
522 | FIELD := a field name of an event | ||
523 | OP := '+' | '-' | '*' | '/' | '<<' | '>>' | '&' | '!' | ||
524 | </pre> | ||
525 | |||
526 | <p> | ||
527 | Spaces are ignored. The example used in the dialog figure: | ||
528 | </p> | ||
529 | |||
530 | <pre> | ||
531 | sched/sched_switch : next_prio < 100 && (prev_prio > 100 && prev_pid != 0) | ||
532 | </pre> | ||
533 | |||
534 | <p> | ||
535 | The <tt>sched/</tt> is not necessary because without it, the filter will process all events | ||
536 | named <tt>sched_switch</tt>, and since there is only one event | ||
537 | that has that name, including the <tt>sched/</tt> is redundant. | ||
538 | <p> | ||
539 | |||
540 | <p> | ||
541 | The <tt>next_prio</tt>, <tt>prev_prio</tt> and <tt>prev_pid</tt> are all | ||
542 | event fields of the <tt>sched_swich</tt> event. | ||
543 | </p> | ||
544 | |||
545 | <p> | ||
546 | If just <tt>sched</tt> was used and the <tt>/sched_switch</tt> was omitted, it would | ||
547 | still be a valid filter, but it would behave differently. By just specifying | ||
548 | a system, the filter will run on all events within that system. When a field | ||
549 | is encountered that does not belong to an event, then that compare will be set to false. | ||
550 | </p> | ||
551 | |||
552 | <pre> | ||
553 | sched : prev_pid != 0 | ||
554 | sched : !(prev_pid == 0) | ||
555 | </pre> | ||
556 | |||
557 | <p> | ||
558 | The above two filters are not equivalent. They are for the <tt>sched_switch</tt> event, | ||
559 | but not for the other events. The first filter will return false for all events | ||
560 | that do not contain the <tt>prev_pid</tt> field, but the second filter would return | ||
561 | true for all events that do not contain that field. Again, if the event does | ||
562 | not contain a field, just that compare will be evaluated to false, not the entire | ||
563 | expression. This means for events that do not have the <tt>prev_pid</tt> field, | ||
564 | the above filters would be equivalent to: | ||
565 | </p> | ||
566 | |||
567 | <pre> | ||
568 | sched : FALSE | ||
569 | sched : !(FALSE) | ||
570 | </pre> | ||
571 | |||
572 | <p> | ||
573 | By letting the filters contain fields that do not belong to an event be valid, | ||
574 | allows for various tricks where two events can share the same | ||
575 | filter. | ||
576 | </p> | ||
577 | |||
578 | <pre> | ||
579 | sched_switch, sched_wake.* : next_pid == 1 || pid == 1 | ||
580 | </pre> | ||
581 | |||
582 | <p> | ||
583 | The schedule events that have <tt>next_pid</tt> and not <tt>pid</tt> as a field | ||
584 | will just compare the first part of the <tt>||</tt> and those events with | ||
585 | <tt>pid</tt> but without <tt>next_pid</tt> will be compared against the second | ||
586 | part of the <tt>||</tt> | ||
587 | </p> | ||
588 | |||
589 | <p> | ||
590 | Notice: that event names in the filter can be regular expressions. | ||
591 | </p> | ||
592 | |||
593 | <p> | ||
594 | String fields can have regular expressions used in their comparing if | ||
595 | <tt>=~</tt> or <tt>!~</tt> are used. | ||
596 | </p> | ||
597 | |||
598 | <pre> | ||
599 | sched_switch : next_comm =~ "^events/[23]$" | ||
600 | </pre> | ||
601 | |||
602 | <p> | ||
603 | Note: When adding an advanced filter, all non advanced filters | ||
604 | (added by the event filter dialog box) will be removed, and only the advanced | ||
605 | filters will stay. But non advanced filters may be added after advanced | ||
606 | filters have been. The events that have advanced filters will be shadowed | ||
607 | in the event filter dialog: | ||
608 | <p> | ||
609 | |||
610 | <img src="images/kshark-filter-event-adv-list.png"> | ||
611 | |||
612 | <p> | ||
613 | Just do not click on the adavanced filter box and hit "Apply" unless you want to remove | ||
614 | the adavanced filter. Non advanced filters can now be selected without affecting | ||
615 | the advanced filters. | ||
616 | </p> | ||
617 | |||
618 | <img src="images/kshark-filter-list-adv-irq.png"> | ||
619 | |||
620 | <p> | ||
621 | When adavanced filters already exist when the advanced filter dialog box pops up, | ||
622 | they will be listed in the area at the top of the dialog. Although | ||
623 | one filter may have been written, the list will be per event. A check box | ||
624 | is to the left of the filter, when checked, the filter will be deleted if | ||
625 | the "Apply" button is selected. | ||
626 | </p> | ||
627 | |||
628 | <img src="images/kshark-filter-del-adv.png"> | ||
629 | |||
630 | </body> | ||
631 | </html> | ||