diff options
| -rw-r--r-- | rt-graph.c | 6 | ||||
| -rw-r--r-- | rt-plot-cpu.c | 28 | ||||
| -rw-r--r-- | trace-graph.c | 3 |
3 files changed, 22 insertions, 15 deletions
| @@ -157,9 +157,9 @@ int rt_graph_check_task_param(struct rt_graph_info *rtg_info, | |||
| 157 | * Return 1 and @pid, @job, and @ts if the record matches | 157 | * Return 1 and @pid, @job, and @ts if the record matches |
| 158 | */ | 158 | */ |
| 159 | int rt_graph_check_switch_to(struct rt_graph_info *rtg_info, | 159 | int rt_graph_check_switch_to(struct rt_graph_info *rtg_info, |
| 160 | struct pevent *pevent, struct record *record, | 160 | struct pevent *pevent, struct record *record, |
| 161 | gint *pid, gint *job, | 161 | gint *pid, gint *job, |
| 162 | unsigned long long *ts) | 162 | unsigned long long *ts) |
| 163 | { | 163 | { |
| 164 | struct event_format *event; | 164 | struct event_format *event; |
| 165 | unsigned long long val; | 165 | unsigned long long val; |
diff --git a/rt-plot-cpu.c b/rt-plot-cpu.c index 25c4ec9..4c98a95 100644 --- a/rt-plot-cpu.c +++ b/rt-plot-cpu.c | |||
| @@ -78,11 +78,6 @@ __find_record(struct graph_info *ginfo, int cpu, unsigned long long time, | |||
| 78 | 78 | ||
| 79 | if (display) | 79 | if (display) |
| 80 | ignored = !is_displayed(ginfo, eid); | 80 | ignored = !is_displayed(ginfo, eid); |
| 81 | else | ||
| 82 | /* Without this ignore, the info popup is going | ||
| 83 | * to be sched_switchs almost always. | ||
| 84 | */ | ||
| 85 | ignored = (eid == ginfo->event_sched_switch_id); | ||
| 86 | 81 | ||
| 87 | if (get_rts(ginfo, record) >= time && !ignored) | 82 | if (get_rts(ginfo, record) >= time && !ignored) |
| 88 | break; | 83 | break; |
| @@ -138,13 +133,14 @@ static int get_time_info(struct graph_info *ginfo, | |||
| 138 | struct record *record; | 133 | struct record *record; |
| 139 | struct rt_graph_info *rtg_info = &ginfo->rtg_info; | 134 | struct rt_graph_info *rtg_info = &ginfo->rtg_info; |
| 140 | unsigned long long dull, max_ts; | 135 | unsigned long long dull, max_ts; |
| 136 | const char *comm; | ||
| 141 | int cpu, is_running, pid, job; | 137 | int cpu, is_running, pid, job; |
| 142 | 138 | ||
| 143 | cpu = rtc_info->cpu; | 139 | cpu = rtc_info->cpu; |
| 144 | *out_pid = *out_job = is_running = 0; | 140 | *out_pid = *out_job = is_running = 0; |
| 145 | 141 | ||
| 142 | *out_record = find_display_record(ginfo, cpu, time); | ||
| 146 | record = find_record(ginfo, cpu, time); | 143 | record = find_record(ginfo, cpu, time); |
| 147 | *out_record = record; | ||
| 148 | if (!record) | 144 | if (!record) |
| 149 | goto out; | 145 | goto out; |
| 150 | 146 | ||
| @@ -154,14 +150,22 @@ static int get_time_info(struct graph_info *ginfo, | |||
| 154 | break; | 150 | break; |
| 155 | 151 | ||
| 156 | #define ARG rtg_info, ginfo->pevent, record, &pid, &job, &dull | 152 | #define ARG rtg_info, ginfo->pevent, record, &pid, &job, &dull |
| 157 | if (rt_graph_check_switch_to(ARG)) { | 153 | if (rt_graph_check_switch_to(ARG) && pid) { |
| 158 | /* Nothing is running */ | ||
| 159 | goto out; | 154 | goto out; |
| 160 | } else if (rt_graph_check_switch_away(ARG)) { | 155 | } else if (rt_graph_check_switch_away(ARG) && pid) { |
| 161 | is_running = 1; | 156 | is_running = 1; |
| 162 | *out_pid = pid; | 157 | *out_pid = pid; |
| 163 | *out_job = job; | 158 | *out_job = job; |
| 164 | goto out; | 159 | goto out; |
| 160 | } else if (trace_graph_check_sched_switch(ginfo, record, | ||
| 161 | &pid, &comm)) { | ||
| 162 | pid = pevent_data_pid(ginfo->pevent, record); | ||
| 163 | if (pid) { | ||
| 164 | *out_pid = pid; | ||
| 165 | *out_job = 0; | ||
| 166 | is_running = 1; | ||
| 167 | goto out; | ||
| 168 | } | ||
| 165 | } | 169 | } |
| 166 | if (*out_record != record) | 170 | if (*out_record != record) |
| 167 | free_record(record); | 171 | free_record(record); |
| @@ -182,6 +186,7 @@ try_switch_away(struct graph_info *ginfo, struct rt_cpu_info *rtc_info, | |||
| 182 | 186 | ||
| 183 | match = rt_graph_check_switch_away(&ginfo->rtg_info, ginfo->pevent, | 187 | match = rt_graph_check_switch_away(&ginfo->rtg_info, ginfo->pevent, |
| 184 | record, &pid, &job, &ts); | 188 | record, &pid, &job, &ts); |
| 189 | match = match && pid; | ||
| 185 | if (match) { | 190 | if (match) { |
| 186 | update_pid(rtc_info, pid); | 191 | update_pid(rtc_info, pid); |
| 187 | if (rtc_info->rt_run_time && rtc_info->rt_run_time < ts && | 192 | if (rtc_info->rt_run_time && rtc_info->rt_run_time < ts && |
| @@ -209,6 +214,8 @@ try_switch_to(struct graph_info *ginfo, struct rt_cpu_info *rtc_info, | |||
| 209 | 214 | ||
| 210 | match = rt_graph_check_switch_to(&ginfo->rtg_info, ginfo->pevent, | 215 | match = rt_graph_check_switch_to(&ginfo->rtg_info, ginfo->pevent, |
| 211 | record, &pid, &job, &ts); | 216 | record, &pid, &job, &ts); |
| 217 | match = match && pid; | ||
| 218 | |||
| 212 | if (match) { | 219 | if (match) { |
| 213 | update_pid(rtc_info, pid); | 220 | update_pid(rtc_info, pid); |
| 214 | rtc_info->rt_run_time = ts; | 221 | rtc_info->rt_run_time = ts; |
| @@ -246,7 +253,8 @@ try_sched_switch(struct graph_info *ginfo, struct rt_cpu_info *rtc_info, | |||
| 246 | /* Only draw if no real-time task is running */ | 253 | /* Only draw if no real-time task is running */ |
| 247 | if (!rtc_info->rt_run_time) { | 254 | if (!rtc_info->rt_run_time) { |
| 248 | if (rtc_info->reg_run_time && | 255 | if (rtc_info->reg_run_time && |
| 249 | rtc_info->reg_run_time < get_rts(ginfo, record)) { | 256 | rtc_info->reg_run_time < get_rts(ginfo, record) && |
| 257 | from_pid) { | ||
| 250 | /* A non-rt task was running */ | 258 | /* A non-rt task was running */ |
| 251 | info->box = TRUE; | 259 | info->box = TRUE; |
| 252 | info->bthin = TRUE; | 260 | info->bthin = TRUE; |
diff --git a/trace-graph.c b/trace-graph.c index 76420d6..226c893 100644 --- a/trace-graph.c +++ b/trace-graph.c | |||
| @@ -1644,7 +1644,6 @@ static gint draw_plot_line(struct graph_info *ginfo, int i, | |||
| 1644 | gint y; | 1644 | gint y; |
| 1645 | 1645 | ||
| 1646 | x = convert_time_to_x(ginfo, time); | 1646 | x = convert_time_to_x(ginfo, time); |
| 1647 | /* y = (small) ? PLOT_BOX_TOP(i) : PLOT_TOP(i); */ | ||
| 1648 | y = PLOT_TOP(i); | 1647 | y = PLOT_TOP(i); |
| 1649 | 1648 | ||
| 1650 | if (!small || is_high_res(ginfo)) { | 1649 | if (!small || is_high_res(ginfo)) { |
| @@ -1696,7 +1695,7 @@ static void draw_plot_box(struct graph_info *ginfo, int i, | |||
| 1696 | fill, | 1695 | fill, |
| 1697 | x1, y, | 1696 | x1, y, |
| 1698 | x2 - x1, size); | 1697 | x2 - x1, size); |
| 1699 | if (is_high_res(ginfo)) { | 1698 | if (!thin && is_high_res(ginfo)) { |
| 1700 | gdk_draw_rectangle(ginfo->curr_pixmap, | 1699 | gdk_draw_rectangle(ginfo->curr_pixmap, |
| 1701 | ginfo->draw->style->black_gc, | 1700 | ginfo->draw->style->black_gc, |
| 1702 | FALSE, | 1701 | FALSE, |
