aboutsummaryrefslogtreecommitdiffstats
path: root/trace-plot-cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'trace-plot-cpu.c')
-rw-r--r--trace-plot-cpu.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/trace-plot-cpu.c b/trace-plot-cpu.c
index ccc2bff..5f28e18 100644
--- a/trace-plot-cpu.c
+++ b/trace-plot-cpu.c
@@ -171,35 +171,11 @@ static void cpu_plot_start(struct graph_info *ginfo, struct graph_plot *plot,
171 unsigned long long time) 171 unsigned long long time)
172{ 172{
173 struct cpu_plot_info *cpu_info = plot->private; 173 struct cpu_plot_info *cpu_info = plot->private;
174 struct record *last_record = NULL;
175 struct record *record;
176 int cpu; 174 int cpu;
177 175
178 cpu = cpu_info->cpu; 176 cpu = cpu_info->cpu;
179 cpu_info->last_time = 0ULL; 177 cpu_info->last_time = 0ULL;
180 cpu_info->last_pid = -1; 178 cpu_info->last_pid = -1;
181
182 tracecmd_set_cpu_to_timestamp(ginfo->handle, cpu, time);
183
184 while ((record = tracecmd_read_data(ginfo->handle, cpu))) {
185 if (record->ts >= time)
186 break;
187
188 free_record(last_record);
189 last_record = record;
190 }
191
192 free_record(record);
193 /* reset so the next record read is the first record */
194 if (last_record) {
195 record = tracecmd_read_at(ginfo->handle,
196 last_record->offset,
197 NULL);
198 free_record(record);
199 free_record(last_record);
200 } else
201 tracecmd_set_cpu_to_timestamp(ginfo->handle, cpu, time);
202
203} 179}
204 180
205static int cpu_plot_event(struct graph_info *ginfo, 181static int cpu_plot_event(struct graph_info *ginfo,