Skip to content

Commit 81d5bb6

Browse files
authored
Use persistent snapshot buffer (LLNL#523)
1 parent ecd9138 commit 81d5bb6

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/caliper/Caliper.cpp

+8-6
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ struct Caliper::ThreadData
252252
MetadataTree tree;
253253
::siglock lock;
254254

255+
SnapshotRecord snapshot;
256+
255257
// This thread's blackboard
256258
Blackboard thread_blackboard;
257259
// copy of the last process blackboard snapshot
@@ -902,17 +904,17 @@ Caliper::push_snapshot(Channel* channel, SnapshotView trigger_info)
902904
std::lock_guard<::siglock>
903905
g(sT->lock);
904906

905-
SnapshotRecord rec;
907+
sT->snapshot.reset();
906908

907909
// copy pull_snapshot() functionality to avoid superfluous siglock update
908-
rec.builder().append(trigger_info);
909-
channel->mP->events.snapshot(this, channel, trigger_info, rec.builder());
910+
sT->snapshot.builder().append(trigger_info);
911+
channel->mP->events.snapshot(this, channel, trigger_info, sT->snapshot.builder());
910912

911-
sT->thread_blackboard.snapshot(rec.builder());
913+
sT->thread_blackboard.snapshot(sT->snapshot.builder());
912914
sT->update_process_snapshot(sG->process_blackboard);
913-
rec.builder().append(sT->process_snapshot.view());
915+
sT->snapshot.builder().append(sT->process_snapshot.view());
914916

915-
channel->mP->events.process_snapshot(this, channel, trigger_info, rec.view());
917+
channel->mP->events.process_snapshot(this, channel, trigger_info, sT->snapshot.view());
916918
}
917919

918920
void

0 commit comments

Comments
 (0)