File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
contrib/plugins/bap-tracing Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,7 @@ static void cb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) {
199
199
200
200
static void plugin_exit (qemu_plugin_id_t id , void * udata ) {
201
201
g_rw_lock_writer_lock (& state .frame_buffer_lock );
202
+ // Dump the rest of the frames.
202
203
for (size_t i = 0 ; i < state .vcpus -> len ; ++ i ) {
203
204
FrameBuffer * fbuf = g_ptr_array_index (state .frame_buffer , i );
204
205
write_toc_entry (fbuf );
@@ -223,7 +224,14 @@ static void plugin_exit(qemu_plugin_id_t id, void *udata) {
223
224
uint64_t m = state .toc_entries_offsets -> len ;
224
225
WRITE (m );
225
226
226
- for (size_t i = 0 ; i < m ; ++ i ) {
227
+ for (size_t i = 0 ; i < m - 1 ; ++ i ) {
228
+ // All except the last address in state.toc_entries_offsets
229
+ // point to an entry. The last one points to nothing, because
230
+ // we first push the offset and then push the frames later
231
+ // when the buffer is full.
232
+ // When we dumped the last frames above it lastly
233
+ // pushed an additional offset.
234
+ // This one we skip here with m - 1.
227
235
uint64_t toc_entry_off =
228
236
g_array_index (state .toc_entries_offsets , uint64_t , i );
229
237
WRITE (toc_entry_off );
You can’t perform that action at this time.
0 commit comments