Fetch time after tctx and only for samples

This commit is contained in:
Yinan Zhang 2020-01-14 11:12:18 -08:00
parent a5d3dd4059
commit ad3f3fc561

View File

@ -372,18 +372,20 @@ void
large_prof_info_get(tsd_t *tsd, edata_t *edata, prof_info_t *prof_info, large_prof_info_get(tsd_t *tsd, edata_t *edata, prof_info_t *prof_info,
bool reset_recent) { bool reset_recent) {
assert(prof_info != NULL); assert(prof_info != NULL);
nstime_copy(&prof_info->alloc_time, edata_prof_alloc_time_get(edata));
prof_tctx_t *alloc_tctx = edata_prof_tctx_get(edata); prof_tctx_t *alloc_tctx = edata_prof_tctx_get(edata);
prof_info->alloc_tctx = alloc_tctx; prof_info->alloc_tctx = alloc_tctx;
if (reset_recent && (uintptr_t)alloc_tctx > (uintptr_t)1U) { if ((uintptr_t)alloc_tctx > (uintptr_t)1U) {
/* nstime_copy(&prof_info->alloc_time,
* This allocation was a prof sample. Reset the pointer on the edata_prof_alloc_time_get(edata));
* recent allocation record, so that this allocation is if (reset_recent) {
* recorded as released. /*
*/ * Reset the pointer on the recent allocation record,
prof_recent_alloc_reset(tsd, edata); * so that this allocation is recorded as released.
*/
prof_recent_alloc_reset(tsd, edata);
}
} }
} }