diff options
Diffstat (limited to 'rt-plot-task.c')
-rw-r--r-- | rt-plot-task.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/rt-plot-task.c b/rt-plot-task.c index c72013f..56c3c28 100644 --- a/rt-plot-task.c +++ b/rt-plot-task.c | |||
@@ -3,7 +3,7 @@ | |||
3 | #include "trace-graph.h" | 3 | #include "trace-graph.h" |
4 | #include "trace-filter.h" | 4 | #include "trace-filter.h" |
5 | 5 | ||
6 | #define DEBUG_LEVEL 0 | 6 | #define DEBUG_LEVEL 1 |
7 | #if DEBUG_LEVEL > 0 | 7 | #if DEBUG_LEVEL > 0 |
8 | #define dprintf(l, x...) \ | 8 | #define dprintf(l, x...) \ |
9 | do { \ | 9 | do { \ |
@@ -75,6 +75,18 @@ static int update_job(struct rt_task_info *rtt_info, int job) | |||
75 | return 1; | 75 | return 1; |
76 | } | 76 | } |
77 | 77 | ||
78 | static int rt_task_plot_is_drawn(struct graph_info *ginfo, int eid) | ||
79 | { | ||
80 | struct rt_graph_info *rtg_info = &ginfo->rtg_info; | ||
81 | |||
82 | return (eid == rtg_info->switch_away_id || | ||
83 | eid == rtg_info->switch_to_id || | ||
84 | eid == rtg_info->task_completion_id || | ||
85 | /* eid == rtg_info->task_block_id || */ | ||
86 | /* eid == rtg_info->task_resume_id || */ | ||
87 | eid == rtg_info->task_release_id); | ||
88 | } | ||
89 | |||
78 | /* | 90 | /* |
79 | * Get information about the given @time. | 91 | * Get information about the given @time. |
80 | * @out_job: Job number at this time | 92 | * @out_job: Job number at this time |
@@ -203,8 +215,8 @@ static int try_block(struct graph_info *ginfo, struct rt_task_info *rtt_info, | |||
203 | if (match && pid == rtt_info->pid) { | 215 | if (match && pid == rtt_info->pid) { |
204 | rtt_info->fresh = FALSE; | 216 | rtt_info->fresh = FALSE; |
205 | rtt_info->block_time = ts; | 217 | rtt_info->block_time = ts; |
206 | rtt_info->block_cpu = NO_CPU; | 218 | rtt_info->block_cpu = record->cpu; |
207 | dprintf(3, "Resume for %d on %d at %llu\n", | 219 | dprintf(3, "Block for %d on %d at %llu\n", |
208 | pid, record->cpu, ts); | 220 | pid, record->cpu, ts); |
209 | ret = 1; | 221 | ret = 1; |
210 | } | 222 | } |
@@ -292,7 +304,7 @@ static int try_switch_to(struct graph_info *ginfo, struct rt_task_info *rtt_info | |||
292 | static int try_other(struct graph_info *ginfo, struct rt_task_info *rtt_info, | 304 | static int try_other(struct graph_info *ginfo, struct rt_task_info *rtt_info, |
293 | struct record *record, struct plot_info *info) | 305 | struct record *record, struct plot_info *info) |
294 | { | 306 | { |
295 | int pid, eid, epid, my_pid, my_cpu, not_sa, not_ss, ret = 0; | 307 | int pid, eid, epid, my_pid, my_cpu, not_sa, not_ss, not_drawn, ret = 0; |
296 | unsigned long long ts; | 308 | unsigned long long ts; |
297 | 309 | ||
298 | pid = rtt_info->pid; | 310 | pid = rtt_info->pid; |
@@ -302,8 +314,9 @@ static int try_other(struct graph_info *ginfo, struct rt_task_info *rtt_info, | |||
302 | my_cpu = (rtt_info->run_time && record->cpu == rtt_info->run_cpu); | 314 | my_cpu = (rtt_info->run_time && record->cpu == rtt_info->run_cpu); |
303 | not_sa = (eid != ginfo->rtg_info.switch_away_id); | 315 | not_sa = (eid != ginfo->rtg_info.switch_away_id); |
304 | not_ss = (eid != ginfo->event_sched_switch_id); | 316 | not_ss = (eid != ginfo->event_sched_switch_id); |
317 | not_drawn = (!rt_task_plot_is_drawn(ginfo, eid)); | ||
305 | 318 | ||
306 | if ((my_pid || my_cpu) && not_ss && not_sa) { | 319 | if ((my_pid || my_cpu) && not_ss && not_sa && not_drawn) { |
307 | info->line = TRUE; | 320 | info->line = TRUE; |
308 | info->lcolor = hash_pid(record->cpu); | 321 | info->lcolor = hash_pid(record->cpu); |
309 | info->ltime = ts; | 322 | info->ltime = ts; |
@@ -448,18 +461,6 @@ rt_task_plot_record_matches(struct rt_plot_common *rt, | |||
448 | } | 461 | } |
449 | 462 | ||
450 | 463 | ||
451 | static int rt_task_plot_is_drawn(struct graph_info *ginfo, int eid) | ||
452 | { | ||
453 | struct rt_graph_info *rtg_info = &ginfo->rtg_info; | ||
454 | |||
455 | return (eid == rtg_info->switch_away_id || | ||
456 | eid == rtg_info->switch_to_id || | ||
457 | eid == rtg_info->task_completion_id || | ||
458 | eid == rtg_info->task_block_id || | ||
459 | eid == rtg_info->task_resume_id || | ||
460 | eid == rtg_info->task_release_id); | ||
461 | } | ||
462 | |||
463 | static struct record* | 464 | static struct record* |
464 | rt_task_plot_write_header(struct rt_plot_common *rt, | 465 | rt_task_plot_write_header(struct rt_plot_common *rt, |
465 | struct graph_info *ginfo, | 466 | struct graph_info *ginfo, |
@@ -467,7 +468,7 @@ rt_task_plot_write_header(struct rt_plot_common *rt, | |||
467 | unsigned long long time) | 468 | unsigned long long time) |
468 | { | 469 | { |
469 | const char *comm; | 470 | const char *comm; |
470 | int pid, job, found; | 471 | int pid, job = -1, found; |
471 | struct record *record; | 472 | struct record *record; |
472 | unsigned long long release, deadline; | 473 | unsigned long long release, deadline; |
473 | struct rt_task_info *rtt_info = (struct rt_task_info*)rt; | 474 | struct rt_task_info *rtt_info = (struct rt_task_info*)rt; |