From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp55.i.mail.ru (smtp55.i.mail.ru [217.69.128.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id E9D37452566 for ; Wed, 13 Nov 2019 21:04:21 +0300 (MSK) From: Serge Petrenko Date: Wed, 13 Nov 2019 21:04:00 +0300 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 1/2] fiber: reset clock stats on fiber.top_enable() List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: v.shpilevoy@tarantool.org Cc: tarantool-patches@dev.tarantool.org Follow-up #2694 --- src/lib/core/fiber.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/core/fiber.c b/src/lib/core/fiber.c index aebaba7f0..cad1e21b0 100644 --- a/src/lib/core/fiber.c +++ b/src/lib/core/fiber.c @@ -1206,12 +1206,15 @@ fiber_top_enable() cord()->clock_acc = 0; cord()->cpu_miss_count_last = 0; cord()->clock_delta_last = 0; + cord()->clock_delta = 0; struct timespec ts; if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) != 0) { say_debug("clock_gettime(): failed to get this" "thread's cpu time."); return; } + cord()->clock_last = __rdtscp(&cord()->cpu_id_last); + cord()->cpu_miss_count = 0; cord()->cputime_last = (uint64_t) ts.tv_sec * FIBER_TIME_RES + ts.tv_nsec; } -- 2.21.0 (Apple Git-122)