diff options
Diffstat (limited to 'rt-plot-cpu.c')
-rw-r--r-- | rt-plot-cpu.c | 28 |
1 files changed, 18 insertions, 10 deletions
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; |