Description
It was pointed out that some UNTIMED events only call set_endtime(), for example some events in jfrPeriodic.cpp. There has been some changes in the logic for timestamps, and this can have caused some weird effects, for example:
// Write allocation statistics to buffer.
for(int i = 0; i < thread_ids.length(); i++) {
EventThreadAllocationStatistics event(UNTIMED);
event.set_allocated(allocated.at(i));
event.set_thread(thread_ids.at(i));
event.set_endtime(time_stamp);
event.commit();
}
This event will not have the declared time_stamp, but will instead get a new timestamp because set_starttime() is not called.
Revise usages to ensure they are correct in relation to timestamping.
// Write allocation statistics to buffer.
for(int i = 0; i < thread_ids.length(); i++) {
EventThreadAllocationStatistics event(UNTIMED);
event.set_allocated(allocated.at(i));
event.set_thread(thread_ids.at(i));
event.set_endtime(time_stamp);
event.commit();
}
This event will not have the declared time_stamp, but will instead get a new timestamp because set_starttime() is not called.
Revise usages to ensure they are correct in relation to timestamping.