From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 295778E95 for ; Thu, 21 Jan 2016 12:06:18 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP; 21 Jan 2016 03:06:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,325,1449561600"; d="scan'208";a="33519385" Received: from sie-lab-212-120.ir.intel.com (HELO silpixa00394367.ir.intel.com) ([10.237.212.120]) by fmsmga004.fm.intel.com with ESMTP; 21 Jan 2016 03:06:17 -0800 From: Harry van Haaren To: remy.horton@intel.com Date: Thu, 21 Jan 2016 11:05:26 +0000 Message-Id: <1453374327-26635-3-git-send-email-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1453374327-26635-1-git-send-email-harry.van.haaren@intel.com> References: <1453305221-11125-1-git-send-email-harry.van.haaren@intel.com> <1453374327-26635-1-git-send-email-harry.van.haaren@intel.com> Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH v2 2/3] eal: add keepalive core register timestamp X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 11:06:19 -0000 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 736fd0f..5358322 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 static void print_trace(const char *msg, struct rte_keepalive *keepcfg, int idx_core) @@ -108,6 +109,8 @@ 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