From 381c97caa41eb85b52afca40794b2223e7f36d33 Mon Sep 17 00:00:00 2001 From: Yinan Zhang Date: Thu, 16 Apr 2020 13:37:19 -0700 Subject: [PATCH] Treat postponed prof sample event as new event --- src/prof.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/prof.c b/src/prof.c index ad83cfe5..77aa44d4 100644 --- a/src/prof.c +++ b/src/prof.c @@ -563,7 +563,15 @@ prof_sample_new_event_wait(tsd_t *tsd) { uint64_t prof_sample_postponed_event_wait(tsd_t *tsd) { - return TE_MIN_START_WAIT; + /* + * The postponed wait time for prof sample event is computed as if we + * want a new wait time (i.e. as if the event were triggered). If we + * instead postpone to the immediate next allocation, like how we're + * handling the other events, then we can have sampling bias, if e.g. + * the allocation immediately following a reentrancy always comes from + * the same stack trace. + */ + return prof_sample_new_event_wait(tsd); } int