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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/trace-plot-cpu.c b/trace-plot-cpu.c
index 50d720b..1c86df8 100644
--- a/trace-plot-cpu.c
+++ b/trace-plot-cpu.c
@@ -141,6 +141,7 @@ static int cpu_plot_display_last_event(struct graph_info *ginfo,
141 141
142 tracecmd_set_cpu_to_timestamp(ginfo->handle, cpu, time); 142 tracecmd_set_cpu_to_timestamp(ginfo->handle, cpu, time);
143 143
144again:
144 /* find the non filtered event */ 145 /* find the non filtered event */
145 while ((record = tracecmd_read_data(ginfo->handle, cpu))) { 146 while ((record = tracecmd_read_data(ginfo->handle, cpu))) {
146 if (!filter_record(ginfo, record, &pid, &sched_pid, &is_sched_switch) && 147 if (!filter_record(ginfo, record, &pid, &sched_pid, &is_sched_switch) &&
@@ -159,6 +160,10 @@ static int cpu_plot_display_last_event(struct graph_info *ginfo,
159 /* Must have the record we want */ 160 /* Must have the record we want */
160 type = pevent_data_type(ginfo->pevent, record); 161 type = pevent_data_type(ginfo->pevent, record);
161 event = pevent_data_event_from_type(ginfo->pevent, type); 162 event = pevent_data_event_from_type(ginfo->pevent, type);
163 /* Unlikely that the event was not saved */
164 if (!event)
165 goto again;
166
162 if (is_sched_switch) 167 if (is_sched_switch)
163 pid = sched_pid; 168 pid = sched_pid;
164 trace_seq_printf(s, "%s-%d\n%s\n", 169 trace_seq_printf(s, "%s-%d\n%s\n",