aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorJonathan <hermanjl@hermanjl-Aspire-5553G.(none)>2012-03-05 18:00:39 -0500
committerJonathan <hermanjl@hermanjl-Aspire-5553G.(none)>2012-03-05 18:00:39 -0500
commit61266395ff4f371933c104cff6671aae7f43c3fd (patch)
tree4e0c1bf15015a80a57db728c5857005234481f4b /Documentation
parent8bcd73ddae5d74fb9b2b8aaedd3aa6a39ef3f75d (diff)
rt-graph: real-time tasks can be added / removed from the graph
Currently they copy the functionality of regular task.
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/structure.txt225
1 files changed, 225 insertions, 0 deletions
diff --git a/Documentation/structure.txt b/Documentation/structure.txt
new file mode 100644
index 0000000..adee54d
--- /dev/null
+++ b/Documentation/structure.txt
@@ -0,0 +1,225 @@
1
2Can't do this until cpus set up!
3
40. Load all events w/ proper stuff
5
61. Create list of rt_tasks
72. Create seperate dailog for rt tasks w/ a callback.
83. Allow dialog to be filtered.
94. Create dummy task thing that just says hi.
105. Make it print out when it reads stuff.
116. Draw shit
127. Draw new shit.
13
14
15struct trace-graph.h {
16 /* - header file for generic graphers */
17
18/* - What is returned for drawing */
19/* struct plot_info; */
20
21/* - what you can customize */
22/* struct plot_callbacks; */
23/* - customized in trace-*-plot.c */
24
25/* - one of these per trace-*-plot instantiation */
26/* struct graph_plot; */
27/* void* private is per trace-*-plot */
28/* *cb (callbacks) is the callbacks */
29
30
31/* struct graph_callbacks; */
32/* struct plot_list; */
33/* struct plot_hash; */
34
35/* /\* Current state of the displayed graph AS A WHOLE *\/ */
36 struct graph_info {
37 handle; /* input handle */
38 };
39
40/* - create with trace_graph_plot_insert */
41
42};
43
44struct parse-events.h {
45 /* Can write shit into it person by person */
46 struct trace_seq;
47};
48
49struct unknown {
50
51};
52
53struct trace-graph.c {
54
55};
56
57/* trace-graph.c */
58
59
60
61struct trace-plot-task.c {
62
63 /*** PRIVATE DATA ***/
64
65 /* Private to each task plot */
66 struct task_plot_info {
67 pid /* per task */
68 /* Other current things, lotta last whatevs */
69 }
70
71 /*** PRIVATE METHODS ****/
72
73 /* Return true if the record (which is for this task) is a sched_switch
74 * and the data held is the previous state?? */
75 is_running(ginfo, record);
76
77 /* Return true if the record is:
78 * a sched_switch to our pid or from our pid, is_sched = TRUE
79 * a wakeup, if we are waking up, wakeup = TRUE
80 * from our pid, all fALSE
81 */
82 record_matches_pid(ginfo, record, match_pid, &pid, &sched_pid, &is_sched, &wakeup);
83
84
85 /* Sets cpu to given time. Read till that time is passed, freeing everytning
86 * on the way.
87 * If we reach a record at or past our time, set cursor to that time.
88 */
89 set_cpu_to_time(cpu, ginfo, time);
90
91 /* Call above on all cpus */
92 set_cpus_to_time(ginfo, time);
93
94 /* Return struct w/ array holding current record offset at each cpu */
95 save_offsets(ginfo);
96
97 /* Set cursor to each offset, if present. Otherwise, put at end */
98 restore_offsets(ginfo, offsets);
99
100 /* Return first record after time which is from our pid */
101 find_record(ginfo, pid, time);
102
103 /* Updates last_whatevers in task info */
104 update_last_record(ginfo, task_plot_info, record);
105
106 /* Reads backwards until it finds a matching record */
107 find_previous_record(ginfo, start_record, pid, cpu);
108
109 get_display_record(ginfo, pid, time);
110
111 /**** PUBLIC METHODS *****/
112
113 /* Basically reset as though you just started reading */
114 task_plot_start(ginfo, plot, time);
115
116 /* Load the next record for me at or after that time */
117 task_plot_match_time(ginfo, plot, time);
118
119 /* Get record at time, print info */
120 task_plot_display_last_event(info, plot, trace_seq s, time);
121
122 /* Always draws a line of the color of the pid. Always.
123 * Then update_last_record.
124 * If record is null, times up, just finish our shit and return.
125 * If was running, and now wakeup, that means another task woke up
126 * We need to end our gd box. If it was us waking up,no box.
127 * return.
128 * If a match
129 * If a new cpu, see if we switched cpu. if so, create a box w/
130 * proper color for LAST cpu, end it here.
131 * If scheduled, but we weren't currently running, we are now.
132 * Update the last bullshit. If we had a wake time, that means
133 * our wakeup turned into a run. Draw an empty box where we were
134 * awake but not running. Otherwise, reset wake time.
135 * Else if we haven't created a new box, (ie switched cpus), we got
136 * switched out. Create a goddamn box.
137 * Return
138 * If no previous last_records on this cpu, put this record there.
139 * If there was a last cpu, but no match, somehow we aren't running.
140 * Finish the box.
141 */
142 task_plot_event(ginfo, plot,r ecord, info);
143
144 /* Just frontend for find_record */
145 task_plot_find_record(ginfo, plot, time);
146
147 /* Print out event info if in current resolution */
148 task_plot_display_info(ginfo, plot, sequence s, time);
149
150 /* Free private info */
151 task_plot_destroy(info, plot);
152
153
154 /*** STATIC METHODS ***/
155
156 /* Return what tasks are plotted */
157 void graph_plot_task_plotted(ginfo, **plotted);
158
159 /* Called when task is clicked or removed */
160 graph_plot_task_update_callback(accept, selected, non_selct, data);
161
162 /* Create a plot for a single task, insert into plot */
163 graph_plot_task(ginfo, pid, pos);
164
165};
166
167struct trace-plot-cpu.c{
168 /*** DATA ***/
169 struct cpu_plot_info {
170 cpu, last_time, last_pid, *last_record;
171 };
172
173 /*** PRIVATE ***/
174 /* Hashes for pid value, but if idle (aka 0), returns black) */
175 hash_pid(val);
176
177 /* Sets cpu near time, reads until time is passed, returns last record */
178 get_record_from_time(ginfo, cpu, time);
179
180 /* Return 1 if the record should be skipped */
181 filter_record(ginfo, record, &orig_pid, &sched_pid, &sched_switch);
182
183 /* Update last_pid, last_record, and last_time */
184 update_last_record(ginfo, cpu_info, record);
185
186 /* Uh eh hrm? */
187 find_record_on_cpu(ginfo, cpu, time);
188
189
190 /*** PUBLIC ***/
191 /* Gets record around time. Return 1 if exact match */
192 cpu_plot_match_time(ginfo, plot, time);
193
194 /* Find first non-filtered event after time, write out info into s */
195 cpu_plot_display_last_event(ginfo, plot, sequence s, time);
196
197 /* Prepare for liftoff ! */
198 cpu_plot_start(ginfo, plot, time);
199
200 /* Generate stuff as needed */
201 cpu_plot_event(ginfo, plot, record, info);
202
203 /* Call find record to get a record in this time */
204 cpu_plot_find_record(ginfo, plot, time);
205
206 /* Write out info for record at or before time */
207 cpu_plot_display_info(gino, plot, s, time);
208
209 /* You get it */
210 cpu_plot_destroy(ginfo, plot);
211
212 /*** STATIC ***/
213 /* Create cpu plot, add to trace graph */
214 add_cpu_plot(ginfo, cpu);
215
216 /* Return cpus plotted in cpu_mask */
217 graph_plot_cpus_plotted(ginfo, *all_cpus, **cpu_mask);
218
219 /* Remove unselected plots, add selected plots */
220 graph_plot_cpus_update_callback(accept, all_cpus, selected_cpu_mast, data);
221
222 /* Automatigically add all cpus */
223 graph_plot_init_cpus();
224
225}