aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--trace-plot-task.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/trace-plot-task.c b/trace-plot-task.c
index 552f274..9ca97a3 100644
--- a/trace-plot-task.c
+++ b/trace-plot-task.c
@@ -376,20 +376,23 @@ static void update_last_record(struct graph_info *ginfo,
376 } else { 376 } else {
377 static int once; 377 static int once;
378 378
379 saved = tracecmd_peek_data(handle, cpu); 379 saved = tracecmd_read_data(handle, cpu);
380 set_cpu_to_time(cpu, ginfo, ts); 380 set_cpu_to_time(cpu, ginfo, ts);
381 t2record = tracecmd_read_data(handle, cpu); 381 t2record = tracecmd_read_data(handle, cpu);
382 trecord = tracecmd_read_prev(handle, t2record); 382 trecord = tracecmd_read_prev(handle, t2record);
383 free_record(t2record); 383 free_record(t2record);
384 /* reset cursor back to what it was */ 384 /* reset cursor back to what it was */
385 if (saved) 385 if (saved) {
386 tracecmd_set_cursor(handle, cpu, saved->offset); 386 tracecmd_set_cursor(handle, cpu, saved->offset);
387 else { 387 free_record(saved);
388 } else {
388 saved = tracecmd_read_data(handle, cpu); 389 saved = tracecmd_read_data(handle, cpu);
389 if (!once && saved) { 390 if (!once && saved) {
390 once++; 391 once++;
391 warning("failed to reset cursor to end!"); 392 warning("failed to reset cursor to end!");
392 } 393 }
394 /* saved should always be NULL */
395 free_record(saved);
393 } 396 }
394 } 397 }
395 if (!trecord) 398 if (!trecord)