diff options
| author | Steven Rostedt <srostedt@redhat.com> | 2011-02-21 17:24:59 -0500 |
|---|---|---|
| committer | Steven Rostedt <rostedt@goodmis.org> | 2011-02-21 20:42:08 -0500 |
| commit | cfe5212d7a016c9143cd891bd1ab3bedd9bf5c44 (patch) | |
| tree | 5dfbef1bb4807896cef054ec184be4e3b7be0d24 /trace-plot-cpu.c | |
| parent | 84de80460fa0bef25c4b75a2d12ba1ba043cc74f (diff) | |
trace-graph: Free last_record in cpu plot on restart
The restart of drawing a cpu plot may still have a left over record.
Free it before initializing a new drawing.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'trace-plot-cpu.c')
| -rw-r--r-- | trace-plot-cpu.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/trace-plot-cpu.c b/trace-plot-cpu.c index 4d06aa6..9033515 100644 --- a/trace-plot-cpu.c +++ b/trace-plot-cpu.c | |||
| @@ -200,6 +200,7 @@ static void cpu_plot_start(struct graph_info *ginfo, struct graph_plot *plot, | |||
| 200 | cpu = cpu_info->cpu; | 200 | cpu = cpu_info->cpu; |
| 201 | cpu_info->last_time = 0ULL; | 201 | cpu_info->last_time = 0ULL; |
| 202 | cpu_info->last_pid = -1; | 202 | cpu_info->last_pid = -1; |
| 203 | free_record(cpu_info->last_record); | ||
| 203 | cpu_info->last_record = NULL; | 204 | cpu_info->last_record = NULL; |
| 204 | } | 205 | } |
| 205 | 206 | ||
| @@ -470,6 +471,7 @@ static void add_cpu_plot(struct graph_info *ginfo, gint cpu) | |||
| 470 | char label[100]; | 471 | char label[100]; |
| 471 | 472 | ||
| 472 | cpu_info = malloc_or_die(sizeof(*cpu_info)); | 473 | cpu_info = malloc_or_die(sizeof(*cpu_info)); |
| 474 | memset(cpu_info, 0, sizeof(*cpu_info)); | ||
| 473 | cpu_info->cpu = cpu; | 475 | cpu_info->cpu = cpu; |
| 474 | 476 | ||
| 475 | snprintf(label, 100, "CPU %d", cpu); | 477 | snprintf(label, 100, "CPU %d", cpu); |
