From mboxrd@z Thu Jan 1 00:00:00 1970 From: Harry van Haaren Subject: [PATCH v3 2/3] eal: add keepalive core register timestamp Date: Mon, 22 Feb 2016 11:26:01 +0000 Message-ID: <1456140362-3771-3-git-send-email-harry.van.haaren@intel.com> References: <1453374327-26635-1-git-send-email-harry.van.haaren@intel.com> <1456140362-3771-1-git-send-email-harry.van.haaren@intel.com> Cc: dev@dpdk.org To: remy.horton@intel.com Return-path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 20955569C for ; Mon, 22 Feb 2016 12:27:17 +0100 (CET) In-Reply-To: <1456140362-3771-1-git-send-email-harry.van.haaren@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch sets a timestamp on each lcore when it is registered for keepalive. This causes the first values read by the monitor to show time since the core was registered, instead of the delta between 0 and the timestamp counter. Signed-off-by: Harry van Haaren --- lib/librte_eal/common/rte_keepalive.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/common/rte_keepalive.c b/lib/librte_eal/common/rte_keepalive.c index bd1f16b..be9e30d 100644 --- a/lib/librte_eal/common/rte_keepalive.c +++ b/lib/librte_eal/common/rte_keepalive.c @@ -38,6 +38,7 @@ #include #include #include +#include struct rte_keepalive { /** Core Liveness. */ @@ -139,8 +140,10 @@ rte_keepalive_create(rte_keepalive_failure_callback_t callback, void rte_keepalive_register_core(struct rte_keepalive *keepcfg, const int id_core) { - if (id_core < RTE_KEEPALIVE_MAXCORES) + if (id_core < RTE_KEEPALIVE_MAXCORES) { keepcfg->active_cores[id_core] = 1; + keepcfg->last_alive[id_core] = rte_rdtsc(); + } } -- 2.5.0