aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-02-10 21:58:33 -0500
committerSteven Rostedt <rostedt@goodmis.org>2010-02-10 22:38:26 -0500
commit1ebd4ace97ff410a45fabac125ce4110f513ea51 (patch)
tree7198b130e53f18a9da928219c9c33cf429dea09d
parentd4dfdb40e94aa48899e1e11b0bc4309d35d45424 (diff)
trace-graph: Display task specific data when zoomed in on task plot
When zooming in on a task plot and the events show up in the graph, instead of showing the CPU type data, show information useful for the task. This includes what CPU it is on, and for sched_switch, if a wakeup was detected, it shows the latency from the wakeup. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--trace-plot-task.c48
1 files changed, 39 insertions, 9 deletions
diff --git a/trace-plot-task.c b/trace-plot-task.c
index c92adb9..293ccec 100644
--- a/trace-plot-task.c
+++ b/trace-plot-task.c
@@ -9,6 +9,7 @@ struct task_plot_info {
9 struct cpu_data *cpu_data; 9 struct cpu_data *cpu_data;
10 unsigned long long last_time; 10 unsigned long long last_time;
11 unsigned long long wake_time; 11 unsigned long long wake_time;
12 unsigned long long display_wake_time;
12 int last_cpu; 13 int last_cpu;
13}; 14};
14 15
@@ -234,15 +235,41 @@ static int task_plot_display_last_event(struct graph_info *ginfo,
234 record_matches_pid(ginfo, record, pid, &rec_pid, 235 record_matches_pid(ginfo, record, pid, &rec_pid,
235 &sched_pid, &is_sched, &is_wakeup); 236 &sched_pid, &is_sched, &is_wakeup);
236 237
237 /* Must have the record we want */ 238 if (is_sched) {
238 type = pevent_data_type(ginfo->pevent, record); 239 if (sched_pid == pid) {
239 event = pevent_data_event_from_type(ginfo->pevent, type); 240 if (task_info->display_wake_time) {
240 if (is_sched) 241 trace_seq_printf(s, "sched_switch\n"
241 pid = sched_pid; 242 "CPU %d: lat: %.3fus\n",
242 trace_seq_printf(s, "%s-%d\n%s\n", 243 record->cpu,
243 pevent_data_comm_from_pid(ginfo->pevent, pid), 244 (double)(record->ts -
244 pid, event->name); 245 task_info->display_wake_time) / 1000.0);
245 free_record(record); 246 task_info->display_wake_time = 0;
247 } else {
248 trace_seq_printf(s, "sched_switch\n"
249 "CPU %d\n",
250 record->cpu);
251 }
252 } else {
253 trace_seq_printf(s, "sched_switch\n"
254 "CPU %d %s-%d\n",
255 record->cpu,
256 pevent_data_comm_from_pid(ginfo->pevent, pid),
257 pid);
258 }
259 } else {
260
261 /* Must have the record we want */
262 type = pevent_data_type(ginfo->pevent, record);
263 event = pevent_data_event_from_type(ginfo->pevent, type);
264 if (pid == rec_pid)
265 trace_seq_printf(s, "CPU %d\n%s\n",
266 record->cpu, event->name);
267 else
268 trace_seq_printf(s, "%s-%d\n%s\n",
269 pevent_data_comm_from_pid(ginfo->pevent, rec_pid),
270 rec_pid, event->name);
271 free_record(record);
272 }
246 273
247 return 1; 274 return 1;
248} 275}
@@ -254,6 +281,8 @@ static void task_plot_start(struct graph_info *ginfo, struct graph_plot *plot,
254 281
255 task_info->last_time = 0ULL; 282 task_info->last_time = 0ULL;
256 task_info->last_cpu = -1; 283 task_info->last_cpu = -1;
284 task_info->wake_time = 0ULL;
285 task_info->display_wake_time = 0ULL;
257} 286}
258 287
259static int task_plot_event(struct graph_info *ginfo, 288static int task_plot_event(struct graph_info *ginfo,
@@ -307,6 +336,7 @@ static int task_plot_event(struct graph_info *ginfo,
307 } 336 }
308 337
309 task_info->wake_time = record->ts; 338 task_info->wake_time = record->ts;
339 task_info->display_wake_time = record->ts;
310 340
311 return 1; 341 return 1;
312 } 342 }