aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--trace-plot-task.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/trace-plot-task.c b/trace-plot-task.c
index 0c9f8e0..c8d0905 100644
--- a/trace-plot-task.c
+++ b/trace-plot-task.c
@@ -464,7 +464,9 @@ find_previous_record(struct graph_info *ginfo, struct record *start_record,
464 gint sched_pid; 464 gint sched_pid;
465 int count = 0; 465 int count = 0;
466 466
467 if (!last_record) 467 if (last_record)
468 last_record->ref_count++;
469 else
468 last_record = tracecmd_read_cpu_last(ginfo->handle, cpu); 470 last_record = tracecmd_read_cpu_last(ginfo->handle, cpu);
469 471
470 while ((record = tracecmd_read_prev(ginfo->handle, last_record))) { 472 while ((record = tracecmd_read_prev(ginfo->handle, last_record))) {
@@ -475,8 +477,7 @@ find_previous_record(struct graph_info *ginfo, struct record *start_record,
475 if (match) 477 if (match)
476 break; 478 break;
477 479
478 if (last_record != start_record) 480 free_record(last_record);
479 free_record(last_record);
480 481
481 if (count > MAX_SEARCH) { 482 if (count > MAX_SEARCH) {
482 free_record(record); 483 free_record(record);
@@ -485,8 +486,7 @@ find_previous_record(struct graph_info *ginfo, struct record *start_record,
485 last_record = record; 486 last_record = record;
486 } 487 }
487 488
488 if (last_record != start_record) 489 free_record(last_record);
489 free_record(last_record);
490 490
491 return record; 491 return record;
492} 492}